ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IndentPrintWriter.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file IndentPrintWriter.h
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 
19 namespace cheprep {
20 
22 
23  public:
24  IndentPrintWriter(std::ostream* out, int level = 0);
25  virtual ~IndentPrintWriter();
26 
27  void close();
28  IndentPrintWriter& operator<< (const std::string & s);
29  IndentPrintWriter& operator<< (std::ostream& (*pf)(std::ostream&));
30  void println(const std::string & s);
31  void print(const std::string & s);
32  void println();
33  void indent();
34  void outdent();
35  int getIndent() const;
36  void setIndent(const int level);
37  std::string getIndentString() const;
38  void setIndentString(const std::string & indentString);
39 
40  private:
41  void doIndent();
42 
43  std::ostream* out;
44  bool closed;
46  bool indented;
47  std::string indentString;
48 };
49 
50 } // cheprep
51 
52 
53 #endif
54