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)
 
 ~TiledStreamBuf () override
 
 TiledStreamBuf (const TiledStreamBuf &)=delete
 
TiledStreamBufoperator= (const TiledStreamBuf &)=delete
 

Protected Member Functions

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

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 420 of file UT_JSONWriter.h.

Constructor & Destructor Documentation

UT_JSONWriter::TiledStreamBuf::TiledStreamBuf ( UT_JSONWriter w)
UT_JSONWriter::TiledStreamBuf::~TiledStreamBuf ( )
override
UT_JSONWriter::TiledStreamBuf::TiledStreamBuf ( const TiledStreamBuf )
delete

Member Function Documentation

TiledStreamBuf& UT_JSONWriter::TiledStreamBuf::operator= ( const TiledStreamBuf )
delete
int_type UT_JSONWriter::TiledStreamBuf::overflow ( int_type  c)
overrideprotected
std::streamsize UT_JSONWriter::TiledStreamBuf::xsputn ( const char *  s,
std::streamsize  num 
)
overrideprotected

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