mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 15:11:20 +02:00
- added another special variable (application path) that can be used for variable substituion in ini file values
This commit is contained in:
@@ -43,9 +43,13 @@ private:
|
||||
PropertyVector propertyVector;
|
||||
PropertyMap propertyMap;
|
||||
string path;
|
||||
static string applicationPath;
|
||||
|
||||
bool applyTagsToValue(string &value);
|
||||
public:
|
||||
static void setApplicationPath(string value) { applicationPath=value; }
|
||||
static string getApplicationPath() { return applicationPath; }
|
||||
|
||||
void clear();
|
||||
void load(const string &path);
|
||||
void save(const string &path);
|
||||
|
@@ -25,6 +25,8 @@ using namespace Shared::PlatformCommon;
|
||||
|
||||
namespace Shared{ namespace Util{
|
||||
|
||||
string Properties::applicationPath = "";
|
||||
|
||||
// =====================================================
|
||||
// class Properties
|
||||
// =====================================================
|
||||
@@ -101,6 +103,9 @@ bool Properties::applyTagsToValue(string &value) {
|
||||
replaceAll(value, "$USERNAME", (username != NULL ? username : ""));
|
||||
replaceAll(value, "%%USERNAME%%", (username != NULL ? username : ""));
|
||||
|
||||
replaceAll(value, "$APPLICATIONPATH", Properties::applicationPath);
|
||||
replaceAll(value, "%%APPLICATIONPATH%%", Properties::applicationPath);
|
||||
|
||||
return (originalValue != value);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user