diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-09 15:49:20 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-09 15:49:20 +0000 |
commit | 0643a49e311c0ddb17f292f525ebd11f51f158a1 (patch) | |
tree | de8f50c0070fd6ff52eced3bdd96c747f1e9ea45 /net/base/file_stream.h | |
parent | f3e8965444b0b615ed8aabfcacc5840f6684c0c5 (diff) | |
download | chromium_src-0643a49e311c0ddb17f292f525ebd11f51f158a1.zip chromium_src-0643a49e311c0ddb17f292f525ebd11f51f158a1.tar.gz chromium_src-0643a49e311c0ddb17f292f525ebd11f51f158a1.tar.bz2 |
Adds truncate to FileStream.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/39301
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/file_stream.h')
-rw-r--r-- | net/base/file_stream.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/base/file_stream.h b/net/base/file_stream.h index 28b40e7..9447c07 100644 --- a/net/base/file_stream.h +++ b/net/base/file_stream.h @@ -109,6 +109,11 @@ class FileStream { // You can pass NULL as the callback for synchronous I/O. int Write(const char* buf, int buf_len, CompletionCallback* callback); + // Truncates the file to be |bytes| length. This is only valid for writable + // files. After truncation the file stream is positioned at |bytes|. The new + // position is retured, or a value < 0 on error. + int64 Truncate(int64 bytes); + private: class AsyncContext; friend class AsyncContext; |