Skip to main content
GameDev.net gamedev.net
🔒 Locked

INI or XML ???

Started by HellzGod Sep 3, 2008 at 7:50 AM 4 replies 1.5k views
Original Post
HellzGod
HellzGod
Hi, I'm working on an application which uses a specific font ( which is not the default OS font for that language ). Now I've to maintain a table which tells me which font to use when I encounter a particular language id. Should I maintain it as an ini file? Or do I go with XML? XML seems to be a cleaner way of doing things but I have these concerns: 1. Once I locate the element containing the language id I'm looking for, I want to stop parsing and return. I don't think this is possible when I'm using the ISAXXmlReader interface. Won't this be a perf hit? 2. The requirement is pretty simple. Wud using XML be an overkill? Please let me know which approach is better. Thanks, M
gan
gan
hi HellzGod, i am new too. What i suggest is just my personal opinion, do not take it serious:
which font to use ?
Quote:

1. Once I locate the element containing the language id I'm looking for, I want to stop parsing and return. I don't think this is possible when I'm using the ISAXXmlReader interface. Won't this be a perf hit?

SAX is fast, should be ok. If you read data forwardly should be no problem.
Quote:

2. The requirement is pretty simple. Wud using XML be an overkill?

if you apps is simple configuration, then go for ini. For long term, it's good for XML, with proper planning.
Red Ghost
Red Ghost
Hi,

Using INI format or XML format depends on the structure of the information you need to convey.

If the information has no hierarchic relation, go for INI or roll your own config text file along the same lines (Unless I am mistaken, the Win32 processing functions will be deprecated in Windows Vista).
Here is an example of simple ASCII config file//language_type = font name , size of font in points[EDITOR_FONTS]C=FunnyFont1, 14Basic=FunnyFont2, 8


If the information has hierarchic information, go for XML. This format is better to represent hierarchies.
Here is an example of an XML config file<?xml version="1.0" encoding="UTF-8"?><editor_fonts><language type="C"><font name="FunnyFont1"><size>14</size></font></language><language type="Basic"><font name="FunnyFont2"><size>8</size></font></language></editor_fonts>


Choose what is best for you.
Hope that helps.

Ghostly yours,
Red.
Ghostly yours,Red.
HellzGod
HellzGod
Hi,
Thank you for you replies.

@Red Ghost
My XML and INI file design is more or less what you have given as an example. I looked up MSDN about support for Win32 API functions and this is what I found:

Quote:

Note This function is provided only for compatibility with 16-bit Windows-based applications, therefore this function should not be called from server code.


What is this server code? Is this the invoking code?
Thanks,
M
Sneftel
Sneftel
Quote:
Original post by HellzGod
1. Once I locate the element containing the language id I'm looking for, I want to stop parsing and return. I don't think this is possible when I'm using the ISAXXmlReader interface. Won't this be a perf hit?
I don't think it'll really be possible to spend a significant amount of processing time on this regardless of the method used. In any case, you might store the data on disk as an INI or XML file, but it's likely that it'll be loaded into memory during runtime.
Quote:
2. The requirement is pretty simple. Wud using XML be an overkill?
No. Small INI files are just as ugly as big ones.

HellzGod
HellzGod
Hi,
OK. I'll go with XML then. Thanks :)

M

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.