3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
coat::scripto::FormatBinary Class Reference

Class for working with binary data. More...

#include <SFormatBinary.h>

Public Member Functions

 FormatBinary ()
 Constructor for building an empty binary-object. More...
 
bool operator== (const FormatBinary &b) const
 Comparison. More...
 
bool empty () const
 Returns a TRUE when data is absent. More...
 
FormatBinaryoperator() (int i, raw_t::value_type v)
 Setter like array. More...
 
raw_t::value_type operator() (int i) const
 Getter like array. More...
 
int size () const
 Returns a filled count of bytes. More...
 
FormatBinaryappend (const raw_t::value_type &d)
 Appends a byte. More...
 
FormatBinaryoperator+= (const raw_t::value_type &d)
 
FormatBinaryprepend (const raw_t::value_type &d)
 Prepends a byte. More...
 
FormatBinaryclear ()
 Clears binary data. More...
 

Detailed Description

Class for working with binary data.

format-binary.jpg
// creating a header of Free Lossless Image Format (FLIF)
// http://flif.info
FormatBinary a = { 0x46, 0x4c, 0x49, 0x46 };
Since
4.5.32

Constructor & Destructor Documentation

coat::scripto::FormatBinary::FormatBinary ( )
inline

Constructor for building an empty binary-object.

Member Function Documentation

FormatBinary& coat::scripto::FormatBinary::append ( const raw_t::value_type &  d)
inline

Appends a byte.

// creating a header of Tagged Image File Format (TIFF)
// http://filesignatures.net/index.php?search=tiff&mode=EXT
a.append( 0x49 );
a += 0x20;
a += 0x49;

Referenced by operator+=().

FormatBinary& coat::scripto::FormatBinary::clear ( )
inline

Clears binary data.

FormatBinary a = { 0x00, 0x00 };
a.clear();
bool coat::scripto::FormatBinary::empty ( ) const
inline

Returns a TRUE when data is absent.

FormatBinary& coat::scripto::FormatBinary::operator() ( int  i,
raw_t::value_type  v 
)
inline

Setter like array.

// creating a header of Flexible Image Transport System (FITS)
// http://digitalpreservation.gov/formats/fdd/fdd000317.shtml#sign
FormatBinary a = { 0x53, 0x49, 0x00, 0x50, 0x4c, 0x45 };
// setting third byte to 0xff
a[ 2, 0x4d ];
raw_t::value_type coat::scripto::FormatBinary::operator() ( int  i) const
inline

Getter like array.

FormatBinary a = { 0x53, 0x49, 0x4d, 0x50, 0x4c, 0x45 };
uint8 first = a[ 0 ];
uint8 second = a[ 1 ];
uint8 last = a[ 5 ];
FormatBinary& coat::scripto::FormatBinary::operator+= ( const raw_t::value_type &  d)
inline

References append().

bool coat::scripto::FormatBinary::operator== ( const FormatBinary b) const
inline

Comparison.

...
if (a == b) { ... }
FormatBinary& coat::scripto::FormatBinary::prepend ( const raw_t::value_type &  d)
inline

Prepends a byte.

// creating a header of Portable Network Graphics (PNG)
// http://filesignatures.net/index.php?search=png&mode=EXT
FormatBinary a = { 0x47, 0x0d, 0x0a, 0x1a, 0x0a };
a.prepend( 0x4e ); // G
a.prepend( 0x50 ); // N
a.prepend( 0x89 ); // P
int coat::scripto::FormatBinary::size ( ) const
inline

Returns a filled count of bytes.

FormatBinary a = { 0x53, 0x49, 0x4d, 0x50, 0x4c, 0x45 };
string n = a.size();

The documentation for this class was generated from the following file: