diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 21:56:26 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 21:56:26 +0000 |
commit | c2c132c637874d6d3104293791b15b38da58bfc9 (patch) | |
tree | f054e86c5722eb229c08fe1a37181aa41020b6cf /base/file_util.h | |
parent | a24642a800c1712eeaa791f0fb0ed1527885c6fb (diff) | |
download | chromium_src-c2c132c637874d6d3104293791b15b38da58bfc9.zip chromium_src-c2c132c637874d6d3104293791b15b38da58bfc9.tar.gz chromium_src-c2c132c637874d6d3104293791b15b38da58bfc9.tar.bz2 |
Function to compute the total size of the files in a directory
We need this for the diagnostic mode but it can be used by others.
Did not see test for GetFileSize() so added them
BUG=none
TEST=ut included
Review URL: http://codereview.chromium.org/1220001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r-- | base/file_util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/file_util.h b/base/file_util.h index 4d6077e..fdc13ee 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -71,6 +71,13 @@ bool ContainsPath(const FilePath& parent, const FilePath& child); int CountFilesCreatedAfter(const FilePath& path, const base::Time& file_time); +// Returns the total number of bytes used by all the files under |root_path|. +// If the path does not exist the function returns 0. +// +// This function is implemented using the FileEnumerator class so it is not +// particularly speedy in any platform. +int64 ComputeDirectorySize(const FilePath& root_path); + // Deletes the given path, whether it's a file or a directory. // If it's a directory, it's perfectly happy to delete all of the // directory's contents. Passing true to recursive deletes |