Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ferdekk

Pages: [1]
1
Feature requests / sf::Stream, or similar.
« on: March 24, 2008, 09:32:58 am »
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) ;).

Code: [Select]

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:

Code: [Select]

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.

Pages: [1]