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.

Dark GDK / Read Write file

Author
Message
Valmerin
16
Years of Service
User Offline
Joined: 30th Nov 2007
Location:
Posted: 6th Dec 2007 01:42
Ok i wana read a calma separated text file, but the problem is i cant use iostream or fstream, can some one help me, is there a function built into the dark gdk to do this for you.
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 6th Dec 2007 05:26
I don't think that DarkGDK has builtin functions for it because it's already handled well by C++ natively. Why can't you just use fstream for it?


Tux is my guildmaster.
FERSIS
18
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 6th Dec 2007 12:05
better than CSV (comma separated Value) are XML's ,the easiest way to implement XML on your project is TinyXML.
Cheers.
If you need CSV, you can make your own parsing rutines with GDK functions or you can use strtok() and getline() from string.h, it will help you a lot
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Dec 2007 20:12
And you can open a CSV in EXCEL and then force it to save it as an XML for you! OPenOffice does the same thing!

...or... just figure out how to parse it yourself. If you do ... make/find some basic functions (See STDLIB) but you'll want things like :

trim
ltrim
rtrim
mid$
right$
left$
(or substr)
ucase
lcase
pcase (propercase/titlecase..not that important for game stuff)

Also, I recommend you find/make a simple tokenizer - better still if its smart enough to know when its in quotes or not.

Good Luck!

Login to post a reply

Server time is: 2024-11-19 18:27:44
Your offset time is: 2024-11-19 18:27:44