DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
TraceWriterTerm.h
1
16
17
#pragma once
29
30
#if defined(TraceWriterTerm_RECURSES)
31
#error Recursive header files inclusion detected in TraceWriterTerm.h
32
#else
// defined(TraceWriterTerm_RECURSES)
34
#define TraceWriterTerm_RECURSES
35
36
#if !defined TraceWriterTerm_h
38
#define TraceWriterTerm_h
39
40
42
// Inclusions
43
#include <iostream>
44
#include <string>
45
#include "DGtal/base/TraceWriter.h"
46
#include "DGtal/base/Config.h"
48
49
namespace
DGtal
50
{
51
53
// class TraceWriterTerm
62
// ----------------------- Standard services ------------------------------
63
class
TraceWriterTerm
:
public
TraceWriter
64
{
65
public
:
66
72
TraceWriterTerm
(std::ostream &aoutputStream=std::cerr) :
TraceWriter
(aoutputStream) {};
73
74
78
~TraceWriterTerm
() {};
79
80
// ----------------------- Interface --------------------------------------
81
public
:
82
87
void
selfDisplay
( std::ostream & out )
const
;
88
93
bool
isValid
()
const
;
94
95
101
std::string
prefixWarning
()
102
{
103
#if ( !defined(DGTAL_DEV_NO_ESCAPED_CHAR_IN_TRACE) && (defined(UNIX)||defined(unix)||defined(linux)) )
104
return
"\033[0m\033[35m"
;
105
#else
106
return
""
;
107
#endif
108
}
109
114
std::string
prefixInfo
()
115
{
116
#if ( !defined(DGTAL_DEV_NO_ESCAPED_CHAR_IN_TRACE) && (defined(UNIX)||defined(unix)||defined(linux)) )
117
return
"\033[0m"
;
118
#else
119
return
""
;
120
#endif
121
}
122
127
std::string
prefixError
()
128
{
129
#if ( !defined(DGTAL_DEV_NO_ESCAPED_CHAR_IN_TRACE) && (defined(UNIX)||defined(unix)||defined(linux)) )
130
return
"\033[0m\033[31m[ERR]"
;
131
#else
132
return
""
;
133
#endif
134
}
135
140
std::string
prefixEmphase
()
141
{
142
#if ( !defined(DGTAL_DEV_NO_ESCAPED_CHAR_IN_TRACE) && (defined(UNIX)||defined(unix)||defined(linux)) )
143
return
"\033[0m\033[1m"
;
144
#else
145
return
""
;
146
#endif
147
}
148
153
std::string
postfixReset
()
154
{
155
#if ( !defined(DGTAL_DEV_NO_ESCAPED_CHAR_IN_TRACE) && (defined(UNIX)||defined(unix)||defined(linux)) )
156
return
"\033[0m"
;
157
#else
158
return
""
;
159
#endif
160
}
161
162
private
:
163
169
TraceWriterTerm
(
const
TraceWriterTerm
& other );
170
177
TraceWriterTerm
&
operator=
(
const
TraceWriterTerm
& other );
178
179
};
// end of class TraceWriterTerm
180
181
188
std::ostream&
189
operator<<
( std::ostream & out,
const
TraceWriterTerm
&
object
);
190
191
192
}
// namespace DGtal
193
194
195
// //
197
198
#endif
// !defined TraceWriterTerm_h
199
200
#undef TraceWriterTerm_RECURSES
201
#endif
// else defined(TraceWriterTerm_RECURSES)
DGtal::TraceWriterTerm
Implements trace prefix for color terminals.
Definition
TraceWriterTerm.h:64
DGtal::TraceWriterTerm::TraceWriterTerm
TraceWriterTerm(const TraceWriterTerm &other)
DGtal::TraceWriterTerm::postfixReset
std::string postfixReset()
Definition
TraceWriterTerm.h:153
DGtal::TraceWriterTerm::isValid
bool isValid() const
DGtal::TraceWriterTerm::operator=
TraceWriterTerm & operator=(const TraceWriterTerm &other)
DGtal::TraceWriterTerm::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::TraceWriterTerm::~TraceWriterTerm
~TraceWriterTerm()
Definition
TraceWriterTerm.h:78
DGtal::TraceWriterTerm::prefixError
std::string prefixError()
Definition
TraceWriterTerm.h:127
DGtal::TraceWriterTerm::prefixInfo
std::string prefixInfo()
Definition
TraceWriterTerm.h:114
DGtal::TraceWriterTerm::prefixWarning
std::string prefixWarning()
Definition
TraceWriterTerm.h:101
DGtal::TraceWriterTerm::TraceWriterTerm
TraceWriterTerm(std::ostream &aoutputStream=std::cerr)
Definition
TraceWriterTerm.h:72
DGtal::TraceWriterTerm::prefixEmphase
std::string prefixEmphase()
Definition
TraceWriterTerm.h:140
DGtal::TraceWriter::TraceWriter
TraceWriter(std::ostream &aoutputStream)
Definition
TraceWriter.h:103
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
src
DGtal
base
TraceWriterTerm.h
Generated on
for DGtal by
1.18.0