예제 #1
0
string transform(const string& src, MapPtr& rule)
{
	auto des = rule->find(src);
	if (des != rule->end())
	{
		return des->second;
	}
	else
		return src;
}
예제 #2
0
파일: Customer.cpp 프로젝트: szqh97/test
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;
}