Exemplo n.º 1
0
void VValueBag::_ReadFromStream_v1( VStream *inStream)
{
	VStr31 name;

	VArrayString singleNames;
	singleNames.ReadFromStream( inStream);
	
	VIndex max_singlevalues = inStream->GetLong();
	for( VIndex i = 1 ; i <= max_singlevalues; i++)
	{
		sLONG value_kind = inStream->GetLong();
		VValue* temp_value = NewValueFromValueKind((ValueKind)value_kind);
		VValueSingle* temp_single_value = dynamic_cast<VValueSingle*>(temp_value);
		if (temp_single_value != NULL)
		{
			temp_single_value->ReadFromStream( inStream);
			
			singleNames.GetString( name, i);
			fAttributes.Append( name, *temp_single_value);
		}
		delete temp_value;
	}

	VArrayString				multipleNames;

	multipleNames.ReadFromStream( inStream);
	
	VIndex max_bag_array = inStream->GetLong();
	if (max_bag_array > 0)
	{
		fElements = new VPackedVBagArrayDictionary;
		for( VIndex j = 1 ; j <= max_bag_array ; j++)
		{
			VBagArray* bag_array = new VBagArray;
			bag_array->ReadFromStreamMinimal( inStream);
			multipleNames.GetString( name, j);
			if (fElements)
				fElements->Append( name, bag_array);
			bag_array->Release();
		}
	}
}
Exemplo n.º 2
0
bool VFolder::Contains( const XBOX::VString& inExtension) const
{
	bool found = false;

	VArrayString* files = GetContents(FF_NO_FOLDERS);
	if (files)
	{
		VString name;
		for (sLONG i = 1; i <= files->GetCount(); ++i)
		{
			files->GetString(name, i);
			if (name.EndsWith(inExtension))
			{
				found = true;
				break;
			}

		}
		delete files;
	}
	
	return found;
}