From 21715a03c7c47fa5ba9bfde4adf47bc6ad381623 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 3 May 2010 14:47:58 -0400 Subject: [PATCH] added c_escape() in TokenDefinition module --- TokenDefinition.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/TokenDefinition.cc b/TokenDefinition.cc index e77a53e..8835950 100644 --- a/TokenDefinition.cc +++ b/TokenDefinition.cc @@ -8,6 +8,18 @@ using namespace std; +static string c_escape(const string & orig) +{ + string result; + for (string::const_iterator it = orig.begin(); it != orig.end(); it++) + { + if (*it == '\\') + result += '\\'; + result += *it; + } + return result; +} + bool TokenDefinition::create(const string & name, const string & definition, const string & flags) {