HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_JSONWriter::TiledStreamBuf Class Reference

#include <UT_JSONWriter.h>

+ Inheritance diagram for UT_JSONWriter::TiledStreamBuf:

Public Member Functions

 TiledStreamBuf (UT_JSONWriter &w)
 
virtual ~TiledStreamBuf ()
 

Protected Member Functions

virtual int_type overflow (int_type c)
 
virtual std::streamsize xsputn (const char *s, std::streamsize num)
 

Detailed Description

A TiledStream allows you to write a blob of binary data to a JSON stream in an efficient manner. The data is buffered into uniform arrays which are output into a standard JSON array. The resulting data looks something like:

[ {options} tile1-data tile2-data ]

The tile-data is written as JSON string objects. You can read these yourself, or use the TiledStream in UT_JSONParser.

You should never write to the JSONWriter while the TiledStream is open.

An example of using this might be something like:

bool storeStream(UT_IStream &is)
{
char buffer[128];
int nread;
while ((nread = is.bread(buffer, 128)) > 0)
if (!os.write(buffer, nread)) return false;
return true;
}

Definition at line 372 of file UT_JSONWriter.h.

Constructor & Destructor Documentation

UT_JSONWriter::TiledStreamBuf::TiledStreamBuf ( UT_JSONWriter w)
virtual UT_JSONWriter::TiledStreamBuf::~TiledStreamBuf ( )
virtual

Member Function Documentation

virtual int_type UT_JSONWriter::TiledStreamBuf::overflow ( int_type  c)
protectedvirtual
virtual std::streamsize UT_JSONWriter::TiledStreamBuf::xsputn ( const char *  s,
std::streamsize  num 
)
protectedvirtual

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