Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Sprinter Class Reference
Inheritance diagram for Sprinter:
Inheritance graph
[legend]
Collaboration diagram for Sprinter:
Collaboration graph
[legend]

Public Member Functions

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)
 

Static Public Member Functions

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

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.
 

Member Function Documentation

◆ mapToStream()

static std::ostream& mapToStream ( std::ostream &  ostr,
const M &  m,
const SprinterLayout layout,
const K &  keys 
)
inlinestatic

Given a sequence or subsequence of keys, output values of a map in that order.

Template Parameters
M- map type
K- an iterable sequence of keys

Note: sequenceToStream is faster - recommended if all the entries are printed in native map order.

◆ toStream()

std::ostream & toStream ( std::ostream &  ostr,
const drain::Castable v,
const SprinterLayout layout 
)

Output implementation.

"Friend class" template implementation

Member Data Documentation

◆ cppLayout

const SprinterLayout cppLayout
static

C++ code initializer list style: all objects with {...}, with comma ',' separator.

arrays as {value, ...}

objects as {}

pairs as {key,value}

strings with double quotes: "..."

◆ jsLayout

const SprinterLayout jsLayout
static

JavaScript layout. Like JSON layout, but keys without hyphens.

Like JSON layout, but keys without hyphens.

◆ jsonLayout

const SprinterLayout jsonLayout
static

Resembles JSON structure: {"a":1,"b":22,"c":3}.

JSON layout uses std::pair<>(first,second) to display key:value pairs.

arrays as [value, ...]

objects as {...}

pairs as {key:value}

strings with double quotes: "..."

arrays as [...]

objects as {...}, starting from the arg

pairs as key:value

strings as "..."

◆ pythonLayout

const SprinterLayout pythonLayout
static

C++ code initializer list style: all objects with {...}, with comma ',' separator.

arrays with [value, ...]

objects with {}

pairs with (key,value), like tuples (of two elements)

strings with single quotes: '...'


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