modified signatures to allow it to pass compilation in XCode

This commit is contained in:
techdragon.nguyen@gmail.com
2011-10-15 19:32:00 +00:00
parent a1d278a140
commit 189351d82c
2 changed files with 12 additions and 10 deletions
+6 -5
View File
@@ -12,15 +12,16 @@ private:
string mName;
string mResult;
vector<string> mParams;
void parse(string& s);
string process(string& s);
void parse(const string& s);
string process(const string& s);
static vector<AutoLineMacro *> gAutoLineMacros;
static map<string, bool> gAutoLineMacrosIndex;
public:
AutoLineMacro(string& s);
AutoLineMacro(const string& s);
static void Destroy();
static bool AddMacro(string& s);
static string Process(string& s);
static bool AddMacro(const string& s);
static string Process(const string& s);
};
#endif
+6 -5
View File
@@ -10,13 +10,14 @@ using std::vector;
vector<AutoLineMacro *> AutoLineMacro::gAutoLineMacros;
map<string, bool> AutoLineMacro::gAutoLineMacrosIndex;
AutoLineMacro::AutoLineMacro(string& s)
AutoLineMacro::AutoLineMacro(const string& s)
{
parse(s);
}
void AutoLineMacro::parse(string& s)
void AutoLineMacro::parse(const string& stringMacro)
{
string s = stringMacro;
//we convert to lower, because the counterpart (auto strings) is converted to lower at parse time
std::transform(s.begin(), s.end(), s.begin(), ::tolower);
@@ -48,7 +49,7 @@ void AutoLineMacro::parse(string& s)
boost::replace_all(mResult, "\\n", "\n");
}
string AutoLineMacro::process(string& s)
string AutoLineMacro::process(const string& s)
{
string temp = s;
if (!mParams.size())
@@ -92,7 +93,7 @@ string AutoLineMacro::process(string& s)
}
bool AutoLineMacro::AddMacro(string& s)
bool AutoLineMacro::AddMacro(const string& s)
{
AutoLineMacro * alm = NEW AutoLineMacro(s);
if (gAutoLineMacrosIndex[alm->mName])
@@ -115,7 +116,7 @@ void AutoLineMacro::Destroy()
}
}
string AutoLineMacro::Process(string& s)
string AutoLineMacro::Process(const string& s)
{
string result = s;
for (size_t i = 0; i < gAutoLineMacros.size(); ++i)