* book.dox Reformat according to the guidelines
* BufferIO.dox Reformat according to the guidelines * DataIO.dox Reformat according to the guidelines * Flattenable.dox New documentation. * Locker.dox Finished documentation. * SupportDefs.dox Reformat according to the guidelines git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20511 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+100
-79
@@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Documentation by:
|
||||
* Niels Sascha Reedijk <[email protected]>
|
||||
* Stefano Ceccherini ([email protected])
|
||||
* Corresponds to:
|
||||
* /trunk/headers/os/support/BufferIO.h rev 19972
|
||||
* /trunk/src/kits/support/BufferIO.cpp rev 20510
|
||||
*/
|
||||
|
||||
/*!
|
||||
\file BufferIO.h
|
||||
\brief Provides the BBufferIO class.
|
||||
@@ -38,126 +50,135 @@
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BBufferIO::BBufferIO(BPositionIO *stream, size_t bufferSize, bool ownsStream)
|
||||
\brief Initialize a BBufferIO object.
|
||||
|
||||
The constructor will create a buffer of the given size
|
||||
and associate the object with the given BPositionIO stream.
|
||||
\fn BBufferIO::BBufferIO(BPositionIO *stream, size_t bufferSize, bool ownsStream)
|
||||
\brief Initialize a BBufferIO object.
|
||||
|
||||
The constructor will create a buffer of the given size
|
||||
and associate the object with the given BPositionIO stream.
|
||||
|
||||
\param stream A pointer to a BPositionIO object.
|
||||
\param bufferSize The size of the buffer that the object will allocate and use.
|
||||
\param ownsStream Specifies if the object will delete the stream on destruction.
|
||||
\param stream A pointer to a BPositionIO object.
|
||||
\param bufferSize The size of the buffer that the object will allocate and
|
||||
use.
|
||||
\param ownsStream Specifies if the object will delete the stream on
|
||||
destruction.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn BBufferIO::~BBufferIO()
|
||||
\brief Free the resources allocated by the object
|
||||
\fn BBufferIO::~BBufferIO()
|
||||
\brief Free the resources allocated by the object
|
||||
|
||||
Flush pending changes to the stream and free the allocated memory.
|
||||
If the \c owns_stream property is \c true, the destructor also
|
||||
deletes the stream associated with the BBufferIO object.
|
||||
Flush pending changes to the stream and free the allocated memory.
|
||||
If the \c owns_stream property is \c true, the destructor also
|
||||
deletes the stream associated with the BBufferIO object.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn ssize_t BBufferIO::ReadAt(off_t pos, void *buffer, size_t size)
|
||||
\brief Read the specified amount of bytes at the given position.
|
||||
\param pos The offset into the stream where to read.
|
||||
\param buffer A pointer to a buffer where to copy the read data.
|
||||
\param size The amount of bytes to read.
|
||||
\return The amount of bytes actually read, or an error code.
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO stream.
|
||||
\retval B_BAD_VALUE The \c buffer parameter is not valid.
|
||||
\fn ssize_t BBufferIO::ReadAt(off_t pos, void *buffer, size_t size)
|
||||
\brief Read the specified amount of bytes at the given position.
|
||||
\param pos The offset into the stream where to read.
|
||||
\param buffer A pointer to a buffer where to copy the read data.
|
||||
\param size The amount of bytes to read.
|
||||
\return The amount of bytes actually read, or an error code.
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||
stream.
|
||||
\retval B_BAD_VALUE The \c buffer parameter is not valid.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn ssize_t BBufferIO::WriteAt(off_t pos, const void *buffer, size_t size)
|
||||
\brief Write the specified amount of bytes at the given position.
|
||||
\param pos The offset into the stream where to write.
|
||||
\param buffer A pointer to a buffer which contains the data to write.
|
||||
\param size The amount of bytes to write.
|
||||
\return The amount of bytes actually written, or an error code.
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO stream.
|
||||
\retval B_BAD_VALUE The \c buffer parameter is not valid.
|
||||
\fn ssize_t BBufferIO::WriteAt(off_t pos, const void *buffer, size_t size)
|
||||
\brief Write the specified amount of bytes at the given position.
|
||||
\param pos The offset into the stream where to write.
|
||||
\param buffer A pointer to a buffer which contains the data to write.
|
||||
\param size The amount of bytes to write.
|
||||
\return The amount of bytes actually written, or an error code.
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||
stream.
|
||||
\retval B_BAD_VALUE The \c buffer parameter is not valid.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn off_t BBufferIO::Seek(off_t position, uint32 seekMode)
|
||||
\brief Set the position in the stream.
|
||||
|
||||
Set the position in the stream where the Read() and Write() functions
|
||||
(inherited from BPositionIO) begin reading and writing.
|
||||
How the position argument is understood depends on the seek_mode flag.
|
||||
|
||||
\param position The position where you want to seek.
|
||||
\param seekMode Can have three values:
|
||||
- \c SEEK_SET. The position passed is an offset from the beginning of the stream;
|
||||
in other words, the current position is set to position.
|
||||
For this mode, position should be a positive value.
|
||||
- \c SEEK_CUR. The position argument is an offset from the current position;
|
||||
the value of the argument is added to the current position.
|
||||
- \c SEEK_END. The position argument is an offset from the end of the stream.
|
||||
In this mode the position argument should be negative (or zero).
|
||||
\fn off_t BBufferIO::Seek(off_t position, uint32 seekMode)
|
||||
\brief Set the position in the stream.
|
||||
|
||||
Set the position in the stream where the Read() and Write() functions
|
||||
(inherited from BPositionIO) begin reading and writing.
|
||||
How the position argument is understood depends on the seek_mode flag.
|
||||
|
||||
\param position The position where you want to seek.
|
||||
\param seekMode Can have three values:
|
||||
- \c SEEK_SET. The position passed is an offset from the beginning of the
|
||||
stream; in other words, the current position is set to position.
|
||||
For this mode, position should be a positive value.
|
||||
- \c SEEK_CUR. The position argument is an offset from the current position;
|
||||
the value of the argument is added to the current position.
|
||||
- \c SEEK_END. The position argument is an offset from the end of the
|
||||
stream. In this mode the position argument should be negative (or zero).
|
||||
|
||||
\return The current position as an offset in bytes
|
||||
from the beginning of the stream.
|
||||
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO stream.
|
||||
\return The current position as an offset in bytes from the beginning of
|
||||
the stream.
|
||||
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||
stream.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn off_t BBufferIO::Position() const
|
||||
\brief Return the current position in the stream.
|
||||
\return The current position as an offset in bytes
|
||||
from the beginning of the stream.
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO stream.
|
||||
\fn off_t BBufferIO::Position() const
|
||||
\brief Return the current position in the stream.
|
||||
\return The current position as an offset in bytes
|
||||
from the beginning of the stream.
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||
stream.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BBufferIO::SetSize(off_t size)
|
||||
\brief Call the SetSize() function of the assigned BPositionIO stream.
|
||||
\param size The new size of the BPositionIO object.
|
||||
\retval B_OK The stream is resized.
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO stream.
|
||||
\fn status_t BBufferIO::SetSize(off_t size)
|
||||
\brief Call the SetSize() function of the assigned BPositionIO stream.
|
||||
\param size The new size of the BPositionIO object.
|
||||
\retval B_OK The stream is resized.
|
||||
\retval B_NO_INIT The object is not associated with a valid BPositionIO
|
||||
stream.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BBufferIO::Flush()
|
||||
\brief Write pending modifications to the stream.
|
||||
\return The amount of bytes written, or if it failed it will return an error code.
|
||||
\fn status_t BBufferIO::Flush()
|
||||
\brief Write pending modifications to the stream.
|
||||
\return The amount of bytes written, or if it failed it will return an error
|
||||
code.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn BPositionIO *BBufferIO::Stream() const
|
||||
\brief Return a pointer to the stream specified on construction.
|
||||
\return A pointer to the BPositionIO stream specified on construction.
|
||||
\fn BPositionIO *BBufferIO::Stream() const
|
||||
\brief Return a pointer to the stream specified on construction.
|
||||
\return A pointer to the BPositionIO stream specified on construction.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn size_t BBufferIO::BufferSize() const
|
||||
\brief Return the size of the internal buffer.
|
||||
\return The size of the buffer allocated by the object.
|
||||
\fn size_t BBufferIO::BufferSize() const
|
||||
\brief Return the size of the internal buffer.
|
||||
\return The size of the buffer allocated by the object.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool BBufferIO::OwnsStream() const
|
||||
\brief Tell if the BBufferIO object "owns" the specified stream.
|
||||
\retval true The object "owns" the stream and will destroy it upon destruction.
|
||||
\retval false The object does not own the stream.
|
||||
\sa SetOwnsStream()
|
||||
\fn bool BBufferIO::OwnsStream() const
|
||||
\brief Tell if the BBufferIO object "owns" the specified stream.
|
||||
\retval true The object "owns" the stream and will destroy it upon
|
||||
destruction.
|
||||
\retval false The object does not own the stream.
|
||||
\see SetOwnsStream()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BBufferIO::SetOwnsStream(bool owns_stream)
|
||||
\brief Set the \c owns_stream property of the object.
|
||||
\param owns_stream If you pass \c true, the object will delete the stream
|
||||
upon destruction, if you pass \c false it will not.
|
||||
\fn void BBufferIO::SetOwnsStream(bool owns_stream)
|
||||
\brief Set the \c owns_stream property of the object.
|
||||
\param owns_stream If you pass \c true, the object will delete the stream
|
||||
upon destruction, if you pass \c false it will not.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn void BBufferIO::PrintToStream() const
|
||||
\brief Print the object to stdout.
|
||||
\fn void BBufferIO::PrintToStream() const
|
||||
\brief Print the object to stdout.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user