Class used to generate data-bin segments and write them into a memory buffer.
More...
#include <databin_writer.h>
Class used to generate data-bin segments and write them into a memory buffer.
- See also
- DataBinServer
-
DataBinClass
-
EOR
| jpip::DataBinWriter::DataBinWriter |
( |
| ) |
|
|
inline |
| virtual jpip::DataBinWriter::~DataBinWriter |
( |
| ) |
|
|
inlinevirtual |
Clears the previous identifiers of data-bin class and codestream index numbers.
- Returns
- The object itself.
| int jpip::DataBinWriter::GetCount |
( |
| ) |
const |
|
inline |
Returns the number of bytes written.
| int jpip::DataBinWriter::GetFree |
( |
| ) |
const |
|
inline |
Returns the number of bytes available.
| jpip::DataBinWriter::operator bool |
( |
| ) |
const |
|
inline |
Returns the EOF status of the object.
| DataBinWriter& jpip::DataBinWriter::SetBuffer |
( |
char * |
buf, |
|
|
int |
buf_len |
|
) |
| |
|
inline |
Sets the associated memory buffer.
- Parameters
-
| buf | Memory buffer. |
| buf_len | Length of the memory buffer. |
- Returns
- The object itself.
Sets the current codestream.
- Parameters
-
| value | Index number of the codestream. |
- Returns
- The object itself.
| DataBinWriter& jpip::DataBinWriter::SetDataBinClass |
( |
int |
databin_class | ) |
|
|
inline |
Sets the current data-bin class.
- Parameters
-
| databin_class | Data-bin class. |
- Returns
- The object itself.
| DataBinWriter & jpip::DataBinWriter::Write |
( |
uint64_t |
bin_id, |
|
|
uint64_t |
bin_offset, |
|
|
const File & |
file, |
|
|
const FileSegment & |
segment, |
|
|
bool |
last_byte = false |
|
) |
| |
Writes a data-bin segment into the buffer.
- Parameters
-
| bin_id | Data-bin identifier. |
| bin_offset | Data-bin offset. |
| file | File from where to read the data. |
| segment | File segment of the data. |
| last_byte | true if the data contains the last byte of the data-bin. |
- Returns
- The object itself.
| DataBinWriter & jpip::DataBinWriter::WriteEmpty |
( |
uint64_t |
bin_id = 0 | ) |
|
Writes an empty segment.
- Parameters
-
| bin_id | Data-bin identifier. |
- Returns
- The object itself.
Writes a EOR message into the buffer.
- Parameters
-
| reason | Reason of the message. |
- Returns
- The object itself.
| DataBinWriter & jpip::DataBinWriter::WriteHeader |
( |
uint64_t |
bin_id, |
|
|
uint64_t |
bin_offset, |
|
|
uint64_t |
bin_length, |
|
|
bool |
last_byte = false |
|
) |
| |
|
private |
Writes a data-bin header into the buffer.
- Parameters
-
| bin_id | Data-bin identifier. |
| bin_offset | Data-bin offset. |
| bin_length | Data-bin length. |
| last_byte | true if the data related to this header contains the last byte of the data-bin. |
- Returns
- The object itself.
| DataBinWriter & jpip::DataBinWriter::WritePlaceHolder |
( |
uint64_t |
bin_id, |
|
|
uint64_t |
bin_offset, |
|
|
const File & |
file, |
|
|
const PlaceHolder & |
place_holder, |
|
|
bool |
last_byte = false |
|
) |
| |
Writes a place-holder segment into the buffer.
- Parameters
-
| bin_id | Data-bin identifier. |
| bin_offset | Data-bin offset. |
| file | File from where to read the data. |
| place_holder | Place-holder information. |
| last_byte | true if the data contains the last byte of the data-bin. |
- Returns
- The object itself.
Writes a value into the buffer.
- Parameters
-
- Returns
- The object itself.
Writes a new integer value into the buffer coded as VBAS.
- Parameters
-
- Returns
- The object itself.
| int jpip::DataBinWriter::codestream_idx |
|
private |
Current codestream index number.
| int jpip::DataBinWriter::databin_class |
|
private |
| char* jpip::DataBinWriter::end |
|
private |
Pointer to the end of the buffer.
| bool jpip::DataBinWriter::eof |
|
private |
true if the end of the buffer has been reached and the last value could not be written.
| char* jpip::DataBinWriter::ini |
|
private |
Pointer to the beginning of the buffer.
| int jpip::DataBinWriter::prev_codestream_idx |
|
private |
Previous codestream index number.
| int jpip::DataBinWriter::prev_databin_class |
|
private |
| char* jpip::DataBinWriter::ptr |
|
private |
Current position of the buffer.
The documentation for this class was generated from the following files: