[Scummvm-devel] Porters: New AbstractFilesystemNode method
max at quendi.de
Mon May 1 07:35:02 CEST 2006
Am 01.05.2006 um 16:07 schrieb Marcus Comstedt:
> Max Horn <max at quendi.de> writes:
>> This new method is a step towards becoming almost completely "path
>> free". One of the next steps will be adding a "File::open
>> (FilesystemNode node)" method.
> Path free? So now ConfMan.get("path") will return an object?
> Or how will the location of the data files be communicated?
No, it will not return an object (because then ConfMan would have to
know about "special" keys etc.). It will still return a string. But
that string doesn't have to be a "path". It just has to somehow
encode the location of the file, be it as a classical path, or be it
a serialized version of your FilesystemNode class. Only requirement
will be that FilesystemNode can parse it with it's String-constructor.
Of course, right now it also must be something that can be passed to
fopen. But that will eventually change, because you then can override
"File::open(FilesystemNode node)" to do file access differently (i.e.
instead of fopen, you can use whatever API your platform offers).
Right now, porters have to emulate the standard C file API if it's
not present (as e.g. the PS2 port does). In a sense, I am planning to
turn the File class into a "backend module", too.
We are still quite a way from this but it was one of the original
reasons for adding FilesystemNode in the first place. But I guess
we'll better wait for this till after the 0.9.0 release (or work on
it in a branch. Or make the 0.9.0 branch sooner, whatever :-).
More information about the Scummvm-devel