| 2567 | } |
| 2568 | |
| 2569 | int Debugger::Buffer::WriteEncodeBase64(const char *aInput, size_t aInputSize, bool aSkipBufferSizeCheck/* = false*/) |
| 2570 | { |
| 2571 | if (aInputSize) |
| 2572 | { |
| 2573 | if (!aSkipBufferSizeCheck) |
| 2574 | { |
| 2575 | // Ensure required buffer space is available. |
| 2576 | if (ExpandIfNecessary(mDataUsed + DEBUGGER_BASE64_ENCODED_SIZE(aInputSize)) != DEBUGGER_E_OK) |
| 2577 | return DEBUGGER_E_INTERNAL_ERROR; |
| 2578 | } |
| 2579 | //else caller has already ensured there is enough space and wants to be absolutely sure mData isn't reallocated. |
| 2580 | ASSERT(mDataUsed + aInputSize < mDataSize); |
| 2581 | |
| 2582 | if (aInput) |
| 2583 | mDataUsed += Debugger::Base64Encode(mData + mDataUsed, aInput, aInputSize); |
| 2584 | //else caller wanted to reserve some buffer space, probably to read the raw data into. |
| 2585 | } |
| 2586 | //else there's nothing to write, just return OK. Calculations above can't handle (size_t)0 |
| 2587 | return DEBUGGER_E_OK; |
| 2588 | } |
| 2589 | |
| 2590 | // Decode a file URI in-place. |
| 2591 | void Debugger::DecodeURI(char *aUri) |
no outgoing calls
no test coverage detected