Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

boolean Class Reference
[Inserters]

#include <pantheios/inserters/boolean.hpp>

List of all members.


Detailed Description

Class for inserting Boolean types into Pantheios diagnostic logging statements.

Consider the following statement:

  char        s[] = "abc";
  std::string str("def");
  bool        b   = false;

  pantheios::log(pantheios::notice, "s=", s, ", b=", pantheios::boolean(b), ", str=", str);

This will produce the output:

    s=abc, b=false, str=def

Note:
The class provides the static method set_value_strings() for assigning user-defined strings to represent true and false values.
Examples:

cpp/inserters/example.cpp.inserter.b/example.cpp.inserter.b.cpp.


Construction

 boolean (bool value)
 Construct from a pointer, with width/format specifier.

Public Types

Member Types
typedef boolean class_type

Public Member Functions

Accessors
pan_char_t const * data () const
 A possibly non-nul-terminated non-null pointer to the c-style string representation of the integer.
pan_char_t 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.

Static Public Member Functions

Control
static void set_value_strings (pan_char_t const *falseName, pan_char_t const *trueName)

Constructor & Destructor Documentation

boolean ( bool  value  )  [inline, explicit]

Construct from a pointer, with width/format specifier.

Parameters:
value The boolean whose value will be represented as a string


Member Function Documentation

pan_char_t const* data (  )  const [inline]

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

pan_char_t const* c_str (  )  const [inline]

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

size_t length (  )  const [inline]

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 & Synesis Software, 2006-2011 SourceForge.net Logo