Hello...
Would be cool, if sfml will have be functions/classes for Streams, with possible to register new my own stream, all working by URI (example uri: '
ftp://blabla').
would be possible something like this: (pseudo-code)
.
sfStream *http = CreateStreamFromURI("http://mypage.com/mytestfile.zip");
sfStream *ftp =
CreateStreamFromURI("ftp://mypage.com/mytestfile.zip");
sfStream *zip =
CreateStreamFromURI("zip://C:/example.zip#infile.bmp");
zip->Seek(10,...); // offset change
http->Seek(100,...); // offset change if HTTP/1.0 by Range:
bytes=100- etc.
ftp->Seek(100,...); // offset change....
int howmuch = ftp->Read(100,mybuffer); //
ftp->SetAsync(true); // non-blocking reading/writing
and register new my own streams like:
class MyOwnStream : public IStreamCreator {
public:
MyOwnStream();
virtual ~MyOwnStream();
public:
char* GetURIPrefix(); // get "ftp://" or something.
sf::Stream *CreateStream(); // create interface (use by CreateStreamForURI);....
};
RegisterCustomStream("myzip://",mMyOwnStreamPointer);
BlitzMax have similar streams.
etc, etc.... i hope someone understand me
.
sorry, for bad english.