Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members Related Pages

# LoadC.h

    00001 //-------------------------------------------------------------------------
    00002 //
    00003 // File:        LoadC.h
    00004 // Desc:        Input stream class.
    00005 // Author:      memon <memon@inside.org>
    00006 //
    00007 //-------------------------------------------------------------------------
    00008 //  Copyright (c) 2000-2002 Moppi Productions. All Rights Reserved.
    00009 //  This file is part of Moppi Demopaja SDK. For conditions of
    00010 //  distribution and use, see the accompanying license.txt file.
    00011 //  http://moppi.inside.org/demopaja/
    00012 //-------------------------------------------------------------------------
    00013
    00014 #ifndef __DEMOPAJA_LOADC_H__
    00015 #define __DEMOPAJA_LOADC_H__
    00016
    00017 #define FILEIO_DONT_INCLUDE_STREAMS
    00018 #include "PajaTypes.h"
    00019 #include "FileIO.h"
    00020 #include "FactoryC.h"
    00021 #include <stdio.h>
    00022 #include <vector>
    00023 #include <string>
    00024
    00025 namespace FileIO {
    00026
    00028
    00081     class LoadC
    00082     {
    00083     public:
    00085         LoadC( PluginClass::FactoryC* pFactory );
    00087         virtual ~LoadC();
    00088
    00090
    00100         virtual PajaTypes::uint32   open( const char* szName, const PajaTypes::int8* pSignature, PajaTypes::int32 i32SignatureSize );
    00102         virtual PajaTypes::uint32   close();
    00103
    00105
    00110         virtual PajaTypes::uint32   open_chunk();
    00112         virtual PajaTypes::uint32   get_chunk_id();
    00114         virtual PajaTypes::uint32   get_chunk_version();
    00116         virtual PajaTypes::uint32   get_chunk_size();
    00118         virtual PajaTypes::uint32   get_chunk_indent();
    00119
    00121         virtual PajaTypes::uint32   peek_next_chunk();
    00122
    00124
    00126         virtual PajaTypes::uint32   close_chunk();
    00127
    00129         virtual PajaTypes::uint32   read( void* pBuffer, PajaTypes::uint32 ui32Size );
    00131         virtual PajaTypes::uint32   read_str( char* szStr );
    00132
    00134         virtual PajaTypes::uint32   get_error();
    00135
    00137
    00171         virtual void                add_file_handle_patch( void** pPointer, PajaTypes::uint32 ui32HandleId );
    00173         virtual PajaTypes::uint32   get_file_handle_patch_count();
    00175         virtual void**              get_file_handle_patch_pointer( PajaTypes::uint32 ui32Index );
    00177         virtual PajaTypes::uint32   get_file_handle_patch_id( PajaTypes::uint32 ui32Index );
    00178
    00180         virtual PluginClass::FactoryC*  get_factory() const;
    00181
    00183         virtual PajaTypes::uint32   get_error_message_count();
    00185         virtual const char*         get_error_message( PajaTypes::uint32 ui32Index );
    00187
    00191         virtual void                add_error_message( const char* szMessage );
    00192
    00194         virtual PajaTypes::uint32   get_file_size() const;
    00196         virtual PajaTypes::uint32   get_read_pos() const;
    00197
    00198     private:
    00199
    00200         struct ChunkHdrS {
    00201             PajaTypes::uint32   m_ui32ID;
    00202             PajaTypes::uint32   m_ui32Version;
    00203             PajaTypes::uint32   m_ui32Size;
    00204             PajaTypes::uint32   m_ui32Next;
    00205             bool                m_bLastChunk;
    00206         };
    00207
    00208         struct FileHandlePatchS {
    00209             PajaTypes::uint32   m_ui32HandleId;
    00210             void**              m_pPointer;
    00211         };
    00212
    00213         struct ErrorMessageS {
    00214             std::string         m_sMessage;
    00215         };
    00216
    00217         FILE*                           m_pStream;
    00218         std::vector<ChunkHdrS>          m_rChunkList;
    00219         std::vector<FileHandlePatchS>   m_rFileHandlePatches;
    00220         std::vector<ErrorMessageS>      m_rErrorLog;
    00221         PajaTypes::uint32               m_ui32Indent;
    00222         PajaTypes::uint32               m_ui32Error;
    00223         PajaTypes::uint32               m_ui32FileSize;
    00224
    00225         PluginClass::FactoryC*          m_pFactory;
    00226     };
    00227
    00228 };
    00229
    00230 #endif // __LOADC_H__