Sirikata
Public Member Functions | Private Member Functions | Private Attributes
Sirikata::Transfer::DenseData Class Reference

Represents a single block of data, and also knows the range of the file it came from. More...

#include <TransferData.hpp>

Inheritance diagram for Sirikata::Transfer::DenseData:
Collaboration diagram for Sirikata::Transfer::DenseData:

List of all members.

Public Member Functions

 DenseData (const Range &range)
 DenseData (const std::string &str, Range::base_type start=0, bool wholeFile=true)
 DenseData (const Range &range, const char *str)
 DenseData (const Range &range, const std::vector< unsigned char > &data)
const unsigned char * data () const
 equals dataAt(startbyte()).
const unsigned char * begin () const
const unsigned char * end () const
unsigned char * writableData ()
 Returns a non-const data, starting at startbyte().
const unsigned char * dataAt (base_type offset) const
 Returns a char* to data at a cetain offset.
std::string asString () const
void setLength (size_t len, bool is_npos)
 Sets the length of the range, as well as allocates more space in the data vector.
void append (const char *data, size_t len, bool is_npos)
void append (const std::vector< unsigned char > &data, bool is_npos)
void append (const std::vector< unsigned char > &data, bool is_npos, std::vector< unsigned char >::const_iterator begin, std::vector< unsigned char >::const_iterator end)

Private Member Functions

 DenseData (const char *str, size_t len)
 DenseData (const unsigned char *str, size_t len)

Private Attributes

std::vector< unsigned char > mData

Detailed Description

Represents a single block of data, and also knows the range of the file it came from.


Constructor & Destructor Documentation

Sirikata::Transfer::DenseData::DenseData ( const char *  str,
size_t  len 
) [inline, private]
Sirikata::Transfer::DenseData::DenseData ( const unsigned char *  str,
size_t  len 
) [inline, private]
Sirikata::Transfer::DenseData::DenseData ( const Range range) [inline]
Sirikata::Transfer::DenseData::DenseData ( const std::string &  str,
Range::base_type  start = 0,
bool  wholeFile = true 
) [inline]

References setLength(), and writableData().

Sirikata::Transfer::DenseData::DenseData ( const Range range,
const char *  str 
) [inline]
Sirikata::Transfer::DenseData::DenseData ( const Range range,
const std::vector< unsigned char > &  data 
) [inline]

Member Function Documentation

void Sirikata::Transfer::DenseData::append ( const char *  data,
size_t  len,
bool  is_npos 
) [inline]
void Sirikata::Transfer::DenseData::append ( const std::vector< unsigned char > &  data,
bool  is_npos 
) [inline]

References append().

void Sirikata::Transfer::DenseData::append ( const std::vector< unsigned char > &  data,
bool  is_npos,
std::vector< unsigned char >::const_iterator  begin,
std::vector< unsigned char >::const_iterator  end 
) [inline]
std::string Sirikata::Transfer::DenseData::asString ( ) const [inline]
const unsigned char* Sirikata::Transfer::DenseData::begin ( ) const [inline]

References data().

Referenced by append().

const unsigned char* Sirikata::Transfer::DenseData::data ( ) const [inline]
const unsigned char* Sirikata::Transfer::DenseData::dataAt ( base_type  offset) const [inline]

Returns a char* to data at a cetain offset.

Does not return the corresponding Length, but it is your responsibility to compare to endbyte(). Note that it will also return NULL if startbyte() > offset.

References Sirikata::Transfer::Range::endbyte(), mData, and Sirikata::Transfer::Range::startbyte().

const unsigned char* Sirikata::Transfer::DenseData::end ( ) const [inline]

References data(), and Sirikata::Transfer::Range::length().

Referenced by append().

void Sirikata::Transfer::DenseData::setLength ( size_t  len,
bool  is_npos 
) [inline]

Sets the length of the range, as well as allocates more space in the data vector.

References mData.

Referenced by append(), and DenseData().

unsigned char* Sirikata::Transfer::DenseData::writableData ( ) [inline]

Returns a non-const data, starting at startbyte().

References mData.

Referenced by append(), Sirikata::Graphics::CDNArchive::CDNArchive(), and DenseData().


Member Data Documentation

std::vector<unsigned char> Sirikata::Transfer::DenseData::mData [private]

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