-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrint.h
56 lines (46 loc) · 1.28 KB
/
Print.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* \file Print.h
* \brief std::ostream printers
*/
#pragma once
//-------------------------------------------------------------------------------------------------
namespace stdstream
{
class Print final
/// Printer for std::ostream
{
public:
///\name ctors, dtor
///\{
Print(const std::string &contName, const std::string &delimiter, std::ostream &os);
~Print() = default;
Print() = delete;
Print(const Print &) = delete;
Print(Print &&) = delete;
Print & operator = (const Print &) = delete;
Print & operator = (Print &&) = delete;
///\}
template<typename IteratorT>
void range(IteratorT first, IteratorT last);
///< container's range
template<typename ContT>
void container(const ContT &cont);
///< all container
template<typename T1, typename T2>
void container(const std::pair<T1, T2> &cont);
///< std::pair
public: // static
template<typename T>
static std::string typeNameDemangle(const T &cont);
///< demangled type name
private:
const std::string _contName;
const std::string _delimiter;
std::ostream &_os;
template<typename IteratorT>
void _title(IteratorT first, IteratorT last);
///< contatiner title (name)
};
} // ns stdstream
//-------------------------------------------------------------------------------------------------
#include "Print.inl"