#include <Util.h>
Static Public Methods | |
| char * | getData (const std::string &str) |
| Get a newly allocated character array that contains a copy of the contents of str with a null at the end. | |
| std::string | substitute (const std::string &str, Map< std::string, std::string > &variables) |
| Use the provided map of variable name - value pairs to replace all shell-syntax variables in str. | |
| int | parseInt (const std::string &str) |
| Get an integer out of a string. | |
| double | parseDouble (const std::string &str) |
| Get a double out of a string. | |
| std::string | parseName (const char *name) |
| Parse a class name as returned by type_info::name() to a readable format. | |
| template<class T> std::string | getClassName (const T &obj) |
| A handy template for getting the class name for an object. | |
| std::string | stripTemplateParameters (const std::string &className) |
| Strip template paremeters from a class name. | |
| template<class T> void | writeItem (std::ostream &sout, const T &item) throw (io::IOException&) |
| Write any type to a stream. | |
| template<class T> void | readItem (std::istream &sin, T &item) throw (io::IOException&) |
| Read an object written by writeItem. | |
| template<class T> void | writeXMLItem (std::ostream &sout, const T &item) throw (io::IOException&,xml::XMLException&) |
| Write any type to a stream as XML. | |
| template<class T> void | readXMLItem (std::istream &sin, T &item) throw (io::IOException&,xml::XMLException&) |
| Read an object written by writeXMLItem. | |
| template<class T> T * | copyArray (const T *from, T *to, int len) |
| Efficiently copy an array to another. | |
|
||||||||||||||||||||
|
Efficiently copy an array to another. This method uses direct memory transfers where possible. |
|
||||||||||
|
A handy template for getting the class name for an object.
|
|
|
Get a newly allocated character array that contains a copy of the contents of str with a null at the end.
|
|
|
Get a double out of a string.
|
|
|
Get an integer out of a string.
|
|
|
Parse a class name as returned by type_info::name() to a readable format. A typical return from type_info::name() is of the form "Q24test7MyClass", which converts to a more readable "test::MyClass".
|
|
|
Strip template paremeters from a class name. If the formatted name of a class is, say, mynamespace::Test<int>, the returned string says "mynamespace::Test". |
|
||||||||||||
|
Use the provided map of variable name - value pairs to replace all shell-syntax variables in str.
|
|
||||||||||||||||
|
Write any type to a stream. An object (or elementary type) written to a stream using this method should be possible to read unambiguously using the readItem method. The write/readItem pair is needed because some types (like strings) cannot be read from a stream once they have been written.
|
|
||||||||||||||||
|
Write any type to a stream as XML. An object (or elementary type) written to a stream using this method should be possible to read unambiguously using the readXMLItem method. The write/readItem pair is needed because some types (like strings) cannot be read from a stream once they have been written.
|