| 457 | } |
| 458 | |
| 459 | void CtrlrProcessor::copyXmlToBinary (const XmlElement& xml, juce::MemoryBlock& destData) |
| 460 | { |
| 461 | const String xmlString (xml.createDocument ("", true, false)); |
| 462 | const int stringLength = (int)xmlString.getNumBytesAsUTF8(); |
| 463 | |
| 464 | destData.setSize ((size_t) stringLength + 10); |
| 465 | |
| 466 | char* const d = static_cast<char*> (destData.getData()); |
| 467 | *(uint32*) d = ByteOrder::swapIfBigEndian ((const uint32) magicXmlNumber); |
| 468 | *(uint32*) (d + 4) = ByteOrder::swapIfBigEndian ((const uint32) stringLength); |
| 469 | |
| 470 | xmlString.copyToUTF8 (d + 8, stringLength + 1); |
| 471 | } |
| 472 | |
| 473 | XmlElement* CtrlrProcessor::getXmlFromBinary (const void* data, const int sizeInBytes) |
| 474 | { |
nothing calls this directly
no test coverage detected