tlx
set.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * tlx/logger/set.hpp
3  *
4  * Part of tlx - http://panthema.net/tlx
5  *
6  * Copyright (C) 2018 Timo Bingmann <tb@panthema.net>
7  *
8  * All rights reserved. Published under the Boost Software License, Version 1.0
9  ******************************************************************************/
10 
11 #ifndef TLX_LOGGER_SET_HEADER
12 #define TLX_LOGGER_SET_HEADER
13 
14 #include <tlx/logger/core.hpp>
15 
16 #include <set>
17 
18 namespace tlx {
19 
20 template <typename T, typename C, typename A>
21 class LoggerFormatter<std::set<T, C, A> >
22 {
23 public:
24  static void print(std::ostream& os, const std::set<T, C, A>& data) {
25  os << '{';
26  for (typename std::set<T, C, A>::const_iterator it = data.begin();
27  it != data.end(); ++it)
28  {
29  if (it != data.begin()) os << ',';
31  }
32  os << '}';
33  }
34 };
35 
36 template <typename T, typename C, typename A>
37 class LoggerFormatter<std::multiset<T, C, A> >
38 {
39 public:
40  static void print(std::ostream& os, const std::multiset<T, C, A>& data) {
41  os << '{';
42  for (typename std::multiset<T, C, A>::const_iterator it = data.begin();
43  it != data.end(); ++it)
44  {
45  if (it != data.begin()) os << ',';
47  }
48  os << '}';
49  }
50 };
51 
52 } // namespace tlx
53 
54 #endif // !TLX_LOGGER_SET_HEADER
55 
56 /******************************************************************************/
tlx::LoggerFormatter< std::set< T, C, A > >::print
static void print(std::ostream &os, const std::set< T, C, A > &data)
Definition: set.hpp:40
set
set(LIBTLX_SOURCES algorithm/parallel_multiway_merge.cpp backtrace.cpp cmdline_parser.cpp die/core.cpp digest/md5.cpp digest/sha1.cpp digest/sha256.cpp digest/sha512.cpp logger/core.cpp multi_timer.cpp port/setenv.cpp string/appendline.cpp string/base64.cpp string/bitdump.cpp string/compare_icase.cpp string/contains.cpp string/contains_word.cpp string/ends_with.cpp string/equal_icase.cpp string/erase_all.cpp string/escape_html.cpp string/escape_uri.cpp string/expand_environment_variables.cpp string/extract_between.cpp string/format_si_iec_units.cpp string/hexdump.cpp string/index_of.cpp string/join.cpp string/join_quoted.cpp string/less_icase.cpp string/pad.cpp string/parse_si_iec_units.cpp string/replace.cpp string/split.cpp string/split_quoted.cpp string/split_words.cpp string/ssprintf.cpp string/starts_with.cpp string/to_lower.cpp string/to_upper.cpp string/trim.cpp string/union_words.cpp string/word_wrap.cpp thread_pool.cpp timestamp.cpp) set(TLX_EXPORTED_LIBS tlx) string(TOLOWER "tlx_$
Definition: CMakeLists.txt:11
tlx::LoggerFormatter
template class for formatting. contains a print() method.
Definition: core.hpp:35
tlx
Definition: exclusive_scan.hpp:17
core.hpp