remove stringFormat from Error()

No need.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 2 years ago
parent 2865a317f3
commit b1225ca9dc

@ -1420,7 +1420,7 @@ int64_t HttpIo::HttpImpl::getFileLength() {
request["verb"] = "HEAD";
int serverCode = http(request, response, errors);
if (serverCode < 0 || serverCode >= 400 || !errors.empty()) {
throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), hostInfo_.Path);
throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, hostInfo_.Path);
}
auto lengthIter = response.find("Content-Length");
@ -1444,7 +1444,7 @@ void HttpIo::HttpImpl::getDataByRange(size_t lowBlock, size_t highBlock, std::st
int serverCode = http(request, responseDic, errors);
if (serverCode < 0 || serverCode >= 400 || !errors.empty()) {
throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), hostInfo_.Path);
throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, hostInfo_.Path);
}
response = responseDic["body"];
}
@ -1497,7 +1497,7 @@ void HttpIo::HttpImpl::writeRemote(const byte* data, size_t size, size_t from, s
int serverCode = http(request, response, errors);
if (serverCode < 0 || serverCode >= 400 || !errors.empty()) {
throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), hostInfo_.Path);
throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, hostInfo_.Path);
}
}
@ -1594,7 +1594,7 @@ int64_t CurlIo::CurlImpl::getFileLength() {
int serverCode;
curl_easy_getinfo(curl_, CURLINFO_RESPONSE_CODE, &serverCode); // get code
if (serverCode >= 400 || serverCode < 0) {
throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), path_);
throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, path_);
}
// get length
curl_off_t temp;
@ -1628,7 +1628,7 @@ void CurlIo::CurlImpl::getDataByRange(size_t lowBlock, size_t highBlock, std::st
int serverCode;
curl_easy_getinfo(curl_, CURLINFO_RESPONSE_CODE, &serverCode); // get code
if (serverCode >= 400 || serverCode < 0) {
throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), path_);
throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, path_);
}
}
@ -1676,7 +1676,7 @@ void CurlIo::CurlImpl::writeRemote(const byte* data, size_t size, size_t from, s
int serverCode;
curl_easy_getinfo(curl_, CURLINFO_RESPONSE_CODE, &serverCode);
if (serverCode >= 400 || serverCode < 0) {
throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), path_);
throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, path_);
}
}

@ -71,11 +71,11 @@ void RafImage::printStructure(std::ostream& out, PrintStructureOption option, si
if (bPrint) {
io_->seek(0, BasicIo::beg); // rewind
size_t address = io_->tell();
const auto format = " %8zu | %8ld | ";
constexpr auto format = " %8zu | %8ld | ";
{
out << Internal::indent(depth) << "STRUCTURE OF RAF FILE: " << io().path() << std::endl;
out << Internal::indent(depth) << Internal::stringFormat(" Address | Length | Payload") << std::endl;
out << Internal::indent(depth) << " Address | Length | Payload" << std::endl;
}
byte magicdata[17];

@ -419,7 +419,7 @@ void WebPImage::printStructure(std::ostream& out, PrintStructureOption option, s
if (bPrint) {
out << Internal::indent(depth) << "STRUCTURE OF WEBP FILE: " << io().path() << std::endl;
out << Internal::indent(depth) << Internal::stringFormat(" Chunk | Length | Offset | Payload") << std::endl;
out << Internal::indent(depth) << " Chunk | Length | Offset | Payload" << std::endl;
}
io_->seek(0, BasicIo::beg); // rewind

Loading…
Cancel
Save