Skip to content

Commit b0c72e9

Browse files
committed
[???] Replace usage of boost::format with fmt
1 parent fd9076d commit b0c72e9

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

include/irods/private/re/python.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include <boost/any.hpp>
99
#include <boost/optional.hpp>
10-
#include <boost/format.hpp>
1110
#include <boost/core/demangle.hpp>
1211

1312
#include <irods/irods_re_serialization.hpp>
@@ -31,6 +30,8 @@
3130
#include <boost/python.hpp>
3231
#pragma GCC diagnostic pop
3332

33+
#include <fmt/format.h>
34+
3435
#include "irods/private/re/python/irods_types.hpp"
3536
#include "irods/private/re/python/irods_errors.hpp"
3637
#include "irods/private/re/python/types/array_ref.hpp"
@@ -139,7 +140,7 @@ namespace
139140
// clang-format on
140141
}
141142
else {
142-
THROW(SYS_NOT_SUPPORTED, boost::format("Unknown type in msParam: [%s]") % msParam.type);
143+
THROW(SYS_NOT_SUPPORTED, fmt::format("Unknown type in msParam: [{0}]", msParam.type));
143144
}
144145
}
145146

@@ -404,8 +405,8 @@ void update_argument(boost::any& cpp_arg, boost::python::object& py_arg)
404405
}
405406
catch (const std::out_of_range&) {
406407
//THROW(SYS_NOT_SUPPORTED,
407-
// boost::format("Attempted to extract from a boost::python::object containing an "
408-
// "unsupported type: %s") % boost::core::scoped_demangled_name{cpp_arg.type().name()}.get());
408+
// fmt::format("Attempted to extract from a boost::python::object containing an "
409+
// "unsupported type: {0}", boost::core::scoped_demangled_name{cpp_arg.type().name()}.get()));
409410
}
410411
catch (const boost::bad_any_cast&) {
411412
THROW(SYS_NOT_SUPPORTED, "Failed any_cast when updating boost::any from boost:python::object");
@@ -430,8 +431,8 @@ boost::python::object object_from_any(boost::any& arg)
430431
}
431432
else {
432433
THROW(SYS_NOT_SUPPORTED,
433-
boost::format("Attempted to create a boost::python::object from a boost::any containing an "
434-
"unsupported type: %s") % boost::core::scoped_demangled_name{arg.type().name()}.get());
434+
fmt::format("Attempted to create a boost::python::object from a boost::any containing an "
435+
"unsupported type: {0}", boost::core::scoped_demangled_name{arg.type().name()}.get()));
435436
}
436437
}
437438
catch (const boost::bad_any_cast&) {

src/types/irods/objInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
#include <boost/python/class.hpp>
2323
#include <boost/python/enum.hpp>
2424
#pragma GCC diagnostic pop
25-
#include <boost/format.hpp>
25+
26+
#include <fmt/format.h>
2627

2728
namespace bp = boost::python;
2829

@@ -98,7 +99,7 @@ namespace irods::re::python::types
9899
return std::string{s->value[i]};
99100
}
100101
}
101-
PyErr_SetString(PyExc_KeyError, (boost::format{"%s was not found in the list of keys."} % key).str().c_str());
102+
PyErr_SetString(PyExc_KeyError, fmt::format("{0} was not found in the list of keys.", key).c_str());
102103
bp::throw_error_already_set();
103104
return std::string{};
104105
})

0 commit comments

Comments
 (0)