pantheios::character Class Reference
[Inserters]

#include <pantheios/inserters/character.hpp>

List of all members.


Detailed Description

Class for inserting characters into Panthieos logging statements.

This class converts a character variable into a string, thereby enabling it to be inserted into a logging statement. Consider the following statement:

  double      c   = '#';
  char        s[] = "abc";
  std::string str("def");

  pantheios::log(pantheios::notice, "s=", s, ", c=", pantheios::character(c), ", str=", str);

This will produce the output:

    s=abc, c=#, str=def

Note:
Currently, Pantheios does not support the insertion of character types in logging statements, due to the various ambiguities inherent in the C++ language. (See chapters 14, 15, 19, 24 of Imperfect C++ for discussions of these issues.) It is possible that a future version of the library will be able to incorporate them directly, so long as that does not sacrifice Pantheios's central claim of not paying for what you don't use.
Examples:

cpp/example_cpp_character/example_cpp_character.cpp.


Public Types

typedef character class_type

Public Member Functions

 character (char value)
 Construct from a char value.
char const * data () const
 A possibly non-nul-terminated non-null pointer to the c-style string representation of the character.
char const * c_str () const
 A nul-terminated non-null pointer to the c-style string representation of the character.
size_t length () const
 The length of the c-style string representation of the character.


Member Typedef Documentation

typedef character pantheios::character::class_type
 


Constructor & Destructor Documentation

pantheios::character::character char  value  )  [inline, explicit]
 

Construct from a char value.


Member Function Documentation

char const * pantheios::character::c_str  )  const [inline]
 

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

char const * pantheios::character::data  )  const [inline]
 

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

size_t pantheios::character::length  )  const [inline]
 

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


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

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