gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Boost::Spirit and other Boost libraries on the DS...

#103656 - Argue - Sat Sep 23, 2006 4:16 pm

Hello again everyone, I've been trying to add an SGF file parser to the Go program I've been working on, and I wanted to use the Boost::Spirit library. It seemed to compile fine, but right now, I have no way of parsing the file.

Boost::Spirit either parses from a string (and I don't want to store a huge text file in a string), or from a file_iterator, which is defined in Boost::Spirit. However, I cannot use file_iterator, because it uses standard i/o functions (like fopen and fseek), which as far as I know, are not available--I'm using Chism's FAT library.

In some other threads here, I noticed some people making reference to Boost, so I thought someone might have already tried using Spirit with a DS game. Does anyone have any suggestions on what I can do to make a file iterator that works with both a Supercard and Spirit?

I decided to make a new thread instead of bumping my old one because I'd love to hear Boost+libnds discussion/success stories in general, whether related to my problem or not. :)

#103671 - Sausage Boy - Sat Sep 23, 2006 7:00 pm

Of course you can use standard i/o! Just make sure you're using libfat, and not gba_nds_fat.
_________________
"no offense, but this is the gayest game ever"

#103679 - sajiimori - Sat Sep 23, 2006 7:52 pm

On my last project, I mostly used boost::bind and smart pointers. I didn't use anything that required separate compilation because there wasn't enough incentive to set up the build process, for my purposes.

#103724 - Argue - Sun Sep 24, 2006 4:37 am

Sausage Boy wrote:
Of course you can use standard i/o! Just make sure you're using libfat, and not gba_nds_fat.

Oh man, now I feel dumb for not looking for other libraries. Thanks. :)

#103803 - tepples - Sun Sep 24, 2006 7:18 pm

Sausage Boy wrote:
Of course you can use standard i/o! Just make sure you're using libfat, and not gba_nds_fat.

Then how will the user be able to select an SGF file? As I understand it, it is impossible to make a file chooser with libfat unless the user connects the memory card to the PC, does dir /s /b I:\ > I:\dir.txt to list all files on the card to a text file, and does not create or delete any file on the card without updating the text file that contains the file list.

Or has libfat been changed? If so, where is libfat's homepage? Chishm's site on drunkencoders seems to describe only gba_nds_fat.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#103895 - Argue - Mon Sep 25, 2006 5:58 am

tepples wrote:

Then how will the user be able to select an SGF file? As I understand it, it is impossible to make a file chooser with libfat unless the user connects the memory card to the PC, does dir /s /b I:\ > I:\dir.txt to list all files on the card to a text file, and does not create or delete any file on the card without updating the text file that contains the file list.


But I can make a file chooser with Chism's library, and then just use libfat for actually reading the file, right? Do I understand this right, or is there something preventing me from using both? Is this unsafe? Or possibly just bad practice?

#103923 - tepples - Mon Sep 25, 2006 1:47 pm

Only one library can have access to the CF or SD adapter at once.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.