Commit 4d5cb812 authored by Oliver Bock's avatar Oliver Bock
Browse files

Improved indentation

parent 5f1e7c3e
......@@ -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;
};
/**
......
......@@ -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);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment