std::to_string conversions

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 3 years ago
parent 10a62b2350
commit b6c2062fae

@ -926,7 +926,7 @@ int Extract::writeIccProfile(const std::string& target) const {
} // Extract::writeIccProfile
void Extract::writePreviewFile(const Exiv2::PreviewImage& pvImg, size_t num) const {
std::string pvFile = newFilePath(path_, "-preview") + Exiv2::toString(num);
std::string pvFile = newFilePath(path_, "-preview") + std::to_string(num);
std::string pvPath = pvFile + pvImg.extension();
if (dontOverwrite(pvPath))
return;

@ -1323,14 +1323,14 @@ bool parseLine(ModifyCmd& modifyCmd, const std::string& line, int num) {
}
#endif
throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage,
Exiv2::toString(num) + ": " + _("Invalid command line:") + cmdLine);
std::to_string(num) + ": " + _("Invalid command line:") + cmdLine);
}
std::string cmd(line.substr(cmdStart, cmdEnd - cmdStart));
CmdId cmdId = commandId(cmd);
if (cmdId == CmdId::invalid) {
throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage,
Exiv2::toString(num) + ": " + _("Invalid command") + " `" + cmd + "'");
std::to_string(num) + ": " + _("Invalid command") + " `" + cmd + "'");
}
Exiv2::TypeId defaultType = Exiv2::invalidTypeId;
@ -1361,7 +1361,7 @@ bool parseLine(ModifyCmd& modifyCmd, const std::string& line, int num) {
}
if (metadataId == MetadataId::invalid) {
throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage,
Exiv2::toString(num) + ": " + _("Invalid key") + " `" + key + "'");
std::to_string(num) + ": " + _("Invalid key") + " `" + key + "'");
}
}
std::string value;
@ -1382,7 +1382,7 @@ bool parseLine(ModifyCmd& modifyCmd, const std::string& line, int num) {
if (cmdId == CmdId::reg && (keyEnd == std::string::npos || valStart == std::string::npos)) {
throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage,
Exiv2::toString(num) + ": " + _("Invalid command line") + " ");
std::to_string(num) + ": " + _("Invalid command line") + " ");
}
if (cmdId != CmdId::reg && typeStart != std::string::npos && typeEnd != std::string::npos) {
@ -1392,7 +1392,7 @@ bool parseLine(ModifyCmd& modifyCmd, const std::string& line, int num) {
valStart = line.find_first_not_of(delim, typeEnd + 1);
if (valStart == std::string::npos) {
throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage,
Exiv2::toString(num) + ": " + _("Invalid command line") + " ");
std::to_string(num) + ": " + _("Invalid command line") + " ");
}
type = tmpType;
explicitType = true;
@ -1418,7 +1418,7 @@ bool parseLine(ModifyCmd& modifyCmd, const std::string& line, int num) {
if (cmdId == CmdId::reg) {
if (value.empty()) {
throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage,
Exiv2::toString(num) + ": " + _("Empty value for key") + +" `" + key + "'");
std::to_string(num) + ": " + _("Empty value for key") + +" `" + key + "'");
}
// Registration needs to be done immediately as the new namespaces are

@ -29,7 +29,7 @@ int main(int argc, char* const argv[]) try {
<< "\n";
Exiv2::PreviewImage preview = loader.getPreviewImage(pos);
auto s = preview.writeFile(filename + "_" + Exiv2::toString(pos.width_) + "x" + Exiv2::toString(pos.height_));
auto s = preview.writeFile(filename + "_" + std::to_string(pos.width_) + "x" + std::to_string(pos.height_));
if (s == 0)
return EXIT_FAILURE;
}

@ -947,7 +947,7 @@ void Converter::cnvXmpDate(const char* from, const char* to) {
}
if (subsecTag) {
prepareExifTarget(subsecTag, true);
(*exifData_)[subsecTag] = toString(datetime.nanoSecond);
(*exifData_)[subsecTag] = std::to_string(datetime.nanoSecond);
}
}
} else { // "Exif.GPSInfo.GPSTimeStamp"

@ -165,7 +165,7 @@ void Error::setMsg(int count) {
std::string msg{errList.at(static_cast<size_t>(code_))};
auto pos = msg.find("%0");
if (pos != std::string::npos) {
msg.replace(pos, 2, toString(static_cast<int>(code_)));
msg.replace(pos, 2, std::to_string(static_cast<int>(code_)));
}
if (count > 0) {
pos = msg.find("%1");

@ -3328,7 +3328,7 @@ std::ostream& Nikon3MakerNote::print0x009e(std::ostream& os, const Value& value,
if (td) {
s = std::string(exvGettext(td->label_)).append(d).append(s);
} else {
s = std::string(_("Unknown")).append(" (").append(toString(l)).append(")").append(d).append(s);
s = std::string(_("Unknown")).append(" (").append(std::to_string(l)).append(")").append(d).append(s);
}
}
return os << s;

@ -954,7 +954,7 @@ DataBuf makePnm(size_t width, size_t height, const DataBuf& rgb) {
return {};
}
const std::string header = "P6\n" + toString(width) + " " + toString(height) + "\n255\n";
const std::string header = "P6\n" + std::to_string(width) + " " + std::to_string(height) + "\n255\n";
const auto headerBytes = reinterpret_cast<const byte*>(header.data());
DataBuf dest(header.size() + rgb.size());

Loading…
Cancel
Save