本文整理汇总了C++中MemoryBlock::loadFromHexString方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryBlock::loadFromHexString方法的具体用法?C++ MemoryBlock::loadFromHexString怎么用?C++ MemoryBlock::loadFromHexString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryBlock
的用法示例。
在下文中一共展示了MemoryBlock::loadFromHexString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createFromHexData
const MidiMessage createFromHexData (const String &hexData)
{
MemoryBlock bl;
bl.loadFromHexString(hexData);
return (MidiMessage ((uint8*)bl.getData(), (int)bl.getSize()));
}
示例2: sizeof
Uuid& Uuid::operator= (const String& uuidString)
{
MemoryBlock mb;
mb.loadFromHexString (uuidString);
mb.ensureSize (sizeof (uuid), true);
mb.copyTo (uuid, 0, sizeof (uuid));
return *this;
}
示例3: hexString
const String CtrlrMidiBufferStatus::hexString(const String &hex)
{
String ret;
MemoryBlock mb;
mb.loadFromHexString (hex);
uint8 *ptr = (uint8*)mb.getData();
for (size_t i=0; i<mb.getSize(); i++)
{
const String bis = BigInteger (*(ptr+i)).toString(2, 8);
ret << String::formatted ("[0x%.2x/%.3d/", *(ptr+i), *(ptr+i)) << bis.substring(0,4) << ":" << bis.substring(4,8) << "] ";
}
return (ret.trim());
}
示例4: loadTextFile
void CtrlrMIDIBuffer::loadTextFile(const File fileToOpen)
{
if (fileToOpen == File::nonexistent)
{
lastFile = browseForFile("*.syx;*.bin;*.dat;*.*");
}
else
{
lastFile = fileToOpen;
}
MemoryBlock data;
data.loadFromHexString (lastFile.loadFileAsString());
reloadEditor (lastFile.loadFileAsString(), true);
}
示例5: decrypt
String EncryptedString::decrypt (const String& encryptedString, const String& privateKey, bool inputIsHex)
{
RSAKey rsaKey (privateKey);
MemoryBlock encryptedMemoryBlock;
if (inputIsHex)
{
encryptedMemoryBlock.loadFromHexString (encryptedString);
}
else
{
encryptedMemoryBlock.fromBase64Encoding (encryptedString);
}
BigInteger stringAsData;
stringAsData.loadFromMemoryBlock (encryptedMemoryBlock);
rsaKey.applyToValue (stringAsData);
return stringAsData.toMemoryBlock().toString();
}
示例6: getData
MemoryBlock CtrlrMIDIBuffer::getData()
{
MemoryBlock bl;
bl.loadFromHexString (document.getAllContent());
return (bl);
}
示例7: getDataLengthFromFormula
size_t CtrlrMIDITransaction::getDataLengthFromFormula(const String &formula)
{
MemoryBlock bl;
bl.loadFromHexString (formula);
return (bl.getSize());
}