OpenTREP Logo  0.07.4
C++ Open Travel Request Parsing Library
OutputFormat.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_OUTPUTFORMAT_HPP
2 #define __OPENTREP_OUTPUTFORMAT_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 // OpenTrep
11 
12 namespace OPENTREP {
13 
17  struct OutputFormat {
18  public:
19  typedef enum {
20  SHORT = 0,
26 
30  static const std::string& getLabel (const EN_OutputFormat&);
31 
36  static EN_OutputFormat getFormat (const char);
37 
41  static char getFormatLabel (const EN_OutputFormat&);
42 
46  static std::string getFormatLabelAsString (const EN_OutputFormat&);
47 
51  static std::string describeLabels();
52 
56  EN_OutputFormat getFormat() const;
57 
61  char getFormatAsChar() const;
62 
66  std::string getFormatAsString() const;
67 
72  const std::string describe() const;
73 
74  public:
78  bool operator== (const EN_OutputFormat&) const;
79 
80  public:
88  OutputFormat (const char iFormat);
92  OutputFormat (const std::string& iFormat);
96  OutputFormat (const OutputFormat&);
97 
98  private:
102  OutputFormat();
103 
104 
105  private:
109  static const std::string _labels[LAST_VALUE];
113  static const char _formatLabels[LAST_VALUE];
114 
115  private:
116  // //////// Attributes /////////
120  EN_OutputFormat _format;
121  };
122 
123 }
124 #endif // __OPENTREP_OUTPUTFORMAT_HPP
OPENTREP::OutputFormat::getFormatAsChar
char getFormatAsChar() const
Definition: OutputFormat.cpp:114
OPENTREP::OutputFormat::getFormatLabel
static char getFormatLabel(const EN_OutputFormat &)
Definition: OutputFormat.cpp:83
OPENTREP::OutputFormat::getFormatLabelAsString
static std::string getFormatLabelAsString(const EN_OutputFormat &)
Definition: OutputFormat.cpp:89
OPENTREP::OutputFormat::getFormatAsString
std::string getFormatAsString() const
Definition: OutputFormat.cpp:120
OPENTREP::OutputFormat::FULL
Definition: OutputFormat.hpp:21
OPENTREP::OutputFormat::describeLabels
static std::string describeLabels()
Definition: OutputFormat.cpp:96
OPENTREP
Definition: BasChronometer.cpp:10
OPENTREP::OutputFormat
Enumeration of output formats.
Definition: OutputFormat.hpp:17
OPENTREP::OutputFormat::SHORT
Definition: OutputFormat.hpp:20
OPENTREP::OutputFormat::PROTOBUF
Definition: OutputFormat.hpp:23
OPENTREP::OutputFormat::getLabel
static const std::string & getLabel(const EN_OutputFormat &)
Definition: OutputFormat.cpp:77
OPENTREP::OutputFormat::describe
const std::string describe() const
Definition: OutputFormat.cpp:127
OPENTREP::OutputFormat::operator==
bool operator==(const EN_OutputFormat &) const
Definition: OutputFormat.cpp:135
OPENTREP::OutputFormat::getFormat
EN_OutputFormat getFormat() const
Definition: OutputFormat.cpp:109
OPENTREP::OutputFormat::LAST_VALUE
Definition: OutputFormat.hpp:24
OPENTREP_Types.hpp
OPENTREP::OutputFormat::EN_OutputFormat
EN_OutputFormat
Definition: OutputFormat.hpp:19
OPENTREP::OutputFormat::JSON
Definition: OutputFormat.hpp:22