diff --git a/src/orc/ResourceCompiler.h b/src/orc/ResourceCompiler.h index 60d4c8b081eb39bdb215bb8919ef8d58508877ff..11beb66d1a6557e867116f299380cd12d8549dd5 100644 --- a/src/orc/ResourceCompiler.h +++ b/src/orc/ResourceCompiler.h @@ -58,61 +58,61 @@ class ResourceCompiler { public: - /** - * \brief Constructor - * - * \param inputFilename Name of the resource specification file (source, \c *.orc) - * \param outputFilename Name of the converted recources file (destination, \c *.cpp) - */ - ResourceCompiler(const string inputFilename, const string outputFilename); + /** + * \brief Constructor + * + * \param inputFilename Name of the resource specification file (source, \c *.orc) + * \param outputFilename Name of the converted recources file (destination, \c *.cpp) + */ + ResourceCompiler(const string inputFilename, const string outputFilename); - /// Destructor - virtual ~ResourceCompiler(); + /// Destructor + virtual ~ResourceCompiler(); - /** - * \brief Converts the specified resources into the specified source code file - * - * It iterates over all resources found in the local cache and stores their data - * and meta information as source code in the destination file. Thus parseInputFile() - * and loadBinaryData() have to be called first for this to work. - * - * \see parseInputFile - * \see loadBinaryData - */ - void compile(); + /** + * \brief Converts the specified resources into the specified source code file + * + * It iterates over all resources found in the local cache and stores their data + * and meta information as source code in the destination file. Thus parseInputFile() + * and loadBinaryData() have to be called first for this to work. + * + * \see parseInputFile + * \see loadBinaryData + */ + void compile(); private: - /** - * \brief Parses the specified input file - * - * After validating the resource specification file its contents are - * stored for later use. - * - * \see loadBinaryData - */ - void parseInputFile(); + /** + * \brief Parses the specified input file + * + * After validating the resource specification file its contents are + * stored for later use. + * + * \see loadBinaryData + */ + void parseInputFile(); - /** - * \brief Loads binary resource file data into the local cache - * - * This methods tries to open all resource files found by loadBinaryData() - * and copies their binary data into the local cache. - * - * \see parseInputFile - */ - void loadBinaryData(); + /** + * \brief Loads binary resource file data into the local cache + * + * This methods tries to open all resource files found by loadBinaryData() + * and copies their binary data into the local cache. + * + * \see parseInputFile + */ + void loadBinaryData(); - /// Path and filename of the resource specification file (source) - string m_ResourceSpecFile; + /// Path and filename of the resource specification file (source) + string m_ResourceSpecFile; - /// Path and filename of the converted source code file (destination) - string m_ResourceCodeFile; + /// Path and filename of the converted source code file (destination) + string m_ResourceCodeFile; - /// Mapping between logical and physical resource names - map<string, string> m_ResourceFileMap; + /// Mapping between logical and physical resource names + map<string, string> m_ResourceFileMap; - /// %Resource cache (identified by logical resource name) - map<string, vector<unsigned char> > m_ResourceDataMap; + /// %Resource cache (identified by logical resource name) + map<string, vector<unsigned char> > m_ResourceDataMap; }; /** diff --git a/src/orc/orc.cpp b/src/orc/orc.cpp index d4c65ee804fe480edca20f3415d4bc01da95fa01..505dd0f6a5ede1a73f12348fc6d02c086f2f2f6b 100644 --- a/src/orc/orc.cpp +++ b/src/orc/orc.cpp @@ -25,31 +25,31 @@ #include "ResourceCompiler.h" void printUsage() { - cerr << "Invalid command-line options!" << endl; - cerr << "Usage: orc <input filename> <output filename>" << endl; + cerr << "Invalid command-line options!" << endl; + cerr << "Usage: orc <input filename> <output filename>" << endl; } int main(int argc, char *argv[]) { - if(argc != 3) { - printUsage(); - exit(1); - } - else { - string inputFilename(argv[1]); - string outputFilename(argv[2]); - - // TODO: better filename checking - if( inputFilename == "." || inputFilename == ".." || - outputFilename == "." || outputFilename == "..") - { - printUsage(); - exit(1); - } - - ResourceCompiler rc(inputFilename, outputFilename); - rc.compile(); - - exit(0); - } + if(argc != 3) { + printUsage(); + exit(1); + } + else { + string inputFilename(argv[1]); + string outputFilename(argv[2]); + + // TODO: better filename checking + if( inputFilename == "." || inputFilename == ".." || + outputFilename == "." || outputFilename == "..") + { + printUsage(); + exit(1); + } + + ResourceCompiler rc(inputFilename, outputFilename); + rc.compile(); + + exit(0); + } }