pantheios::b64 Class Reference
[Inserters]

#include <pantheios/inserters/b64.hpp>

List of all members.


Detailed Description

Class for inserting binary regions types into Panthieos logging statements.

This class formats a binary region into a string, thereby enabling it to be inserted into a logging statement. Consider the following statement:

  int         ar[2] = { 0x00112233, 0x44556677 };
  char        s[]   = "abc";
  std::string str("def");

  pantheios::log(pantheios::notice, "s=", s, ", b64=", pantheios::b64(ar, sizeof(ar)), ", str=", str);

This will produce the output:

   s=abc, b64=0011223344556677, str=def

The bytes can be grouped and these groups separated. Consider the following statement:

  int         ar[2] = { 0x00112233, 0x44556677 };
  char        s[]   = "abc";
  std::string str("def");

  pantheios::log(pantheios::notice, "s=", s, ", b64=", pantheios::b64(ar, sizeof(ar), 2, "-"), ", str=", str);

This will produce the output:

   s=abc, b64=2233-0011-6677-4455, str=def

The output can be split into lines. Consider the following statement:

  int         ar[2] = { 0x00112233, 0x44556677 };
  char        s[]   = "abc";
  std::string str("def");

  pantheios::log(pantheios::notice, "s=", s, ", b64=", pantheios::b64(ar, sizeof(ar), 2, "-", 3, "\n\t"), ", str=", str);

This will produce the output:

  s=abc, b64=2233-0011-6677
          4455, str=def
Examples:

cpp/example_cpp_b64/example_cpp_b64.cpp.


Public Types

Member Types
typedef b64 class_type
typedef b64_api::B64_RC B64_RC

Public Member Functions

Construction
 b64 (void const *pv, size_t cb)
 b64 (void const *pv, size_t cb, unsigned flags)
 b64 (void const *pv, size_t cb, unsigned flags, int lineLen, B64_RC *rc=NULL)
 ~b64 () stlsoft_throw_0()
Accessors
char const * data () const
 A possibly non-nul-terminated non-null pointer to the c-style string representation of the integer.
char const * c_str () const
 A nul-terminated non-null pointer to the c-style string representation of the integer.
size_t length () const
 The length of the c-style string representation of the integer.


Member Typedef Documentation

typedef b64_api::B64_RC pantheios::b64::B64_RC
 

typedef b64 pantheios::b64::class_type
 


Constructor & Destructor Documentation

pantheios::b64::b64 void const *  pv,
size_t  cb
 

pantheios::b64::b64 void const *  pv,
size_t  cb,
unsigned  flags
 

pantheios::b64::b64 void const *  pv,
size_t  cb,
unsigned  flags,
int  lineLen,
B64_RC rc = NULL
 

pantheios::b64::~b64  ) 
 


Member Function Documentation

char const* pantheios::b64::c_str  )  const
 

A nul-terminated non-null pointer to the c-style string representation of the integer.

char const* pantheios::b64::data  )  const
 

A possibly non-nul-terminated non-null pointer to the c-style string representation of the integer.

size_t pantheios::b64::length  )  const
 

The length of the c-style string representation of the integer.


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

pantheios Library documentation © Matthew Wilson, 2006 SourceForge.net Logo