HIPO4 C++ Library
4.4.1
Columnar I/O library for CLAS12 physics data
Loading...
Searching...
No Matches
text.h
Go to the documentation of this file.
1
#ifndef INCLUDE_ASCII_TEXT_H_
2
#define INCLUDE_ASCII_TEXT_H_
3
#include "
style.h
"
4
5
namespace
ascii
{
6
class
Text
{
7
public
:
8
Text
() {}
9
Text
(std::string
text
) : text_(
text
) {}
10
Text
(std::string
text
,
Style
style
) : text_(
text
), style_(
style
) {}
11
12
Text
&
style
(
Style
style
) {
13
style_ =
style
;
14
return
*
this
;
15
}
16
17
Text
&
text
(std::string
text
) {
18
text_ =
text
;
19
return
*
this
;
20
}
21
22
std::string
text
() {
return
text_; }
23
24
friend
std::ostream &
operator<<
(std::ostream &os,
const
Text
&val) {
25
os << val.style_ << val.text_ <<
Decoration::From
(
Decoration::RESET
);
26
return
os;
27
}
28
29
private
:
30
std::string text_;
31
Style
style_;
32
};
33
}
// namespace ascii
34
#endif
// !INCLUDE_ASCII_TEXT_H_
ascii::Decoration::From
static Decoration From(Attribute attr)
Definition
color.h:83
ascii::Decoration::RESET
@ RESET
Definition
color.h:62
ascii::Style
Definition
style.h:6
ascii::Text
Definition
text.h:6
ascii::Text::operator<<
friend std::ostream & operator<<(std::ostream &os, const Text &val)
Definition
text.h:24
ascii::Text::Text
Text(std::string text)
Definition
text.h:9
ascii::Text::Text
Text()
Definition
text.h:8
ascii::Text::style
Text & style(Style style)
Definition
text.h:12
ascii::Text::text
std::string text()
Definition
text.h:22
ascii::Text::Text
Text(std::string text, Style style)
Definition
text.h:10
ascii::Text::text
Text & text(std::string text)
Definition
text.h:17
ascii
for detailed info, refered to https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797.
Definition
ascii.h:17
style.h
hipo4
chart
text.h
Generated by
1.9.8