13 const std::string OutputFormat::_labels[
LAST_VALUE] =
14 {
"Short",
"Full",
"JSON",
"PROTOBUF" };
17 const char OutputFormat::_formatLabels[
LAST_VALUE] = {
'S',
'F',
'J',
'P' };
28 : _format (iOutputFormat._format) {
34 : _format (iOutputFormat) {
41 switch (iFormatChar) {
42 case 'S': oFormat =
SHORT;
break;
43 case 'F': oFormat =
FULL;
break;
44 case 'J': oFormat =
JSON;
break;
51 std::ostringstream oMessage;
52 oMessage <<
"The output format '" << iFormatChar
53 <<
"' is not known. Known output formats: " << lLabels;
67 OutputFormat (
const std::string& iFormatStr) {
70 const size_t lSize = iFormatStr.size();
73 const char lFormatChar = iFormatStr[0];
80 return _labels[iFormat];
86 return _formatLabels[iFormat];
92 std::ostringstream oStr;
93 oStr << _formatLabels[iFormat];
99 std::ostringstream ostr;
100 for (
unsigned short idx = 0; idx !=
LAST_VALUE; ++idx) {
104 ostr << _labels[idx];
117 const char oFormatChar = _formatLabels[_format];
123 std::ostringstream oStr;
124 oStr << _formatLabels[_format];
130 std::ostringstream ostr;
131 ostr << _labels[_format];
138 return (_format == iFormat);