| 1246 | } |
| 1247 | |
| 1248 | void Debugger::AppendStringKey(CStringA &aNameBuf, size_t aParentNameLength, const char *aName) |
| 1249 | { |
| 1250 | // " must be escape in some way to remove ambiguity. Currently the v1 method is used |
| 1251 | // since lexikos' version of SciTEDebug.ahk relies on it, and it isn't necessary to |
| 1252 | // match the v2 expression syntax. |
| 1253 | char c; |
| 1254 | const char *ccp; |
| 1255 | int extra = 4; // 4 for [""]. Also count double-quote marks: |
| 1256 | for (ccp = aName; *ccp; ++ccp) extra += *ccp=='"'; |
| 1257 | char *cp = aNameBuf.GetBufferSetLength(aParentNameLength + strlen(aName) + extra) + aParentNameLength; |
| 1258 | *cp++ = '['; |
| 1259 | *cp++ = '"'; |
| 1260 | for (ccp = aName; c = *ccp; ++ccp) |
| 1261 | { |
| 1262 | *cp++ = c; |
| 1263 | if (c == '"') |
| 1264 | *cp++ = '"'; // i.e. replace " with "" |
| 1265 | } |
| 1266 | *cp++ = '"'; |
| 1267 | *cp++ = ']'; |
| 1268 | aNameBuf.ReleaseBuffer(); |
| 1269 | } |
| 1270 | |
| 1271 | int Debugger::WritePropertyData(LPCTSTR aData, size_t aDataSize, int aMaxEncodedSize) |
| 1272 | // Accepts a "native" string, converts it to UTF-8, base64-encodes it and writes |
no test coverage detected