MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / AppendStringKey

Method AppendStringKey

source/Debugger.cpp:1248–1269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1246}
1247
1248void 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
1271int Debugger::WritePropertyData(LPCTSTR aData, size_t aDataSize, int aMaxEncodedSize)
1272// Accepts a "native" string, converts it to UTF-8, base64-encodes it and writes

Callers 1

WritePropertyMethod · 0.80

Calls 1

GetBufferSetLengthMethod · 0.80

Tested by

no test coverage detected