updated c_escape(); added TokenDefinition::getCString()
This commit is contained in:
parent
7756bd696b
commit
31c35a9335
@ -13,7 +13,7 @@ static string c_escape(const string & orig)
|
||||
string result;
|
||||
for (string::const_iterator it = orig.begin(); it != orig.end(); it++)
|
||||
{
|
||||
if (*it == '\\')
|
||||
if (*it == '\\' || *it == '"')
|
||||
result += '\\';
|
||||
result += *it;
|
||||
}
|
||||
@ -37,3 +37,8 @@ bool TokenDefinition::create(const string & name,
|
||||
pcre_free(re);
|
||||
return true;
|
||||
}
|
||||
|
||||
string TokenDefinition::getCString() const
|
||||
{
|
||||
return c_escape(m_definition);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ class TokenDefinition
|
||||
public:
|
||||
bool create(const std::string & name,
|
||||
const std::string & definition, const std::string & flags);
|
||||
std::string getCString() const;
|
||||
|
||||
protected:
|
||||
std::string m_name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user