Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Quadra NX-XML Reader/Writer

Author
Message
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 22nd Mar 2011 19:06 Edited at: 30th Mar 2011 21:01
Hey!

I have been developing my editor/engine for quite some time now.
And as I am not a really big fan of using libraries, I had to make my own xml reader/writer class, and because I haven't showed really much lately on the TGC forums, I tought it would be cool to share it with you. It is still WIP though. For now I can show you how it works and what features it has, I will upload a demo soon.

Btw: This is not exactly XML code, it is easy to read by user, and just a way to load and write data. ...therefore:

Quadra Not eXactly-XML File Reader/Writer


Example of XML file:


Example on how to read the internalMessage and the helloWorld Message:


The header files include:
- a TextClass (qText class)
- the XMLClass (qXML class)

Functions:
+Read
void read_setNode(string nodeName)
void goBackNode(int ammount) or void goBackNode()
void read_setElement(string elementName)
int getAttributeIntValue(string attName, bool multiParam)
string getAttributeStringValue(string attName, bool multiParam)
int endXML()

+Write
void write_makeNode(string nodeName)
void write_endNode()
void write_beginElement(string name)
void addAttributeIntValue(string name, int value, bool multiParam, int ammountParam)
void addAttributeStringValue(string name, string value, bool multiParam, int ammountParam)
void write_save()


+ Platform Independent

The system can Output settings to file and read settings.

Output of the example above:
"16" is ammount of time (miliseconds 1000 is one second) to loadFile and read it, returned by endXML();
Then the helloworld string and the internal message string.



I will try and post a demo tonight.

Cheers,

RedEye

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Mar 2011 02:24
Your XML doesn't look valid, those attribute values should have quotations.

The Internet: Where men are men, women are men, and children are federal agents
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 23rd Mar 2011 18:34 Edited at: 23rd Mar 2011 18:34
Quote: "Your XML doesn't look valid, those attribute values should have quotations."


It wasn't supposed to be xml. Therefore the not eXactly xml part.

Anyway's I guess it isn't very special, besides that a lot of people are asking about data saving and such on the forums.

Update:

- Added Write Functions:
void write_makeNode(string nodeName)
void write_endNode()
void write_beginElement(string name)
void addAttributeIntValue(string name, int value, bool multiParam, int ammountParam)
void addAttributeStringValue(string name, string value, bool multiParam, int ammountParam)
void write_save()


Again, this is not really xml, but just a way to write and read data easily to understand.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Mar 2011 02:22
So does your format require that exact spacing as your example shows??

The Internet: Where men are men, women are men, and children are federal agents
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 30th Mar 2011 20:58 Edited at: 30th Mar 2011 21:00


You mean between the ","? No, that is not needed.

Or did you mean the " = "? Yes that is needed. (thats how the system outputs it anyway)

Or did you mean the Tabs? No, that's not needed.

This is an example of a saved map of my editor, showing how it writes all settings down:



So for me it basicaly is finished, and currently using it in my project.

Login to post a reply

Server time is: 2024-04-20 03:28:17
Your offset time is: 2024-04-20 03:28:17