Commit ea8063fa authored by jond@google.com's avatar jond@google.com

C++ File IO documentation.

Review URL: http://codereview.chromium.org/7307037

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96083 0039d316-1c4b-4281-b951-d872f2087c98
parent 8d64cf39
......@@ -46,10 +46,11 @@ class FileIO : public Resource {
/// reference.
/// @param[in] open_flags A bit-mask of the <code>PP_FileOpenFlags</code>
/// values.
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Open().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
/// @return An int32_t containing an error code from
/// <code>pp_errors.h</code>.
int32_t Open(const FileRef& file_ref,
int32_t open_flags,
const CompletionCallback& cc);
......@@ -57,12 +58,13 @@ class FileIO : public Resource {
/// Query() queries info about the file opened by this FileIO object. This
/// function will fail if the FileIO object has not been opened.
///
/// @param[in] info The <code>PP_FileInfo</code> structure representing all
/// information about the file.
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] result_buf The <code>PP_FileInfo</code> structure representing
/// all information about the file.
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Query().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
/// @return An int32_t containing an error code from
/// <code>pp_errors.h</code>.
int32_t Query(PP_FileInfo* result_buf,
const CompletionCallback& cc);
......@@ -71,23 +73,24 @@ class FileIO : public Resource {
///
/// @param[in] last_access_time The last time the FileIO was accessed.
/// @param[in] last_modified_time The last time the FileIO was modified.
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Touch().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
/// @return An int32_t containing an error code from
/// <code>pp_errors.h</code>.
int32_t Touch(PP_Time last_access_time,
PP_Time last_modified_time,
const CompletionCallback& cc);
/// Read() reads from an offset in the file. The size of the buffer must be
/// large enough to hold the specified number of bytes to read. This function
/// might perform a partial read.
/// large enough to hold the specified number of bytes to read. This
/// function might perform a partial read.
///
/// @param[in] offset The offset into the file.
/// @param[in] buffer The buffer to hold the specified number of bytes read.
/// @param[in] bytes_to_read The number of bytes to read from
/// <code>offset</code>.
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Read().
///
/// @return An The number of bytes read an error code from
......@@ -106,7 +109,7 @@ class FileIO : public Resource {
/// @param[in] buffer The buffer to hold the specified number of bytes read.
/// @param[in] bytes_to_write The number of bytes to write to
/// <code>offset</code>.
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Write().
///
/// @return An The number of bytes written or an error code from
......@@ -123,25 +126,28 @@ class FileIO : public Resource {
/// have been opened with write access.
///
/// @param[in] length The length of the file to be set.
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of SetLength().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
/// @return An int32_t containing an error code from
/// <code>pp_errors.h</code>.
int32_t SetLength(int64_t length,
const CompletionCallback& cc);
/// Flush() flushes changes to disk. This call can be very expensive!
///
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Flush().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
/// @return An int32_t containing an error code from
/// <code>pp_errors.h</code>.
int32_t Flush(const CompletionCallback& cc);
/// Close() cancels any IO that may be pending, and closes the FileIO object.
/// Any pending callbacks will still run, reporting
/// <code>PP_Error_Aborted</code> if pending IO was interrupted. It is not
/// valid to call Open() again after a call to this method.
///
/// <strong>Note:</strong> If the FileIO object is destroyed, and it is still
/// open, then it will be implicitly closed, so you are not required to call
/// Close().
......
......@@ -30,7 +30,7 @@ class FileRef : public Resource {
/// A constructor used to create a <code>FileRef</code> and associate it with
/// the provided <code>Instance</code>.
///
/// @param[in] instance An <code>Instance</code>.
/// @param[in] resource An <code>Instance</code>.
explicit FileRef(PP_Resource resource);
/// A special structure used by the constructor that does not increment the
......@@ -92,7 +92,7 @@ class FileRef : public Resource {
/// <strong>Note:</strong> Use MakeDirectoryIncludingAncestors() to create
/// parent directories.
///
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of MakeDirectory().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
......@@ -103,7 +103,7 @@ class FileRef : public Resource {
/// system as well as any parent directories. It is not valid to make a
/// directory in the external file system.
///
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of MakeDirectoryIncludingAncestors().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
......@@ -115,7 +115,7 @@ class FileRef : public Resource {
///
/// @param[in] last_access_time The last time the file was accessed.
/// @param[in] last_modified_time The last time the file was modified.
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Touch().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
......@@ -128,7 +128,7 @@ class FileRef : public Resource {
/// file or directory that is in use. It is not valid to delete a file in
/// the external file system.
///
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Delete().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
......@@ -141,7 +141,7 @@ class FileRef : public Resource {
///
/// @param[in] new_file_ref A <code>FileRef</code> corresponding to a new
/// file reference.
/// @param[in] callback A <code>CompletionCallback</code> to be called upon
/// @param[in] cc A <code>CompletionCallback</code> to be called upon
/// completion of Rename().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
......
......@@ -39,7 +39,7 @@ class FileSystem : public Resource {
/// any other operation on it.
///
/// @param[in] expected_size The expected size of the file system.
/// @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
/// @param[in] cc A <code>PP_CompletionCallback</code> to be called upon
/// completion of Open().
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment