#include <opennurbs_archive.h>
◆ anonymous enum
Enumerator |
---|
seek_from_beginning_of_file | |
seek_from_current_position | |
seek_from_end_of_file | |
◆ ON_Buffer() [1/2]
◆ ~ON_Buffer()
ON_Buffer::~ON_Buffer |
( |
| ) |
|
◆ ON_Buffer() [2/2]
ON_Buffer::ON_Buffer |
( |
const ON_Buffer & |
src | ) |
|
◆ AtEnd()
bool ON_Buffer::AtEnd |
( |
| ) |
const |
- Returns
- True if Size() == CurrentPosition().
It is possible to seek beyond the end of the buffer. In this case, the current position will be past the end of the buffer and AtEnd() will return false.
◆ ChangeSize()
bool ON_Buffer::ChangeSize |
( |
ON__UINT64 |
buffer_size | ) |
|
- Parameters
-
buffer_size | [in] new size of buffer. |
- Returns
- True if successful.
The current position is not changed and may be beyond the end of the file. Use Seek to set the current position after calling ChangeSize().
◆ ClearLastError()
void ON_Buffer::ClearLastError |
( |
| ) |
|
◆ Compact()
bool ON_Buffer::Compact |
( |
| ) |
|
Return unused memory to heap.
Call this function after creating an ON_Buffer that will persist for and extended amount of time. There are never more than 16 pages of unsued memory (16*4096 bytes on most computers) in an ON_Buffer. Compact() can be called at any time, but calling Compact() the then writing at the end of the buffer is not an efficient use of time or memory.
◆ Compare()
Compare contents of buffers. Paramters: a - [in] b - [in]
- Returns
- -1: a < b 0: a == b 1: a > b
◆ Compress()
bool ON_Buffer::Compress |
( |
ON_Buffer & |
compressed_buffer | ) |
const |
Compress this buffer
- Parameters
-
compressed_buffer | [out] (The reference can be *this) |
- Returns
- True if successful. False if failed.
@verbatim
buffer = ...;
if ( !buffer.Compress(buffer) )
{
}
else
{
}
@endverbatim
◆ CRC32()
ON__UINT32 ON_Buffer::CRC32 |
( |
ON__UINT32 |
current_remainder | ) |
const |
- Returns
- 32-bit CRC of the buffer contents.
◆ CurrentPosition()
ON__UINT64 ON_Buffer::CurrentPosition |
( |
| ) |
const |
- Returns
- Current position in the buffer.
It is possible to seek beyond the end of the buffer. In this case, the current position will be past the end of the buffer and CurrentPosition() will be greater than Size().
◆ Destroy()
void ON_Buffer::Destroy |
( |
| ) |
|
◆ EmergencyDestroy()
void ON_Buffer::EmergencyDestroy |
( |
| ) |
|
◆ ErrorHandler()
ON_Buffer_ErrorHandler ON_Buffer::ErrorHandler |
( |
| ) |
const |
◆ IsValid()
bool ON_Buffer::IsValid |
( |
const ON_TextLog * |
text_log | ) |
const |
◆ LastError()
ON__UINT32 ON_Buffer::LastError |
( |
| ) |
const |
- Returns
- Value that identifies most recent error. 0: no error 1: attempt to seek to a negative position
◆ operator=()
◆ Read()
ON__UINT64 ON_Buffer::Read |
( |
ON__UINT64 |
size, |
|
|
void * |
buffer |
|
) |
| |
◆ ReadFromBinaryArchive()
◆ Seek()
bool ON_Buffer::Seek |
( |
ON__INT64 |
offset, |
|
|
int |
origin |
|
) |
| |
- Parameters
-
offset | [in] number of bytes to seek from origin |
origin | [in] initial position. 0 (SEEK_SET) Seek from beginning of file. 1 (SEEK_CUR) Seek from current position. 2 (SEEK_END) Seek from end of file. |
- Returns
- True if successful. False if the seek would result in a file position before the beginning of the file. If false is returned, the current position is not changed.
Seeking beyond the end of the buffer is succeeds. Seeking before the beginning of the buffer fails.
◆ SeekFromCurrentPosition()
bool ON_Buffer::SeekFromCurrentPosition |
( |
ON__INT64 |
offset | ) |
|
- Parameters
-
offset | [in] number of bytes to seek from the current position. |
- Returns
- True if successful. False if the seek would result in a file position before the beginning of the file. If false is returned, the current position is not changed.
Seeking beyond the end of the buffer is succeeds. Seeking before the beginning of the buffer fails.
◆ SeekFromEnd()
bool ON_Buffer::SeekFromEnd |
( |
ON__INT64 |
offset | ) |
|
- Parameters
-
offset | [in] number of bytes to seek from the end fo the buffer. |
- Returns
- True if successful. False if the seek would result in a file position before the beginning of the file. If false is returned, the current position is not changed.
Seeking beyond the end of the buffer is succeeds. Seeking before the beginning of the buffer fails.
◆ SeekFromStart()
bool ON_Buffer::SeekFromStart |
( |
ON__INT64 |
offset | ) |
|
- Parameters
-
offset | [in] (>= 0) number of bytes to seek from the start of the buffer. |
- Returns
- True if successful. False if the seek would result in a file position before the beginning of the file. If false is returned, the current position is not changed.
Seeking beyond the end of the buffer is succeeds. Seeking before the beginning of the buffer fails.
◆ SetErrorHandler()
void ON_Buffer::SetErrorHandler |
( |
ON_Buffer_ErrorHandler |
error_handler | ) |
|
◆ Size()
ON__UINT64 ON_Buffer::Size |
( |
| ) |
const |
- Returns
- Number of bytes currently in the buffer.
It is possible to seek beyond the end of the buffer. In this case, the current position will be past the end of the buffer and CurrentPosition() will be greater than Size().
◆ Uncompress()
bool ON_Buffer::Uncompress |
( |
ON_Buffer & |
uncompressed_buffer | ) |
const |
Uncompress this buffer which must have been compressed using ON_Buffer::Compress().
- Parameters
-
uncompressed_buffer | [out] (The reference can be *this) |
- Returns
- True if successful. False if failed.
◆ Write()
ON__UINT64 ON_Buffer::Write |
( |
ON__UINT64 |
size, |
|
|
const void * |
buffer |
|
) |
| |
- Parameters
-
size | [in] number of bytes to write. |
buffer | [in] values to write. |
- Returns
- Number of bytes written buffer.
◆ WriteToBinaryArchive()