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 mName;
string mResult; string mResult;
vector<string> mParams; vector<string> mParams;
void parse(string& s); void parse(const string& s);
string process(string& s); string process(const string& s);
static vector<AutoLineMacro *> gAutoLineMacros; static vector<AutoLineMacro *> gAutoLineMacros;
static map<string, bool> gAutoLineMacrosIndex; static map<string, bool> gAutoLineMacrosIndex;
public: public:
AutoLineMacro(string& s); AutoLineMacro(const string& s);
static void Destroy(); static void Destroy();
static bool AddMacro(string& s); static bool AddMacro(const string& s);
static string Process(string& s); static string Process(const string& s);
}; };
#endif #endif
+6 -5
View File
@@ -10,13 +10,14 @@ using std::vector;
vector<AutoLineMacro *> AutoLineMacro::gAutoLineMacros; vector<AutoLineMacro *> AutoLineMacro::gAutoLineMacros;
map<string, bool> AutoLineMacro::gAutoLineMacrosIndex; map<string, bool> AutoLineMacro::gAutoLineMacrosIndex;
AutoLineMacro::AutoLineMacro(string& s) AutoLineMacro::AutoLineMacro(const string& s)
{ {
parse(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 //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); std::transform(s.begin(), s.end(), s.begin(), ::tolower);
@@ -48,7 +49,7 @@ void AutoLineMacro::parse(string& s)
boost::replace_all(mResult, "\\n", "\n"); boost::replace_all(mResult, "\\n", "\n");
} }
string AutoLineMacro::process(string& s) string AutoLineMacro::process(const string& s)
{ {
string temp = s; string temp = s;
if (!mParams.size()) 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); AutoLineMacro * alm = NEW AutoLineMacro(s);
if (gAutoLineMacrosIndex[alm->mName]) 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; string result = s;
for (size_t i = 0; i < gAutoLineMacros.size(); ++i) for (size_t i = 0; i < gAutoLineMacros.size(); ++i)