Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IndentPrintWriter.h
Go to the documentation of this file.
1 // Copyright FreeHEP, 2005.
2 #ifndef CHEPREP_INDENTPRINTWRITER_H
3 #define CHEPREP_INDENTPRINTWRITER_H 1
4 
5 #include "cheprep/config.h"
6 
7 #include <iostream>
8 #include <string>
9 
20 namespace cheprep {
21 
23 
24  public:
25  IndentPrintWriter(std::ostream* out, int level = 0);
26  virtual ~IndentPrintWriter();
27 
28  void close();
29  IndentPrintWriter& operator<< (const std::string & s);
30  IndentPrintWriter& operator<< (std::ostream& (*pf)(std::ostream&));
31  void println(const std::string & s);
32  void print(const std::string & s);
33  void println();
34  void indent();
35  void outdent();
36  int getIndent() const;
37  void setIndent(const int level);
38  std::string getIndentString() const;
39  void setIndentString(const std::string & indentString);
40 
41  private:
42  void doIndent();
43 
44  std::ostream* out;
45  bool closed;
46  int indentLevel;
47  bool indented;
48  std::string indentString;
49 };
50 
51 } // cheprep
52 
53 
54 #endif
55 
std::string getIndentString() const
IndentPrintWriter(std::ostream *out, int level=0)
const XML_Char * s
Definition: expat.h:262
void setIndentString(const std::string &indentString)
void setIndent(const int level)
IndentPrintWriter & operator<<(const std::string &s)
void print(const std::string &s)