static String getValue (const String& regValuePath, const String& defaultValue, DWORD wow64Flags) { MemoryBlock buffer; switch (getBinaryValue (regValuePath, buffer, wow64Flags)) { case REG_SZ: return static_cast <const WCHAR*> (buffer.getData()); case REG_DWORD: return String ((int) *reinterpret_cast<const DWORD*> (buffer.getData())); default: break; } return defaultValue; }
ByteArray AbstractField::getBinaryValue() { return getBinaryValue(ByteArray()); }
/// Constructs a value copied into long-lived pooled memory (or the heap) /// that will require an explicit NValue::free. /// Assumes hex-encoded input static inline NValue getBinaryValue(const std::string& value) { size_t rawLength = value.length() / 2; unsigned char rawBuf[rawLength]; hexDecodeToBinary(rawBuf, value.c_str()); return getBinaryValue(rawBuf, (int32_t)rawLength); }