rapidjson::GenericWriteStream Class Reference

Wrapper of std::ostream for output. More...

#include <genericstream.h>

Public Types

typedef char Ch
 Character type. Only support char. More...
 

Public Member Functions

 GenericWriteStream (std::ostream &os)
 Constructor. More...
 
void Put (char c)
 
void PutN (char c, size_t n)
 
void Flush ()
 
size_t Tell () const
 
char Peek () const
 
char Take ()
 
charPutBegin ()
 
size_t PutEnd (char *)
 

Private Attributes

std::ostream & os_
 

Detailed Description

Wrapper of std::ostream for output.

Member Typedef Documentation

◆ Ch

Character type. Only support char.

Constructor & Destructor Documentation

◆ GenericWriteStream()

rapidjson::GenericWriteStream::GenericWriteStream ( std::ostream &  os)
inline

Constructor.

Parameters
osOutput stream.
81  : os_(os) {
82  }
std::ostream & os_
Definition: genericstream.h:109

Member Function Documentation

◆ Flush()

void rapidjson::GenericWriteStream::Flush ( )
inline
94  {
95  os_.flush();
96  }

References os_.

◆ Peek()

char rapidjson::GenericWriteStream::Peek ( ) const
inline
103 { RAPIDJSON_ASSERT(false); }
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:105

References RAPIDJSON_ASSERT.

◆ Put()

void rapidjson::GenericWriteStream::Put ( char  c)
inline
84  {
85  os_.put(c);
86  }

References os_.

Referenced by PutN().

◆ PutBegin()

char* rapidjson::GenericWriteStream::PutBegin ( )
inline
105 { RAPIDJSON_ASSERT(false); return 0; }

References RAPIDJSON_ASSERT.

◆ PutEnd()

size_t rapidjson::GenericWriteStream::PutEnd ( char )
inline
106 { RAPIDJSON_ASSERT(false); return 0; }

References RAPIDJSON_ASSERT.

◆ PutN()

void rapidjson::GenericWriteStream::PutN ( char  c,
size_t  n 
)
inline
88  {
89  for (size_t i = 0; i < n; ++i) {
90  Put(c);
91  }
92  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
void Put(char c)
Definition: genericstream.h:84
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

References constants::i, n, and Put().

Referenced by rapidjson::PutN().

◆ Take()

char rapidjson::GenericWriteStream::Take ( )
inline
104 { RAPIDJSON_ASSERT(false); }

References RAPIDJSON_ASSERT.

◆ Tell()

size_t rapidjson::GenericWriteStream::Tell ( ) const
inline
98  {
99  return (int)os_.tellp();
100  }

References os_.

Member Data Documentation

◆ os_

std::ostream& rapidjson::GenericWriteStream::os_
private

Referenced by Flush(), Put(), and Tell().


The documentation for this class was generated from the following file: