diff options
Diffstat (limited to 'src/unstable/myriadstream.h')
-rw-r--r-- | src/unstable/myriadstream.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/unstable/myriadstream.h b/src/unstable/myriadstream.h new file mode 100644 index 0000000..fdad669 --- /dev/null +++ b/src/unstable/myriadstream.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #ifndef BU_MYRIAD_STREAM_H | ||
9 | #define BU_MYRIAD_STREAM_H | ||
10 | |||
11 | #include "bu/stream.h" | ||
12 | #include "bu/myriad.h" | ||
13 | |||
14 | namespace Bu | ||
15 | { | ||
16 | class MyriadStream : public Bu::Stream | ||
17 | { | ||
18 | friend class Myriad; | ||
19 | private: | ||
20 | /** | ||
21 | * These can only be created by the Myriad class. | ||
22 | */ | ||
23 | MyriadStream( Myriad &rMyriad, Myriad::Stream *pStream ); | ||
24 | |||
25 | public: | ||
26 | virtual ~MyriadStream(); | ||
27 | |||
28 | virtual void close(); | ||
29 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); | ||
30 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); | ||
31 | using Stream::write; | ||
32 | virtual Bu::size tell(); | ||
33 | virtual void seek( Bu::size offset ); | ||
34 | virtual void setPos( Bu::size pos ); | ||
35 | virtual void setPosEnd( Bu::size pos ); | ||
36 | virtual bool isEos(); | ||
37 | virtual bool isOpen(); | ||
38 | virtual void flush(); | ||
39 | virtual bool canRead(); | ||
40 | virtual bool canWrite(); | ||
41 | virtual bool isReadable(); | ||
42 | virtual bool isWritable(); | ||
43 | virtual bool isSeekable(); | ||
44 | virtual bool isBlocking(); | ||
45 | virtual void setBlocking( bool bBlocking=true ); | ||
46 | virtual void setSize( Bu::size iSize ); | ||
47 | |||
48 | virtual size getSize() const; | ||
49 | virtual size getBlockSize() const; | ||
50 | virtual Bu::String getLocation() const; | ||
51 | |||
52 | private: | ||
53 | Myriad &rMyriad; | ||
54 | Myriad::Stream *pStream; | ||
55 | Myriad::Block *pCurBlock; | ||
56 | int iBlockSize; | ||
57 | int iPos; | ||
58 | }; | ||
59 | }; | ||
60 | |||
61 | #endif | ||