Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LIGHTAPP_DRIVER_H
00024 #define LIGHTAPP_DRIVER_H
00025
00026 #include "LightApp.h"
00027
00028 #include "string"
00029 #include "vector"
00030 #include "map"
00031
00032 #ifdef WIN32
00033 #pragma warning( disable:4251 )
00034 #endif
00035
00038 class LIGHTAPP_EXPORT LightApp_Driver
00039 {
00040 public:
00041 LightApp_Driver();
00042 virtual ~LightApp_Driver();
00043
00044
00045 typedef std::vector<std::string> ListOfFiles;
00046
00047 virtual bool SaveDatasInFile (const char* theFileName, bool isMultiFile);
00048 virtual bool ReadDatasFromFile (const char* theFileName, bool isMultiFile);
00049 virtual std::string GetTmpDir (const char* theURL, const bool isMultiFile);
00050
00051 ListOfFiles GetListOfFiles (const char* theModuleName);
00052 virtual void SetListOfFiles (const char* theModuleName, const ListOfFiles theListOfFiles);
00053 virtual void RemoveTemporaryFiles(const char* theModuleName, const bool IsDirDeleted);
00054 void RemoveFiles( const ListOfFiles& theFiles, const bool IsDirDeleted);
00055
00056 virtual void ClearDriverContents();
00057
00058 protected:
00059 void PutFilesToStream(const std::string& theModuleName, unsigned char*& theBuffer,
00060 long& theBufferSize, bool theNamesOnly = false);
00061 ListOfFiles PutStreamToFiles(const unsigned char* theBuffer,
00062 const long theBufferSize, bool theNamesOnly = false);
00063
00064 std::string GetTmpDir();
00065 std::string GetDirFromPath(const std::string& thePath);
00066
00067 void SetIsTemporary( bool theFlag ) { myIsTemp = theFlag; }
00068 bool IsTemporary() const { return myIsTemp; }
00069
00070 protected:
00071 typedef std::map<std::string, ListOfFiles> MapOfListOfFiles;
00072 MapOfListOfFiles myMap;
00073 std::string myTmpDir;
00074
00075 private:
00076 bool myIsTemp;
00077 };
00078
00079 #endif