本文整理汇总了C++中IptcData::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ IptcData::erase方法的具体用法?C++ IptcData::erase怎么用?C++ IptcData::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IptcData
的用法示例。
在下文中一共展示了IptcData::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processRemove
void processRemove(const std::string& line, int num, IptcData &iptcData)
{
std::string::size_type keyStart = line.find_first_not_of(" \t", 1);
if (keyStart == std::string::npos) {
std::ostringstream os;
os << "Invalid \'r\' command at line " << num;
throw Error(1, os.str());
}
const std::string key( line.substr(keyStart) );
IptcKey iptcKey(key);
IptcData::iterator iter = iptcData.findKey(iptcKey);
if (iter != iptcData.end()) {
iptcData.erase(iter);
}
}
示例2: processRemove
void processRemove(const std::string& line, int num)
{
std::string::size_type keyStart = line.find_first_not_of(" \t", 1);
if (keyStart == std::string::npos) {
std::ostringstream os;
os << "Invalid \'r\' command at line " << num;
throw Error(os.str());
}
const std::string key( line.substr(keyStart) );
std::pair<uint16, uint16> p = IptcDataSets::decomposeKey(key);
if (p.first == 0xffff) throw Error("Invalid key" + key);
if (p.second == IptcDataSets::invalidRecord) throw Error("Invalid key" + key);
IptcData::iterator iter = g_iptcData.findId(p.first, p.second);
if (iter != g_iptcData.end()) {
g_iptcData.erase(iter);
}
}