MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / fromBase64Encoding

Method fromBase64Encoding

JUCE/modules/juce_core/memory/juce_MemoryBlock.cpp:379–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377};
378
379bool MemoryBlock::fromBase64Encoding (StringRef s)
380{
381 auto dot = CharacterFunctions::find (s.text, (juce_wchar) '.');
382
383 if (dot.isEmpty())
384 return false;
385
386 auto numBytesNeeded = String (s.text, dot).getIntValue();
387
388 setSize ((size_t) numBytesNeeded, true);
389
390 auto srcChars = dot + 1;
391 int pos = 0;
392
393 for (;;)
394 {
395 auto c = (int) srcChars.getAndAdvance();
396
397 if (c == 0)
398 return true;
399
400 c -= 43;
401
402 if (isPositiveAndBelow (c, numElementsInArray (base64DecodingTable)))
403 {
404 setBitRange ((size_t) pos, 6, base64DecodingTable[c]);
405 pos += 6;
406 }
407 }
408}
409
410} // namespace juce

Callers 7

initialiseMethod · 0.80
importResourceMethod · 0.80
loadMethod · 0.80
reloadPluginStateFunction · 0.80
setFromXmlAttributesMethod · 0.80
createNodeFromXmlMethod · 0.80

Calls 8

findFunction · 0.85
setSizeFunction · 0.85
isPositiveAndBelowFunction · 0.85
numElementsInArrayFunction · 0.85
StringFunction · 0.50
isEmptyMethod · 0.45
getIntValueMethod · 0.45
getAndAdvanceMethod · 0.45

Tested by

no test coverage detected