fipa_acl  1.4
Public Member Functions | Public Attributes | List of all members
fipa::acl::ByteSequence Class Reference

Representation of a byte sequence. We also embed information about the encoding. More...

#include <byte_sequence.h>

Public Member Functions

std::string toPrettyString () const
 
std::string toRawDataString () const
 
void toRawDataString (std::string *output) const
 

Public Attributes

std::string encoding
 
fipa::acl::LengthValue length
 
fipa::acl::ByteString bytes
 

Detailed Description

Representation of a byte sequence. We also embed information about the encoding.

whereas the encoding is defined by a natural number, i.e. postprocessing has to be performed to convert it to string

Definition at line 130 of file byte_sequence.h.

Member Function Documentation

std::string fipa::acl::ByteSequence::toPrettyString ( ) const
inline

Convert a bytesequence to a string representation This will be a defined format: see ByteStringPrinter for that

Returns
A string containing the byte sequence

Definition at line 141 of file byte_sequence.h.

142  {
143  std::string tmp;
144  // Since bytes is a variant we apply the visitor pattern here
145  tmp += boost::apply_visitor( ByteStringPrinter(encoding), bytes);
146  return tmp;
147  }
fipa::acl::ByteString bytes
std::string fipa::acl::ByteSequence::toRawDataString ( ) const
inline

Definition at line 149 of file byte_sequence.h.

150  {
151  std::string tmp;
152  // Since bytes is a variant we apply the visitor pattern here
153  tmp += boost::apply_visitor( ByteStringRawPrinter(), bytes);
154  return tmp;
155  }
fipa::acl::ByteString bytes
void fipa::acl::ByteSequence::toRawDataString ( std::string *  output) const
inline

Allow to assign output directly using a pointer to the receiver string to avoid copying of large contents

Definition at line 163 of file byte_sequence.h.

164  {
165  // Since bytes is a variant we apply the visitor pattern here
166  boost::apply_visitor( ByteStringRawPrinter(output), bytes);
167  }
fipa::acl::ByteString bytes

Member Data Documentation

fipa::acl::ByteString fipa::acl::ByteSequence::bytes

Definition at line 134 of file byte_sequence.h.

std::string fipa::acl::ByteSequence::encoding

Definition at line 132 of file byte_sequence.h.

fipa::acl::LengthValue fipa::acl::ByteSequence::length

Definition at line 133 of file byte_sequence.h.


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