Write data into the buffer, expanding it as necessary.
| 2395 | |
| 2396 | // Write data into the buffer, expanding it as necessary. |
| 2397 | int Debugger::Buffer::Write(char *aData, size_t aDataSize) |
| 2398 | { |
| 2399 | if (mFailed) // See WriteF() for comments. |
| 2400 | return DEBUGGER_E_INTERNAL_ERROR; |
| 2401 | |
| 2402 | if (aDataSize == -1) |
| 2403 | aDataSize = strlen(aData); |
| 2404 | |
| 2405 | if (aDataSize == 0) |
| 2406 | return DEBUGGER_E_OK; |
| 2407 | |
| 2408 | if (ExpandIfNecessary(mDataUsed + aDataSize) != DEBUGGER_E_OK) |
| 2409 | return DEBUGGER_E_INTERNAL_ERROR; |
| 2410 | |
| 2411 | memcpy(mData + mDataUsed, aData, aDataSize); |
| 2412 | mDataUsed += aDataSize; |
| 2413 | return DEBUGGER_E_OK; |
| 2414 | } |
| 2415 | |
| 2416 | // Write formatted data into the buffer. Supports %s (char*), %e (char*, "&'<> escaped), %i (int), %u (unsigned int), %p (UINT_PTR). |
| 2417 | int Debugger::Buffer::WriteF(const char *aFormat, ...) |
no outgoing calls
no test coverage detected