Geant4
v4-10.4-release
메인 페이지
관련된 페이지
모듈
네임스페이스
클래스
파일들
파일 목록
파일 멤버
모두
클래스
네임스페이스들
파일들
함수
변수
타입정의
열거형 타입
열거형 멤버
Friends
매크로
그룹들
페이지들
source
visualization
HepRep
src
IndentPrintWriter.cc
이 파일의 문서화 페이지로 가기
1
// Copyright FreeHEP, 2005.
2
3
#include <fstream>
4
5
#include "
cheprep/IndentPrintWriter.h
"
6
7
using namespace
std;
8
13
namespace
cheprep {
14
15
IndentPrintWriter::IndentPrintWriter(ostream* outstream,
int
level)
16
: out(outstream),
17
closed(false),
18
indentLevel(level),
19
indented(false),
20
indentString(
" "
) {
21
}
22
23
IndentPrintWriter::~IndentPrintWriter
() {
24
}
25
26
void
IndentPrintWriter::close
() {
27
if
(!
closed
) {
28
out
->flush();
29
closed
=
true
;
30
}
31
}
32
33
IndentPrintWriter
&
IndentPrintWriter::operator<<
(
const
std::string &
s
) {
34
if
(!
indented
)
doIndent
();
35
*
out
<<
s
;
36
return
*
this
;
37
}
38
39
IndentPrintWriter
&
IndentPrintWriter::operator<<
(ostream& (*)(ostream&)) {
40
*
out
<< endl;
41
indented
=
false
;
42
return
*
this
;
43
}
44
45
void
IndentPrintWriter::println
(
const
string
&
s
) {
46
*
this
<< s << endl;
47
}
48
49
void
IndentPrintWriter::print
(
const
string
&
s
) {
50
*
this
<<
s
;
51
}
52
53
void
IndentPrintWriter::println
() {
54
*
out
<< endl;
55
indented
=
false
;
56
}
57
58
void
IndentPrintWriter::doIndent
() {
59
for
(
int
i=0; i<
indentLevel
; i++) {
60
*
out
<<
indentString
;
61
}
62
indented
=
true
;
63
}
64
65
void
IndentPrintWriter::indent
() {
66
indentLevel
++;
67
}
68
69
void
IndentPrintWriter::outdent
() {
70
indentLevel
--;
71
}
72
73
int
IndentPrintWriter::getIndent
()
const
{
74
return
indentLevel
;
75
}
76
77
void
IndentPrintWriter::setIndent
(
const
int
level) {
78
indentLevel
= level;
79
}
80
81
string
IndentPrintWriter::getIndentString
()
const
{
82
return
indentString
;
83
}
84
85
void
IndentPrintWriter::setIndentString
(
const
string
& anIndent) {
86
indentString
= anIndent;
87
}
88
89
}
// cheprep
cheprep::IndentPrintWriter::println
void println()
Definition:
IndentPrintWriter.cc:53
cheprep::IndentPrintWriter::close
void close()
Definition:
IndentPrintWriter.cc:26
cheprep::IndentPrintWriter
Definition:
IndentPrintWriter.h:22
cheprep::IndentPrintWriter::closed
bool closed
Definition:
IndentPrintWriter.h:45
cheprep::IndentPrintWriter::indent
void indent()
Definition:
IndentPrintWriter.cc:65
cheprep::IndentPrintWriter::~IndentPrintWriter
virtual ~IndentPrintWriter()
Definition:
IndentPrintWriter.cc:23
cheprep::IndentPrintWriter::print
void print(const std::string &s)
Definition:
IndentPrintWriter.cc:49
s
const XML_Char * s
Definition:
expat.h:262
IndentPrintWriter.h
cheprep::IndentPrintWriter::operator<<
IndentPrintWriter & operator<<(const std::string &s)
Definition:
IndentPrintWriter.cc:33
cheprep::IndentPrintWriter::indentString
std::string indentString
Definition:
IndentPrintWriter.h:48
cheprep::IndentPrintWriter::setIndent
void setIndent(const int level)
Definition:
IndentPrintWriter.cc:77
cheprep::IndentPrintWriter::setIndentString
void setIndentString(const std::string &indentString)
Definition:
IndentPrintWriter.cc:85
cheprep::IndentPrintWriter::doIndent
void doIndent()
Definition:
IndentPrintWriter.cc:58
cheprep::IndentPrintWriter::indented
bool indented
Definition:
IndentPrintWriter.h:47
cheprep::IndentPrintWriter::outdent
void outdent()
Definition:
IndentPrintWriter.cc:69
cheprep::IndentPrintWriter::indentLevel
int indentLevel
Definition:
IndentPrintWriter.h:46
cheprep::IndentPrintWriter::out
std::ostream * out
Definition:
IndentPrintWriter.h:44
cheprep::IndentPrintWriter::getIndent
int getIndent() const
Definition:
IndentPrintWriter.cc:73
cheprep::IndentPrintWriter::getIndentString
std::string getIndentString() const
Definition:
IndentPrintWriter.cc:81
다음에 의해 생성됨 :
1.8.5