00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef OctaneTesterH
00016 #define OctaneTesterH
00017
00018
00019
00020
00021 #include "../core/octane.hpp"
00022 #include "../core/compressormanager.hpp"
00023
00024 #include <string>
00025
00026
00027
00028
00029
00032 class OctaneTester : public OctaneClass
00033 {
00034 protected:
00036 OctaneCompressor *currentcompressorp;
00037 public:
00039 OctaneTester();
00041 ~OctaneTester();
00042 public:
00044 void ShowHelp();
00046 void TestLoop();
00049 bool ParseCommand(const std::string &inputstr);
00052 bool ExecuteCommandsFromStream(std::ifstream &from, bool quiet);
00055 bool ExecuteCommandsFromFile(const std::string &filename, bool quiet);
00056 protected:
00059 bool GrabLineFromConsole(std::string &line);
00061 void ListCompressors(bool briefmode);
00064 OctaneCompressor* SelectInstantiatedCompressor(const std::string &compressorname);
00068 bool CheckCompressorSelected(OctaneCompressor *compressorp);
00072 bool CheckCompressorReady(OctaneCompressor *compressorp);
00075 std::string MakeAssumedOutputFilename(const std::string &origname, const std::string &origext, const std::string &newext);
00076 protected:
00079 bool RunCommand_TestString(std::string inputstring);
00082 bool RunCommand_TestFile(std::string filename);
00085 bool RunCommand_CreateCompressor(std::string compressorclassname,std::string compressorname, unsigned short guidnum);
00086
00089 bool RunCommand_LoadCompressor(std::string filename);
00092 bool RunCommand_SaveCompressor(std::string filename);
00095 bool RunCommand_DeleteCompressor(std::string compressoridstring);
00098 bool RunCommand_MakeState(std::string infilename);
00101 bool RunCommand_Compress(std::string infilename,std::string outfilename, bool savedecompressstateinfo);
00104 bool RunCommand_Decompress(std::string infilename,std::string outfilename, bool savedecompressstateinfo);
00105 protected:
00109 bool DeleteAFile(std::string filename);
00113 bool CheckFilesAreIdentical(std::string filename1,std::string filename2);
00114 };
00115
00116
00117 #endif
00118