i need to rewrite this in VFS:
FILE *f;
f = fopen (filename, "rb");
if (f == NULL)
return false;
fread (&version, sizeof (TBXVersion), 1, f);
so i tried this:
csRef<iVFS> vfs;
vfs = csQueryRegistry<iVFS> (obj_reg);
csRef<iFile> f = vfs->Open (filename, VFS_FILE_READ);
f->Read (version, sizeof (TBXVersion));
but i get errors:
tbx.cpp: In member function `bool TBXFile::Open(char*)':
tbx.cpp:14: error: no matching function for call to `iFile::Read(TBXVersion&,
unsigned int)'
/usr/local/include/crystalspace/iutil/vfs.h:134: error: candidates are: virtual
size_t iFile::Read(char*, unsigned int)
make: *** [obj/tbx.o] Error 1
so how to read structures?
thanks.