Convert Exiv2::ErrorCode into an enum class
This commit is contained in:
@@ -72,7 +72,7 @@ bool processLine(const std::string& line, int num, IptcData &iptcData)
|
||||
default:
|
||||
std::ostringstream os;
|
||||
os << "Unknown command (" << line.at(0) << ") at line " << num;
|
||||
throw Error(kerErrorMessage, os.str());
|
||||
throw Error(ErrorCode::kerErrorMessage, os.str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ void processAdd(const std::string& line, int num, IptcData &iptcData)
|
||||
dataStart == std::string::npos) {
|
||||
std::ostringstream os;
|
||||
os << "Invalid \'a\' command at line " << num;
|
||||
throw Error(kerErrorMessage, os.str());
|
||||
throw Error(ErrorCode::kerErrorMessage, os.str());
|
||||
}
|
||||
|
||||
std::string key(line.substr(keyStart, keyEnd-keyStart));
|
||||
@@ -105,7 +105,7 @@ void processAdd(const std::string& line, int num, IptcData &iptcData)
|
||||
|
||||
int rc = iptcData.add(iptcKey, value.get());
|
||||
if (rc) {
|
||||
throw Error(kerErrorMessage, "Iptc dataset already exists and is not repeatable");
|
||||
throw Error(ErrorCode::kerErrorMessage, "Iptc dataset already exists and is not repeatable");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void processRemove(const std::string& line, int num, IptcData &iptcData)
|
||||
if (keyStart == std::string::npos) {
|
||||
std::ostringstream os;
|
||||
os << "Invalid \'r\' command at line " << num;
|
||||
throw Error(kerErrorMessage, os.str());
|
||||
throw Error(ErrorCode::kerErrorMessage, os.str());
|
||||
}
|
||||
|
||||
const std::string key( line.substr(keyStart) );
|
||||
@@ -139,7 +139,7 @@ void processModify(const std::string& line, int num, IptcData &iptcData)
|
||||
dataStart == std::string::npos) {
|
||||
std::ostringstream os;
|
||||
os << "Invalid \'m\' command at line " << num;
|
||||
throw Error(kerErrorMessage, os.str());
|
||||
throw Error(ErrorCode::kerErrorMessage, os.str());
|
||||
}
|
||||
|
||||
std::string key(line.substr(keyStart, keyEnd-keyStart));
|
||||
@@ -161,7 +161,7 @@ void processModify(const std::string& line, int num, IptcData &iptcData)
|
||||
else {
|
||||
int rc = iptcData.add(iptcKey, value.get());
|
||||
if (rc) {
|
||||
throw Error(kerErrorMessage, "Iptc dataset already exists and is not repeatable");
|
||||
throw Error(ErrorCode::kerErrorMessage, "Iptc dataset already exists and is not repeatable");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user