Example #1
0
static NodeSmartReference Entity_create (EntityCreator& entityTable, EntityClass* entityClass, const KeyValues& keyValues)
{
	scene::Node& entity(entityTable.createEntity(entityClass));
	for (KeyValues::const_iterator i = keyValues.begin(); i != keyValues.end(); ++i) {
		Node_getEntity(entity)->setKeyValue((*i).first, (*i).second);
	}
	return NodeSmartReference(entity);
}
Example #2
0
std::string
Downloader::map_to_query(const KeyValues &key_values)
{
    if (key_values.size() == 0) {
        return std::string();
    }

    std::stringstream ss;
    for (KeyValues::const_iterator iter = key_values.begin();
            iter != key_values.end();
            ++iter) {
        ss << iter->first << "=" << iter->second << "&";
    }

    const std::string &temp = ss.str();
    return std::string(temp.begin(), temp.begin() + temp.size() - 1);
}