Cute Chess  0.1
Public Member Functions | List of all members
JsonSerializer Class Reference

A JSON (JavaScript Object Notation) serializer. More...

#include <jsonserializer.h>

Public Member Functions

QString errorString () const
 
bool hasError () const
 
 JsonSerializer (const QVariant &data)
 
bool serialize (QTextStream &stream)
 

Detailed Description

A JSON (JavaScript Object Notation) serializer.

JsonSerializer converts QVariants into JSON data and writes it to a text stream. The following QVariant types are supported:

JSON specification: http://json.org/

See also
JsonParser

Constructor & Destructor Documentation

JsonSerializer::JsonSerializer ( const QVariant data)

Creates a new serializer that operates on data.

Member Function Documentation

QString JsonSerializer::errorString ( ) const

Returns a detailed description of the error.

bool JsonSerializer::hasError ( ) const

Returns true if an error occured.

bool JsonSerializer::serialize ( QTextStream stream)

Converts the data into JSON format and writes it to stream.

Returns false if an invalid or unsupported variant type is encountered. Otherwise returns true.


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