Beispiel #1
0
string transform(const string& src, MapPtr& rule)
{
	auto des = rule->find(src);
	if (des != rule->end())
	{
		return des->second;
	}
	else
		return src;
}
Beispiel #2
0
int CustomerData::query(const std::string& customer, const std::string& stock) const
{
    MapPtr data = getData();
    Map::const_iterator entries = data->find(customer);
    std::cout << "CustomerData::query " << customer << ", " << stock << std::endl;
    if(entries != data->end())
    {
        return findEntry(entries->second, stock);
    }
    else
        return -1;
}