summaryrefslogtreecommitdiff
path: root/src/stable/myriadstream.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-04-13 23:34:27 +0000
committerMike Buland <eichlan@xagasoft.com>2012-04-13 23:34:27 +0000
commit91f9d6e8b371f339dbcc16541054f9cb371d0ec9 (patch)
tree406ce502763a58a8badea89ad35ec554a6c1a27b /src/stable/myriadstream.h
parent4c86d59be19a5cb64e1eb98504ab5a844a042977 (diff)
downloadlibbu++-91f9d6e8b371f339dbcc16541054f9cb371d0ec9.tar.gz
libbu++-91f9d6e8b371f339dbcc16541054f9cb371d0ec9.tar.bz2
libbu++-91f9d6e8b371f339dbcc16541054f9cb371d0ec9.tar.xz
libbu++-91f9d6e8b371f339dbcc16541054f9cb371d0ec9.zip
Myriad is actually fine, I double checked it for cross-platformed-ness. It
doesn't yet normalize the endian-ness, and I guess at this point to maintain compatibility I'll have to make it a little endian format. I would still like to add better thread-safety to it, but that's about it.
Diffstat (limited to 'src/stable/myriadstream.h')
-rw-r--r--src/stable/myriadstream.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/stable/myriadstream.h b/src/stable/myriadstream.h
new file mode 100644
index 0000000..fdad669
--- /dev/null
+++ b/src/stable/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
14namespace 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