EMdFOutput

Overview

The EMdFOutput class is an abstraction of three things:

  • A default encoding (e.g., ISO-8859-1),

  • A pointer to a std::ostream descendant to use when outputting, and

  • An output kind, telling Emdros whether to use console output, XML output,or JSON outut.

C++ interface


#include <emdf_output.h>

typedef enum {
  kCSASCII,
  kCSISO_8859_1,
  kCSISO_8859_8,
  kCSUTF8
} eCharsets;

typedef enum {
  kOKXML,         // XML.
  kOKConsole,     // Console (more or less human-readable).
  kOKCompactXML,  // Compact XML.
  kOKJSON,        // JSON.
  kOKCompactJSON  // Compact JSON.


} eOutputKind;

class EMdFOutput {
public:
  EMdFOutput(eCharsets charset,       // Default encoding
              std::ostream *pStream,   // Output stream
              eOutputKind output_kind, // XML, JSON, or Console?
              int indent_chars = 3     // No. of indent-spaces for XML or JSON
              );
  ~EMdFOutput();
  eOutputKind getOutputKind(void) const { return m_output_kind; }
};


Previous:EmdrosEnv
Up:Part II: APIs
Next:EMdF database