|
IGSTK
|
BinaryData representing a binary data chunk. More...
#include <igstkBinaryData.h>
Public Types | |
| typedef std::vector< unsigned char > | ContainerType |
| Data container type definition. | |
Public Member Functions | |
| BinaryData () | |
| Constructor. | |
| BinaryData (const char *encodedString) | |
| Constructor that copies data from an encoded string. | |
| BinaryData (const std::string &encodedString) | |
| Constructor that copies data from an encoded string. | |
| virtual | ~BinaryData () |
| Destructor. | |
| void | SetSize (unsigned int size) |
| SetSize method resizes/allocates memory. | |
| unsigned int | GetSize () const |
| GetSize method returns the size of data. | |
| const ContainerType & | GetData () const |
| Get a data container (returns constant) | |
| ContainerType & | GetData () |
| Get a data container. | |
| void | CopyFrom (unsigned char *inputBegin, unsigned int inputLength) |
| Copy data from an array. | |
| void | CopyTo (unsigned char *output) const |
| Copy data into an array. | |
| void | Append (unsigned char byte) |
| Append a byte. | |
| void | Append (const unsigned char *inputBegin, unsigned int inputLength) |
| Append data from an array. | |
| const BinaryData & | operator= (const BinaryData &inputBinaryData) |
| Assign the values of one BinaryData to another. | |
| bool | operator== (const BinaryData &inputBinaryData) const |
| operator== redefinition | |
| bool | operator!= (const BinaryData &inputBinaryData) const |
| operator!= redefinition | |
| bool | operator< (const BinaryData &inputBinaryData) const |
| operator< redefinition | |
| unsigned char | operator[] (const unsigned int index) const |
| operator[] redefinition | |
| unsigned char & | operator[] (const unsigned int index) |
| operator[] redefinition (returns reference) | |
| operator std::string () const | |
| operator that converts BinaryData to std::string type after encoding as ASCII | |
| void | Print (std::ostream &os, itk::Indent indent) const |
| Method for printing the member variables of this class to an ostream. | |
| bool | Decode (const std::string &asciiString) |
| Decode method decodes encoded ASCII string to binary data. | |
Static Public Member Functions | |
| static void | Encode (std::string &output, const unsigned char *data, unsigned int size) |
| Encode method encodes binary data to ASCII string in std::string. | |
Protected Member Functions | |
| void | PrintHeader (std::ostream &os, itk::Indent indent) const |
| Method for printing the header to an ostream. | |
| void | PrintTrailer (std::ostream &itkNotUsed(os), itk::Indent itkNotUsed(indent)) const |
| Method for printing the trailer to an ostream. | |
| virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const |
| Print the object information in a stream. | |
BinaryData representing a binary data chunk.
This class represents a binary data chunk.
This class can be used for storing binary stream during communication.
Definition at line 38 of file igstkBinaryData.h.
| typedef std::vector<unsigned char> igstk::BinaryData::ContainerType |
Data container type definition.
Definition at line 43 of file igstkBinaryData.h.
| igstk::BinaryData::BinaryData | ( | ) |
Constructor.
| igstk::BinaryData::BinaryData | ( | const char * | encodedString | ) |
Constructor that copies data from an encoded string.
| igstk::BinaryData::BinaryData | ( | const std::string & | encodedString | ) |
Constructor that copies data from an encoded string.
| virtual igstk::BinaryData::~BinaryData | ( | ) | [virtual] |
Destructor.
| void igstk::BinaryData::SetSize | ( | unsigned int | size | ) |
SetSize method resizes/allocates memory.
| unsigned int igstk::BinaryData::GetSize | ( | ) | const |
GetSize method returns the size of data.
| const ContainerType& igstk::BinaryData::GetData | ( | ) | const [inline] |
Get a data container (returns constant)
Definition at line 66 of file igstkBinaryData.h.
| ContainerType& igstk::BinaryData::GetData | ( | ) | [inline] |
Get a data container.
Definition at line 69 of file igstkBinaryData.h.
| void igstk::BinaryData::CopyFrom | ( | unsigned char * | inputBegin, |
| unsigned int | inputLength | ||
| ) |
Copy data from an array.
| void igstk::BinaryData::CopyTo | ( | unsigned char * | output | ) | const |
Copy data into an array.
| void igstk::BinaryData::Append | ( | unsigned char | byte | ) |
Append a byte.
| void igstk::BinaryData::Append | ( | const unsigned char * | inputBegin, |
| unsigned int | inputLength | ||
| ) |
Append data from an array.
| const BinaryData& igstk::BinaryData::operator= | ( | const BinaryData & | inputBinaryData | ) |
Assign the values of one BinaryData to another.
| bool igstk::BinaryData::operator== | ( | const BinaryData & | inputBinaryData | ) | const |
operator== redefinition
| bool igstk::BinaryData::operator!= | ( | const BinaryData & | inputBinaryData | ) | const |
operator!= redefinition
| bool igstk::BinaryData::operator< | ( | const BinaryData & | inputBinaryData | ) | const |
operator< redefinition
| unsigned char igstk::BinaryData::operator[] | ( | const unsigned int | index | ) | const |
operator[] redefinition
| unsigned char& igstk::BinaryData::operator[] | ( | const unsigned int | index | ) |
operator[] redefinition (returns reference)
| igstk::BinaryData::operator std::string | ( | ) | const |
operator that converts BinaryData to std::string type after encoding as ASCII
| void igstk::BinaryData::Print | ( | std::ostream & | os, |
| itk::Indent | indent | ||
| ) | const |
Method for printing the member variables of this class to an ostream.
| static void igstk::BinaryData::Encode | ( | std::string & | output, |
| const unsigned char * | data, | ||
| unsigned int | size | ||
| ) | [static] |
Encode method encodes binary data to ASCII string in std::string.
| bool igstk::BinaryData::Decode | ( | const std::string & | asciiString | ) |
Decode method decodes encoded ASCII string to binary data.
| void igstk::BinaryData::PrintHeader | ( | std::ostream & | os, |
| itk::Indent | indent | ||
| ) | const [protected] |
Method for printing the header to an ostream.
| void igstk::BinaryData::PrintTrailer | ( | std::ostream & | itkNotUsedos, |
| itk::Indent | itkNotUsedindent | ||
| ) | const [protected] |
Method for printing the trailer to an ostream.
| virtual void igstk::BinaryData::PrintSelf | ( | std::ostream & | os, |
| itk::Indent | indent | ||
| ) | const [protected, virtual] |
Print the object information in a stream.
1.7.4