Fix name of wrapped arguments.

This commit is contained in:
Mikaël Capelle
2022-05-04 21:15:55 +02:00
parent 7c6bbc2980
commit 72750ab4de
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -83,9 +83,9 @@ namespace mo2::python {
MO2_PYBIND11_SHARED_CPP_HOLDER(MOBase::IPluginRequirement)
MO2_PYBIND11_SHARED_CPP_HOLDER(MOBase::ISaveGame)
MO2_PYBIND11_WRAP_ARGUMENT_CASTER(mo2::python::FileWrapper, QFileInfo,
std::filesystem::path, QString);
MO2_PYBIND11_WRAP_ARGUMENT_CASTER(mo2::python::DirectoryWrapper, QDir,
MO2_PYBIND11_WRAP_ARGUMENT_CASTER(mo2::python::FileWrapper, "FileWrapper", QFileInfo,
std::filesystem::path, QString);
MO2_PYBIND11_WRAP_ARGUMENT_CASTER(mo2::python::DirectoryWrapper, "DirectoryWrapper",
QDir, std::filesystem::path, QString);
#endif
@@ -126,11 +126,11 @@ namespace mo2::python {
} // namespace mo2::python
#define MO2_PYBIND11_WRAP_ARGUMENT_CASTER(Type, ...) \
#define MO2_PYBIND11_WRAP_ARGUMENT_CASTER(Type, Name, ...) \
namespace pybind11::detail { \
template <> \
struct type_caster<Type> { \
PYBIND11_TYPE_CASTER(Type, const_name(#Type)); \
PYBIND11_TYPE_CASTER(Type, const_name(Name)); \
bool load(handle src, bool convert) \
{ \
return mo2::python::detail::load_wrapped_argument_helper< \
+1 -1
View File
@@ -28,7 +28,7 @@ public:
operator std::string() const { return value; }
};
MO2_PYBIND11_WRAP_ARGUMENT_CASTER(Wrapper, int, std::string);
MO2_PYBIND11_WRAP_ARGUMENT_CASTER(Wrapper, "Wrapper", int, std::string);
template <std::size_t... Is, class Fn>
auto wrap(Fn&& fn)