Exemplo n.º 1
0
bool RegHelper::DeleteKeyValue(HKEY hKeyRoot, LPCTSTR lpSubKey, LPCTSTR lpValue)
{

	HKEY hKey;
	LONG lResult;
	DWORD dwp = REG_OPENED_EXISTING_KEY;

	lResult = ::RegCreateKeyEx(hKeyRoot, lpSubKey, 0, NULL,\
		REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,  &hKey, &dwp);

	if (lResult!=ERROR_SUCCESS)
		return false;

	if (!IsKeyExists(hKey, lpValue))	return true;

	lResult = ::RegDeleteValue(hKey, lpValue);

	if (lResult!=ERROR_SUCCESS)
	{
		::RegCloseKey(hKey);
		return false;
	}

	::RegCloseKey(hKey);
	return true;
}
Exemplo n.º 2
0
VariantType * KeyedArchive::GetVariant(const String & key)
{
	if(IsKeyExists(key))
		return objectMap[key];

	return NULL;
}
Exemplo n.º 3
0
void CIFXMetaData::AppendX(IFXMetaDataX* pSource)
{
	IFXString sKey, sEncodedKey, sValue;
	U32 srcCount, srcIndex, srcSize, dstIndex;
	IFXMetaDataAttribute srcType;
	U8* pBuffer;
	IFXRESULT rc;
	BOOL Persistance = true;
	
	IFXCHECKX_RESULT( pSource, IFX_E_NOT_INITIALIZED );
	pSource->GetCountX(srcCount);
	
	for (srcIndex = 0; srcIndex < srcCount; srcIndex++) {
		pSource->GetKeyX(srcIndex, sKey);
		pSource->GetEncodedKeyX(srcIndex, sEncodedKey);
		pSource->GetAttributeX(srcIndex, srcType);

		if (IsKeyExists(sKey)) {
			rc = GetIndex(sKey, dstIndex);
			IFXCHECKX_RESULT( IFXSUCCESS( rc ), IFX_E_NO_METADATA );
			DeleteX(dstIndex);
		}

		if (srcType & IFXMETADATAATTRIBUTE_BINARY) {
			pSource->GetBinarySizeX(srcIndex, srcSize);
			pBuffer = (U8*)new U8[srcSize];
			IFXCHECKX_RESULT( pBuffer, IFX_E_NOT_INITIALIZED );
			pSource->GetBinaryX(srcIndex, pBuffer);
			SetBinaryValueX(sEncodedKey, srcSize, pBuffer);
			delete [] pBuffer;
		} else {
			pSource->GetStringX(srcIndex, sValue);
			SetStringValueX(sEncodedKey, sValue);
		}
		GetIndex(sKey, dstIndex);
		SetAttributeX(dstIndex, srcType);

		pSource->GetPersistenceX(srcIndex, Persistance);
		rc = GetIndex(sKey, dstIndex);
		IFXCHECKX_RESULT(IFXSUCCESS( rc ), IFX_E_NO_METADATA);
		SetPersistenceX(dstIndex, Persistance);
	}
}
Exemplo n.º 4
0
Matrix4 KeyedArchive::GetMatrix4(const String & key, const Matrix4 & defaultValue )
{
    if (IsKeyExists(key))
        return objectMap[key]->AsMatrix4();
    return defaultValue;
}
Exemplo n.º 5
0
Vector3 KeyedArchive::GetVector3(const String & key, const Vector3 & defaultValue )
{
    if (IsKeyExists(key))
        return objectMap[key]->AsVector3();
    return defaultValue;
}
Exemplo n.º 6
0
uint64 KeyedArchive::GetUInt64(const String & key, uint64 defaultValue)
{
    if (IsKeyExists(key))
        return objectMap[key]->AsUInt64();
    return defaultValue;
}
Exemplo n.º 7
0
KeyedArchive * KeyedArchive::GetArchive(const String & key, KeyedArchive * defaultValue)
{
	if (IsKeyExists(key))
		return objectMap[key]->AsKeyedArchive();
	return defaultValue;
}
Exemplo n.º 8
0
int32 KeyedArchive::GetByteArraySize(const String & key, int32 defaultValue)
{
	if (IsKeyExists(key))
		return objectMap[key]->AsByteArraySize();
	return defaultValue;
}
Exemplo n.º 9
0
const uint8 *KeyedArchive::GetByteArray(const String & key, const uint8 *defaultValue)
{
	if (IsKeyExists(key))
		return objectMap[key]->AsByteArray();
	return defaultValue;
}
Exemplo n.º 10
0
FastName KeyedArchive::GetFastName(const String & key, const FastName & defaultValue)
{
    if (IsKeyExists(key))
        return objectMap[key]->AsFastName();
    return defaultValue;
}
Exemplo n.º 11
0
WideString KeyedArchive::GetWideString(const String & key, const WideString & defaultValue)
{
	if (IsKeyExists(key))
		return objectMap[key]->AsWideString();
	return defaultValue;
}
Exemplo n.º 12
0
float32 KeyedArchive::GetFloat(const String & key, float32 defaultValue)
{
	if (IsKeyExists(key))
		return objectMap[key]->AsFloat();
	return defaultValue;
}
Exemplo n.º 13
0
int32 KeyedArchive::GetInt32(const String & key, int32 defaultValue)
{
	if (IsKeyExists(key))
		return objectMap[key]->AsInt32();
	return defaultValue;
}
Exemplo n.º 14
0
bool KeyedArchive::GetBool(const String & key, bool defaultValue)
{
	if (IsKeyExists(key))
		return objectMap[key]->AsBool();
	return defaultValue;
}