clintbellanger/flare-engine — pull request #637 by stefanbeller (2013-04-27 19:44:00+00:00)
Title: Modmanagement

This implements the core idea of #624
Closes #624

The API of the FileParser was changed to allow a very wide range of open requests.
This includes reading the last located file, or all of the located files.
The location of the files is optional as the saving and loading operates on direct absolute pathes and doesn't need to be located.

This pull request has been tested (i.e. enabling the minicore, checking attributes all over the place and such) and seems to not change any visible behaviors as of now.
This works and can be pulled in this state, but I'll maybe amend some more fixes to remove more redundant code for the Mod management.

```
/**
* @brief open
* @param filename
* The generic filename to be opened. This generic filename will be located
* by the ModManager.
* If this is a directory, all files in this directory will be opened.
*
* @param errormessage
* Optional parameter, will be printed to stderr together with the filename
* if an error occurs. If errormessage is empty, there will be no output to
* stderr in any case.
*
* @param locateFileName
* If this parameter is set to true, the filename will not be interpreted as
* a generic locatable filename and the ModManager is used to locate the
* actual filename before opening the file. It is true by default.
* If this is set to false, then the filename is interpreted as is.
*
* @param stopAfterFirstFile
* If this is set, the newest file is being read. This is the default.
* If it is set to false, all possible files are parsed and delivered as
* one big stream. Also if using direct directory pathes, these will be
* expanded and parsed.
*
* @return true if file could be opened successfully for reading.
*/
bool FileParser::open(const std::string& filename,
bool locateFileName = true,
bool stopAfterFirstFile = true,
const std::string &errormessage = "Could not open text file");
```