58 template <
class ITERATOR>
71 inline std::ostream&
toStream(
const std::string& obj, std::ostream& s ) {
return s << std::quoted( obj,
'\'' ); }
76 inline std::ostream&
toStream(
const bool obj, std::ostream& s ) {
return s << ( obj ?
"True" :
"False" ); }
81 inline std::ostream&
toStream(
const float obj, std::ostream& s ) {
return s << std::format(
"{}", obj ); }
86 inline std::ostream&
toStream(
const double obj, std::ostream& s ) {
return s << std::format(
"{}", obj ); }
91 inline std::ostream&
toStream(
const long double obj, std::ostream& s ) {
return s << std::format(
"{}", obj ); }
99 template <
class KTYPE,
class VTYPE>
104 template <
typename... Args>
113 template <
class TYPE,
class ALLOCATOR>
123 return ostream_joiner(
124 s <<
"[ ", obj,
" , ",
125 []( std::ostream& os,
bool b ) -> std::ostream& {
return os << ( b ?
"True" :
"False" ); } )
134 template <
class TYPE,
class ALLOCATOR>
144 template <
class TYPE,
class CMP,
class ALLOCATOR>
151 template <
class TYPE,
class HASH,
class CMP,
class ALLOCATOR>
154 return obj.
empty() ? s <<
"set()" :
toStream( ordered.begin(), ordered.end(), s,
"{ ",
" }",
" , " );
163 template <
class KTYPE,
class VTYPE,
class CMP,
class ALLOCATOR>
166 return ostream_joiner( s <<
"{ ", obj,
" , ",
180 template <
class KTYPE,
class VTYPE,
class CMP,
class ALLOCATOR>
183 return ostream_joiner( s <<
"{ ", obj,
" , ",
197 template <
class KTYPE,
class VTYPE,
class MAP>
200 return ostream_joiner( s <<
"{ ", obj,
" , ",
214 template <
class KTYPE,
class VTYPE,
class HASH,
class MAP>
223 template <
class TYPE,
unsigned int N>
224 std::ostream&
toStream(
const TYPE ( &obj )[N], std::ostream& s ) {
225 if constexpr ( N == 1 ) {
226 return toStream( obj[0], s <<
"( " ) <<
" , )";
228 return toStream( obj, obj + N, s,
"( ",
" )",
" , " );
235 template <
class TYPE, std::
size_t N>
237 if constexpr ( N == 1 ) {
238 return toStream( obj[0], s <<
"( " ) <<
" , )";
247 template <
unsigned int N>
248 std::ostream&
toStream(
const char ( &obj )[N], std::ostream& s ) {
249 return toStream( std::string( obj, obj + N ), s );
255 inline std::ostream&
toStream(
const char* obj, std::ostream& s ) {
return toStream( std::string( obj ), s ); }
261 template <
class TYPE>
262 inline std::ostream&
toStream(
const TYPE& obj, std::ostream& s ) {
266 template <
class Tuple, std::
size_t N>
268 static std::ostream&
toStream(
const Tuple& t, std::ostream& s ) {
274 template <
class Tuple>
276 static std::ostream&
toStream(
const Tuple& t, std::ostream& s ) {
287 template <
typename... Args>
290 if constexpr ( std::tuple_size_v<
std::tuple<Args...>> == 1 ) {
306 template <
class ITERATOR>
310 const std::string& open,
311 const std::string& close,
312 const std::string& delim )
316 return ostream_joiner( s << open, first, last, delim,
317 []( std::ostream& os, ref_t i ) -> std::ostream& {
return toStream( i, os ); } )
328 template <
class TYPE>
330 std::ostringstream s;
334 s.flags( orig_flags );
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Provide serialization function (output only) for some common STL classes (vectors,...
basic_ostream< char > ostream
constexpr const __tuple_element_t< __i, tuple< _Elements... > > && get(const tuple< _Elements... > &&__t) noexcept
basic_string< char > string
static const fmtflags showpoint
const_iterator end() const noexcept
const_iterator begin() const noexcept
iterator end() const noexcept
iterator begin() const noexcept
constexpr const_iterator begin() const noexcept
constexpr const_iterator end() const noexcept
bool empty() const noexcept
iterator begin() noexcept
Common class providing an architecture-independent hash map.
Extension of the STL map.
A bit modified version of 'Loki::AssocVector' associative vector from Loki library by Andrei Alexandr...
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
AttribStringParser::Iterator begin(const AttribStringParser &parser)
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
AttribStringParser::Iterator end(const AttribStringParser &)
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
static std::ostream & toStream(const Tuple &t, std::ostream &s)
static std::ostream & toStream(const Tuple &t, std::ostream &s)