Hi
Jeg sidder og koder lidt paragui (nogle klasser til c++ til GUI -
www.paragui.org). Har problemer med at læse biblioteker. Jeg ved hvordan
man kan gøre det i standart c++, men vil meget gerne bruge paragui's
klasser. Her er mit test program
#include "pgfilearchive.h"
PG_FileArchive* path = new PG_FileArchive();
int i=0;
int main(int argc, char* argv[]) {
char** test;
std::cout<<path->GetBaseDir()<<"\n"; // Base output OK
test=path->EnumerateFiles(path->GetBaseDir());
while(test[i]!=NULL){
std::cout<<test[i]; //No output !?! test[i] == NULL ???
i++;
}
return 0;
}
Får ikke listen af filerne i mit base dir. Dvs test[i] er NULL Hvad gør jeg forkert ?
Her er beskrivelserne af klasser/metoder:
-------------------------------------------------
PG_FileArchive Class Reference
A C++ wrapper for the PhysicsFS
.....
Constructor & Destructor Documentation
PG_FileArchive::PG_FileArchive ( )
PG_FileArchive:
![Meget forvirret](images/smileys/confused.gif)
PG_FileArchive ( )
......
char** PG_FileArchive::EnumerateFiles ( const char * dir ) [static]
Get a list of files in a directory.
This function returns a NULL terminated char ** with the files in the
specified directory. If the directory doesn't exist, NULL is returned.
Note:
The caller is responsible for freeing the array and the directories within the array.
Parameters:
dir directory to list files in
Returns:
the file list
.......
const char* PG_FileArchive::GetBaseDir ( ) [static]
Get the application base directory.
Returns:
the application base directory
-------------------------------------------------
Alt hjælp sætter jeg stor pris på
JokeSten
btw : Bruger mandrake 9.0, gcc 3.2 , paragui 1.0.2