コード例 #1
0
void KeyedArchiver::EncodeVariant(const String & key, const VariantType & value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    value.Write(archive);
}
コード例 #2
0
void KeyedArchiver::EncodeWideString(const String & key, const WideString & value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    VariantType valueMT;
    valueMT.SetWideString(value);
    valueMT.Write(archive);
}
コード例 #3
0
void KeyedArchiver::EncodeFloat(const String & key, float32 value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    VariantType valueMT;
    valueMT.SetFloat(value);
    valueMT.Write(archive);
}
コード例 #4
0
void KeyedArchiver::EncodeInt32(const String & key, int32 value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    VariantType valueMT;
    valueMT.SetInt32(value);
    valueMT.Write(archive);
}
コード例 #5
0
void KeyedArchiver::EncodeBool(const String & key, bool value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    VariantType valueMT;
    valueMT.SetBool(value);
    valueMT.Write(archive);
}
コード例 #6
0
bool KeyedArchive::Save(File *archive)
{
	for (Map<String, VariantType>::iterator it = objectMap.begin(); it != objectMap.end(); ++it)
	{
		VariantType key;
		key.SetString(it->first);
		key.Write(archive);
		it->second.Write(archive);
	}
	return true;
}
コード例 #7
0
ファイル: KeyedArchive.cpp プロジェクト: galek/dava.framework
bool KeyedArchive::Save(File *archive)
{
    char header[2];
    uint16 version = 1;
    header[0] = 'K'; header[1] = 'A';
    
    archive->Write(header, 2);
    archive->Write(&version, 2);
    uint32 size = objectMap.size();
    archive->Write(&size, 4);
    
	for (Map<String, VariantType*>::iterator it = objectMap.begin(); it != objectMap.end(); ++it)
	{
		VariantType key;
		key.SetString(it->first);
		key.Write(archive);
		it->second->Write(archive);
	}
	return true;
}