aboutsummaryrefslogtreecommitdiff
path: root/src/myriad.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/myriad.h')
-rw-r--r--src/myriad.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/myriad.h b/src/myriad.h
index 900037b..b5cd18c 100644
--- a/src/myriad.h
+++ b/src/myriad.h
@@ -19,7 +19,16 @@ namespace Bu
19 class Stream; 19 class Stream;
20 class MyriadStream; 20 class MyriadStream;
21 21
22 subExceptionDecl( MyriadException ) 22 subExceptionDeclBegin( MyriadException )
23 enum
24 {
25 emptyStream,
26 invalidFormat,
27 badVersion,
28 invalidWordSize,
29 noSuchStream
30 };
31 subExceptionDeclEnd()
23 32
24 /** 33 /**
25 * Numerically Indexed Data Streams. This is a working name so I can 34 * Numerically Indexed Data Streams. This is a working name so I can
@@ -69,18 +78,10 @@ namespace Bu
69 { 78 {
70 friend class MyriadStream; 79 friend class MyriadStream;
71 public: 80 public:
72 Myriad( Bu::Stream &sStore ); 81 Myriad( Bu::Stream &sStore, int iBlockSize=512, int iPreallocate=8 );
73 virtual ~Myriad(); 82 virtual ~Myriad();
74 83
75 /** 84 /**
76 * Initialize this object based on the data already in the assosiated
77 * stream. This will be called automatically for you if you forget,
78 * but if you want to pre-initialize for some reason, just call this
79 * once before you actually start doing anything with your Myriad.
80 */
81 void initialize();
82
83 /**
84 * Create a new Myriad system in the assosiated stream. This should be 85 * Create a new Myriad system in the assosiated stream. This should be
85 * used carefully, it will destroy all data already within the stream. 86 * used carefully, it will destroy all data already within the stream.
86 * More options will probably be added soon. 87 * More options will probably be added soon.
@@ -114,7 +115,17 @@ namespace Bu
114 */ 115 */
115 void sync(); 116 void sync();
116 117
118 static bool isMyriad( Bu::Stream &sStore );
119
117 private: 120 private:
121 /**
122 * Initialize this object based on the data already in the assosiated
123 * stream. This will be called automatically for you if you forget,
124 * but if you want to pre-initialize for some reason, just call this
125 * once before you actually start doing anything with your Myriad.
126 */
127 void initialize();
128
118 enum 129 enum
119 { 130 {
120 blockUnused = 0xFFFFFFFFUL 131 blockUnused = 0xFFFFFFFFUL