00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __RIOMMINDEX_H__
00019 #define __RIOMMINDEX_H__
00020
00021 #include "RioInterfaceTypes.h"
00022 #include "RioInterface.h"
00023 #include "tstring.h"
00024 #include "tqueue.h"
00025
00026
00027 #define ARG_INT(n) (0<<(n))
00028 #define ARG_STRING(n) (1<<(n))
00029
00030 typedef enum
00031 {
00032 CONTEXT_FAILED = 0,
00033 CONTEXT_CHANGED = 1,
00034 CONTEXT_NOTCHANGED = 2
00035 } ContextResult;
00036
00037 class CRioMMIndex
00038 {
00039 private:
00040 class SlideSection
00041 {
00042 private:
00043 int slide_number;
00044 RioBlock index;
00045 int commands_offset;
00046 RioBlock first_command_index;
00047
00048 SlideSection * next_slide;
00049 public:
00050 SlideSection( int, RioBlock, int, RioBlock );
00051 ~SlideSection( void );
00052
00053 inline void SetNextSlide( SlideSection * );
00054
00055 inline int GetSlideNumber( void ) const;
00056 inline RioBlock GetIndex ( void ) const;
00057 inline int GetCommands ( void ) const;
00058 inline RioBlock GetFirstCommandIndex( void ) const;
00059 inline SlideSection * GetNextSlide ( void ) const;
00060 };
00061
00062 class FileSection
00063 {
00064 private:
00065 TString filename;
00066 RioBlock index;
00067
00068 FileSection * next_file;
00069 SlideSection * first_slide,
00070 * last_slide;
00071 public:
00072 FileSection( const char *, RioBlock );
00073 ~FileSection( void );
00074
00075 inline void SetNextFile ( FileSection * );
00076 inline void SetFirstSlide( SlideSection * );
00077 inline void SetLastSlide ( SlideSection * );
00078
00079 inline const char * GetFileName ( void ) const;
00080 inline RioBlock GetIndex ( void ) const;
00081 inline FileSection * GetNextFile ( void ) const;
00082 inline SlideSection * GetFirstSlide( void ) const;
00083 inline SlideSection * GetLastSlide ( void ) const;
00084 };
00085
00086
00087 int number_of_files;
00088 int number_of_slides;
00089
00090 int major, minor;
00091 TString archive_name;
00092
00093 FileSection * first_file,
00094 * last_file;
00095
00096
00097 FileSection * current_file;
00098 SlideSection * current_slide;
00099
00100 public:
00101 CRioMMIndex( RioBlock, int, int, const char * );
00102 ~CRioMMIndex( void );
00103
00104
00105 bool InsertFile ( const char *, RioBlock );
00106 bool InsertSlide( int, int, RioBlock, RioBlock );
00107
00108
00109 bool GetContext( RioBlock, TString &, int *, int *, RioBlock * ) const;
00110 ContextResult ResetContext( RioBlock );
00111 ContextResult UpdateContext( RioBlock, TString&, int*, int*, RioBlock* );
00112
00113 const char * GetArchiveName( void ) const;
00114 int GetMajor ( void ) const;
00115 int GetMinor ( void ) const;
00116
00117 bool IsValid( void ) const;
00118 };
00119
00120 #endif