0

I have a CSS like data structure like in this example:

/* CSS like style sheet file *.pss */

@include "otherStyleSheet.pss";

/* comment */ [propertyID="72100000"] { fillColor : #f3f1ed;
minSize : 5; lineWidth : 3; }

/* sphere */ [propertyID="2352????"] { lineType : dotted; }

/* square */ [propertyID="2115????"] { lineType : thinline; }

/* ring */ [propertyID="2315????"] { lineType : thickline;
[hasInnerRing=true] { innerLineType : thinline; } }

So I always have a root tag propertyID and its corresponding attributes like fillColor and lineType etc..

Let us assume, this data is already structured (attributes are children etc.) in a .. let say:

QStandardItemModel* treeModel = new QStandardItemModel();
  1. When I have that example above in such a QStandardItemModel, how could I write and this Model in a serialized way effectively from an to a file ? (Please no JSON, no XML recommenedations)

  2. Assuming I just would be interesseted in one propertyID, which is in the middle of a file, can I access it without parsing the preceeding propertyID 's ? Thanks in advance!

Community
  • 1
  • 1
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103

1 Answers1

0

Here is a very nice example. Your propertyID could be structured in a seperate object like the UserRecord in this example..

  1. You would have to go all preceeding 'Records'
Murat
  • 716
  • 1
  • 6
  • 14