Definition at line 105 of file Message.cpp. 00105 { 00106 // put an escape sign in front of every delimeter 00107 string::size_type last_pos = 0; 00108 string::size_type pos = 0; 00109 do { 00110 if ( pos != 0 ) { 00111 last_pos = pos + DELIMETER.length(); 00112 } 00113 pos = myString.find(DELIMETER, last_pos); 00114 if (pos != string::npos) { 00115 myString.insert(pos, ESCAPE); 00116 } 00117 } while (pos != string::npos); 00118 // protect the real delimeter from being escaped by an ending escape sign here 00119 int elen = myString.length()-ESCAPE.length(); 00120 int mlen = myString.length()-MANUAL_ESCAPE_PROTECTION.length(); 00121 if ( ( elen >= 0 && myString.substr(elen).compare(ESCAPE)==0 ) || ( mlen >= 0 && myString.substr(mlen).compare(MANUAL_ESCAPE_PROTECTION)==0 ) ) { 00122 myString += MANUAL_ESCAPE_PROTECTION; 00123 } 00124 }
|
1.5.1