Public Member Functions | Public Attributes | List of all members
Sprintlet< T, L > Class Template Reference

#include <Sprinter.h>

Inheritance diagram for Sprintlet< T, L >:
Inheritance graph
[legend]
Collaboration diagram for Sprintlet< T, L >:
Collaboration graph
[legend]

Public Member Functions

 Sprintlet (const T &x, const SprinterLayout &layout=L())
 
std::ostream & toStream (std::ostream &ostr) const
 
std::string str () const
 
- Public Member Functions inherited from Sprinter
template<>
std::ostream & toStream (std::ostream &ostr, const drain::Castable &v, const SprinterLayout &layout)
 Output implementation. More...
 
template<>
std::ostream & basicToStream (std::ostream &ostr, const bool &x, const TypeLayout &myChars)
 
template<>
std::ostream & toStream (std::ostream &ostr, const FlexibleVariable &v, const SprinterLayout &layout)
 
template<>
std::ostream & toStream (std::ostream &ostr, const drain::image::Palette &palette, const drain::SprinterLayout &layout)
 
template<>
std::ostream & toStream (std::ostream &ostr, const drain::image::PaletteEntry &entry, const drain::SprinterLayout &layout)
 
template<>
std::ostream & toStream (std::ostream &ostr, const Reference &v, const SprinterLayout &layout)
 
template<>
std::ostream & toStream (std::ostream &ostr, const JSONtree2 &tree, const drain::SprinterLayout &layout)
 
template<>
std::ostream & toStream (std::ostream &ostr, const VariableMap &vmap, const SprinterLayout &layout)
 
template<>
std::ostream & toStream (std::ostream &ostr, const FlexVariableMap &vmap, const SprinterLayout &layout)
 
template<>
std::ostream & toStream (std::ostream &ostr, const Variable &v, const SprinterLayout &layout)
 

Public Attributes

const T & src
 
SprinterLayout layout
 

Additional Inherited Members

- Static Public Member Functions inherited from Sprinter
static void prefixToStream (std::ostream &ostr, const TypeLayout &layout)
 Output Dictionary, which is a list.
 
static void separatorToStream (std::ostream &ostr, const TypeLayout &layout)
 
static void suffixToStream (std::ostream &ostr, const TypeLayout &layout)
 
template<class K , class V >
static std::ostream & pairToStream (std::ostream &ostr, const std::pair< K, V > &x, const SprinterLayout &layout)
 
template<class K , class V >
static std::ostream & mapPairToStream (std::ostream &ostr, const std::pair< K, V > &x, const SprinterLayout &layout)
 If (key,value) pairs needs specific layout in maps, use this. (Compare with list of tuples).
 
template<class T >
static std::ostream & sequenceToStream (std::ostream &ostr, const T &x, const SprinterLayout &layout)
 Convenience: if sequence type (array, list, set, map) not given, assume array.
 
template<class T >
static std::ostream & sequenceToStream (std::ostream &ostr, const T &x, const TypeLayout &myChars, const SprinterLayout &layout)
 Print sequence x with myChars, continue recursively with layout.
 
template<class M , class K >
static std::ostream & mapToStream (std::ostream &ostr, const M &m, const SprinterLayout &layout, const K &keys)
 Given a sequence or subsequence of keys, output values of a map in that order. More...
 
template<class T >
static std::ostream & treeToStream (std::ostream &ostr, const T &tree, const drain::SprinterLayout &layout, short indent=0)
 Write drain::Tree's or any trees that have tree::data[] member.
 
template<class T >
static std::ostream & basicToStream (std::ostream &ostr, const T &x, const TypeLayout &myChars)
 Routine for non-sequence types that may like prefix and suffix, anyway.
 
template<class T >
static std::ostream & toStream (std::ostream &ostr, const std::initializer_list< T > &x, const SprinterLayout &layout=defaultLayout)
 New (experimental)
 
template<class K , class V >
static std::ostream & toStream (std::ostream &ostr, const std::pair< K, V > &x, const SprinterLayout &layout=defaultLayout)
 
template<class D >
static std::ostream & toStream (std::ostream &ostr, const std::vector< D > &x, const SprinterLayout &layout=defaultLayout)
 
template<class D >
static std::ostream & toStream (std::ostream &ostr, const std::list< D > &x, const SprinterLayout &layout=defaultLayout)
 
template<class D >
static std::ostream & toStream (std::ostream &ostr, const std::set< D > &x, const SprinterLayout &layout=defaultLayout)
 
template<class K , class V >
static std::ostream & toStream (std::ostream &ostr, const std::map< K, V > &x, const SprinterLayout &layout=UNSET_LAYOUT)
 
template<class D , size_t N>
static std::ostream & toStream (std::ostream &ostr, const drain::UniTuple< D, N > &x, const SprinterLayout &layout=defaultLayout)
 
static std::ostream & toStream (std::ostream &ostr, const std::string &x, const SprinterLayout &layout=defaultLayout)
 Conventional type: std::string. Notice prefix revealed.
 
static std::ostream & toStream (std::ostream &ostr, const char *x, const SprinterLayout &layout=defaultLayout)
 Conventional type: C string.
 
static std::ostream & toStream (std::ostream &ostr, char c, const SprinterLayout &layout=defaultLayout)
 Single char gets styled same way as strings.
 
static std::ostream & toStream (std::ostream &ostr, bool b, const SprinterLayout &layout=defaultLayout)
 Single char gets styled same way as strings.
 
template<class D >
static std::ostream & toStream (std::ostream &ostr, D *x, const SprinterLayout &layout=defaultLayout)
 Pointer: redirect to actual target object.
 
template<class D >
static std::ostream & toStream (std::ostream &ostr, const D *x, const SprinterLayout &layout=defaultLayout)
 Pointer: redirect to actual target object.
 
template<class D >
static std::ostream & toStream (std::ostream &ostr, const D &x, const SprinterLayout &layout=defaultLayout)
 Default, unformatted output for basetypes and types not matching the other templates.
 
template<>
std::ostream & toStream (std::ostream &ostr, const drain::image::ImageFrame &src, const SprinterLayout &layout)
 
- Static Public Attributes inherited from Sprinter
static const SprinterLayout UNSET_LAYOUT = {"","","",""}
 Marker for unset layout.
 
static const SprinterLayout defaultLayout = {"[,]", "{,}", "(,)", ""}
 Displays objects with {...}, arrays with [...], pairs with (,) and strings without hyphens.
 
static const SprinterLayout emptyLayout = {"","","",""}
 Simply concatenate values without punctuation.
 
static const SprinterLayout plainLayout = {",", ",", ",", ""}
 Display plain values, concatenating them with comma (except for strings).
 
static const SprinterLayout lineLayout = {",", "\n", "=", ""}
 Put each array and object element on a separate line.
 
static const SprinterLayout jsonLayout
 Resembles JSON structure: {"a":1,"b":22,"c":3}. More...
 
static const SprinterLayout jsLayout
 JavaScript layout. Like JSON layout, but keys without hyphens. More...
 
static const SprinterLayout xmlAttributeLayout
 Like attributes in XML (HTML, SVG, ...) tags.
 
static const SprinterLayout cppLayout
 C++ code initializer list style: all objects with {...}, with comma ',' separator. More...
 
static const SprinterLayout pythonLayout
 C++ code initializer list style: all objects with {...}, with comma ',' separator. More...
 
static const SprinterLayout cmdLineLayout = {":", ",", "=", ""}
 Simulates how arguments are given to command line options.
 

Detailed Description

template<class T, class L = SprinterLayout>
class drain::Sprintlet< T, L >

Examples.

Template Parameters
T- basetype variable or object to be printed
L- default layout; allows creating typedefs with default layouts

Templated class, because references an external object of any type.


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