|
Krita Source Code Documentation
|
The KisCosParser class. More...
#include <kis_cos_parser.h>
Public Member Functions | |
| QVariantHash | parseCosToJson (QByteArray *ba) |
Private Member Functions | |
| bool | parseArray (QIODevice &dev, QVariantList &array) |
| bool | parseObject (QIODevice &dev, QVariantHash &object, bool checkEnd=true) |
| bool | parseValue (QIODevice &dev, QVariant &val) |
The KisCosParser class.
PSD text engine data is written in PDF's Carousel Object Structure, a format not unsimilar to (might be a precursor) to JSON. JSON however doesn't differentiate between ints and doubles, so we use QVariantHash instead.
This parser tries to parse the ByteArray as a QVariantHash, though not every data type is interpreted as such:
For one, 'name' objects are interpreted as strings prepended with / Hex strings are kept inside their < and >
Code was based off qjsonparser.cpp
Definition at line 31 of file kis_cos_parser.h.
|
private |
Definition at line 207 of file kis_cos_parser.cpp.
References eatSpace(), EndArray, and parseValue().
| QVariantHash KisCosParser::parseCosToJson | ( | QByteArray * | ba | ) |
Definition at line 299 of file kis_cos_parser.cpp.
References BeginObject, eatSpace(), parseObject(), and parseValue().
|
private |
Definition at line 182 of file kis_cos_parser.cpp.
References eatSpace(), EndObject, and parseValue().
|
private |
Definition at line 226 of file kis_cos_parser.cpp.
References BeginArray, BeginName, BeginObject, BeginString, eatSpace(), EndArray, EndObject, parseArray(), parseHexString(), parseName(), parseNumber(), parseObject(), and parseString().