Namespaces | |
namespace | Util |
namespace | String |
Classes | |
class | Any |
An Any object can hold any kind of value. More... | |
struct | basetype |
Retrieve the base component of a type. More... | |
struct | basetype< T & > |
Retrieve the base component of a type. More... | |
struct | basetype< const T & > |
Retrieve the base component of a type. More... | |
struct | basetype< const T > |
Retrieve the base component of a type. More... | |
struct | Convert |
struct | Convert< T, T > |
struct | Convert< std::string, std::string > |
struct | Convert< std::string, const char * > |
struct | Convert< Target, std::string > |
struct | Convert< std::string, Source > |
class | Date |
A simple Date class. More... | |
class | ostream_ptr |
The following functions support writing to a std::ostream* If the pointer is 0 (null), nothing is written. More... | |
class | Debugable |
An abstract class that provides debugging services. More... | |
class | DebugSlave |
A DebugSlave uses a link to another master Debugable to provide its log and bug services. More... | |
class | ObservableDebugSlave |
An ObservableDebugSlave keeps an eye on its collection of slaves. More... | |
class | Debug |
A Debug object is typically a master. More... | |
class | DebugObserver |
A Dv::DebugObserver is a Dv::DebugSlave that implements the link to its master through the observer-observable link. More... | |
struct | iomanip |
Convert typical member functions to iomanip objects that can be put on a stream using the conventional operator<<. More... | |
struct | iomanip_c |
As above, but makes a copy of the BT object. More... | |
struct | iomanip_m |
Convert typical member functions to iomanip objects that can be put on a stream using the conventional operator<<. More... | |
class | Observable |
Base class for all Observable classes. More... | |
class | Observer |
class | Duration |
Class representing a duration. More... | |
class | Period |
A Period is simply a Date with a Duration. More... | |
class | Props |
Storing elements in a Props object:. More... | |
class | shared_ptr |
A simple shared_ptr class. More... | |
class | StringMap |
A utility class wrapper around std::map<std::string,std::string>. More... | |
Typedefs | |
typedef std::pair< const char *, size_t > | Buffer |
Convenience type that allows to make iomanip objects from buffers. | |
typedef iomanip_c< Buffer > | BufferDump |
Iomanipulator type corresponding to buffers. | |
typedef StringMap< std::string > | StringStringMap |
Functions | |
template<typename T > | |
T | any_cast (const Any &any) |
Convert an Any object to its underlying value type. | |
template<typename Target , typename Source > | |
bool | convert (Target &target, const Source &source) |
template<typename Target , typename Source > | |
Target | convert (const Source &source, const Target &default_value) |
template<typename Source > | |
std::string | tostring (const Source &source, const std::string &default_value="") |
template<typename Target > | |
Target | fromstring (const std::string &source, const Target &default_value) |
template<typename Target > | |
Target | fromstring (const std::string &source) |
std::istream & | operator>> (std::istream &is, Date &date) |
Read a date from an input stream. | |
std::ostream & | operator<< (std::ostream &os, const Date &date) |
Write a date to an output stream. | |
std::ostream & | debug_write (std::ostream &os, const char *buf, size_t n) |
Write a character buffer to a stream using only printable characters. | |
std::ostream & | debug_write (std::ostream &os, const Buffer &buf) |
Write a character buffer to a stream using only printable characters. | |
BufferDump | debug_dump (const char *buf, size_t size) |
Create an iomanip from a buffer with a size. | |
template<typename T > | |
BufferDump | debug_dump_t (const T &t, size_t size=sizeof(T)) |
Create an iomanip from an arbitrary object and a size. | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const Dv::iomanip< T > &io) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const Dv::iomanip_c< T > &io) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const Dv::iomanip_m< T > &io) |
bool | operator== (const Duration &u1, const Duration &u2) |
Simply compares years, months, seconds separately. | |
Date | operator+ (const Date &date, const Duration &duration) |
Compute Date just after period of size u , starting at d . | |
Props & | env2props (Props &props) |
typedef std::pair<const char*, size_t> Dv::Buffer |
Convenience type that allows to make iomanip objects from buffers.
Definition at line 21 of file debug_dump.h.
typedef iomanip_c<Buffer> Dv::BufferDump |
Iomanipulator type corresponding to buffers.
Definition at line 35 of file debug_dump.h.
typedef StringMap<std::string> Dv::StringStringMap |
Definition at line 127 of file stringmap.h.
T Dv::any_cast | ( | const Any & | any | ) | [inline] |
bool Dv::convert | ( | Target & | target, | |
const Source & | source | |||
) | [inline] |
Definition at line 80 of file convert.h.
Referenced by convert(), fromstring(), and tostring().
Target Dv::convert | ( | const Source & | source, | |
const Target & | default_value | |||
) | [inline] |
std::string Dv::tostring | ( | const Source & | source, | |
const std::string & | default_value = "" | |||
) | [inline] |
Definition at line 96 of file convert.h.
References convert().
Referenced by Dv::Props::Reference::append(), Dv::Util::enum_parser< E >::enum2str(), Dv::Props::operator()(), Dv::Props::Reference::operator=(), Dv::Props::operator[](), Dv::StringMap< std::string >::print_summary(), and Dv::Duration::str().
Target Dv::fromstring | ( | const std::string & | source, | |
const Target & | default_value | |||
) | [inline] |
Target Dv::fromstring | ( | const std::string & | source | ) | [inline] |
std::istream& Dv::operator>> | ( | std::istream & | is, | |
Date & | date | |||
) |
Read a date from an input stream.
is | input stream | |
date | Dv::Util::Date object that will contain the read date |
std::ostream& Dv::operator<< | ( | std::ostream & | os, | |
const Date & | date | |||
) |
Write a date to an output stream.
The format used is "%F %T", i.e. YYY-MM-DD (ISO 8601), followed by HH:MM:SS.
os | output stream | |
date | to write |
std::ostream& Dv::debug_write | ( | std::ostream & | os, | |
const char * | buf, | |||
size_t | n | |||
) |
Write a character buffer to a stream using only printable characters.
Non-printable chars are represented by a string of the form \NNN where NNN is the decimal code of the char.
os | stream to print to | |
buf | pointer to first char to print | |
n | number of chars to print |
Referenced by debug_dump(), and debug_write().
std::ostream& Dv::debug_write | ( | std::ostream & | os, | |
const Buffer & | buf | |||
) | [inline] |
Write a character buffer to a stream using only printable characters.
Non-printable chars are represented by a string of the form \NNN where NNN is the decimal code of the char.
os | stream to print to | |
buf | pair of buffer pointer and size |
Definition at line 30 of file debug_dump.h.
References debug_write().
BufferDump Dv::debug_dump | ( | const char * | buf, | |
size_t | size | |||
) | [inline] |
Create an iomanip from a buffer with a size.
This supports code such as the following:
const char* buf; std::cout << "buf[1..20] = " << debug_dump(buf, 20) << std::endl;
buf | pointer to first char to print | |
size | number of chars to print |
Definition at line 47 of file debug_dump.h.
References debug_write().
Referenced by debug_dump_t(), and Dv::StringMap< std::string >::print_summary().
BufferDump Dv::debug_dump_t | ( | const T & | t, | |
size_t | size = sizeof(T) | |||
) | [inline] |
Create an iomanip from an arbitrary object and a size.
This supports code such as the following:
T object; std::cout << "dump of t: " << debug_dump(object) << std::endl;
t | object to dump | |
size | only the first size bytes will be dumped. |
Definition at line 62 of file debug_dump.h.
References debug_dump().
std::ostream& Dv::operator<< | ( | std::ostream & | os, | |
const Dv::iomanip< T > & | io | |||
) | [inline] |
std::ostream& Dv::operator<< | ( | std::ostream & | os, | |
const Dv::iomanip_c< T > & | io | |||
) | [inline] |
std::ostream& Dv::operator<< | ( | std::ostream & | os, | |
const Dv::iomanip_m< T > & | io | |||
) | [inline] |
bool Dv::operator== | ( | const Duration & | u1, | |
const Duration & | u2 | |||
) |
Simply compares years, months, seconds separately.
Date Dv::operator+ | ( | const Date & | date, | |
const Duration & | duration | |||
) |
Compute Date just after period of size u
, starting at d
.
Sometimes give strange (but probably unavoidably so) results: e.g.
2000-01-31 + 1 month = 2000-03-2.
date | to add to | |
duration | to add |
Props& Dv::env2props | ( | Props & | props | ) |
dvutil-1.0.10 | [ 5 December, 2009] |