From 24ab24777d7cd72b7ff35a9d02cb43e26f006b0d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 25 May 2010 17:45:03 +0000 Subject: More myriad testing, fixes, arrangement, etc. UnitSuite add-ons, it has some command line parameters now, I would like to also add an automatic paramter that would switch it to a computer-readable output mode for use in a larger testing framework. --- src/myriad.h | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'src/myriad.h') 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 class Stream; class MyriadStream; - subExceptionDecl( MyriadException ) + subExceptionDeclBegin( MyriadException ) + enum + { + emptyStream, + invalidFormat, + badVersion, + invalidWordSize, + noSuchStream + }; + subExceptionDeclEnd() /** * Numerically Indexed Data Streams. This is a working name so I can @@ -69,17 +78,9 @@ namespace Bu { friend class MyriadStream; public: - Myriad( Bu::Stream &sStore ); + Myriad( Bu::Stream &sStore, int iBlockSize=512, int iPreallocate=8 ); virtual ~Myriad(); - /** - * Initialize this object based on the data already in the assosiated - * stream. This will be called automatically for you if you forget, - * but if you want to pre-initialize for some reason, just call this - * once before you actually start doing anything with your Myriad. - */ - void initialize(); - /** * Create a new Myriad system in the assosiated stream. This should be * used carefully, it will destroy all data already within the stream. @@ -114,7 +115,17 @@ namespace Bu */ void sync(); + static bool isMyriad( Bu::Stream &sStore ); + private: + /** + * Initialize this object based on the data already in the assosiated + * stream. This will be called automatically for you if you forget, + * but if you want to pre-initialize for some reason, just call this + * once before you actually start doing anything with your Myriad. + */ + void initialize(); + enum { blockUnused = 0xFFFFFFFFUL -- cgit v1.2.3