void Message::unescapeString ( string &  myString  )  [static, private]

Definition at line 127 of file Message.cpp.

00127                                              {
00128         const string ESCAPED_DELIMETER = ESCAPE + DELIMETER;
00129         // remove all the escape signs in front of delimeters
00130         string::size_type last_pos = 0;
00131         string::size_type pos = 0;
00132         do {
00133                 if ( pos != 0 ) {
00134                                         last_pos = pos + DELIMETER.length();
00135                 }
00136                 pos = myString.find(ESCAPED_DELIMETER, last_pos);
00137                 if (pos != string::npos) {
00138                         myString.erase(pos, ESCAPE.length());
00139                 }
00140         } while (pos != string::npos);
00141         // remove the manual escape protection if one was added
00142         const string PROTECTED_ESCAPE = ESCAPE + MANUAL_ESCAPE_PROTECTION;
00143         const string PROTECTED_PROTECTION = MANUAL_ESCAPE_PROTECTION + MANUAL_ESCAPE_PROTECTION;
00144         int elen = myString.length()-PROTECTED_ESCAPE.length();
00145         int plen = myString.length()-PROTECTED_PROTECTION.length();
00146         if ( ( elen >= 0 && myString.substr(elen).compare(PROTECTED_ESCAPE)==0 ) || ( plen >= 0 && myString.substr(plen).compare(PROTECTED_PROTECTION)==0 ) ) {
00147                 myString.erase(myString.length()-MANUAL_ESCAPE_PROTECTION.length(),MANUAL_ESCAPE_PROTECTION.length());
00148         }
00149 }


Generated on Wed Jun 25 14:47:10 2008 for keyvil by  doxygen 1.5.1