Exemplo n.º 1
0
XMLResourceNode XMLResourceDocument::get_resource(
	const std::string &resource_id) const
{
	XMLResourceNode node = impl->get_resource(resource_id);
	if (node.is_null())
		throw Exception(string_format("Resource not found: %1", resource_id));
	return node;
}
Exemplo n.º 2
0
XMLResourceNode XMLResourceDocument_Impl::get_resource(const std::string &resource_id) const
{
 	std::map<std::string, XMLResourceNode>::const_iterator it;
	it = resources.find(resource_id);
	if (it != resources.end())
		return it->second;

	std::vector<XMLResourceDocument>::size_type i;
	for (i = 0; i < additional_resources.size(); i++)
	{
		XMLResourceNode node = additional_resources[i].impl->get_resource(resource_id);
		if (!node.is_null())
			return node;
	}

	return XMLResourceNode();
}