diff --git a/py/py_byml.cpp b/py/py_byml.cpp index c6cf5de..7235af5 100644 --- a/py/py_byml.cpp +++ b/py/py_byml.cpp @@ -97,7 +97,7 @@ void BindByml(py::module& parent) { m.def("get_float", BorrowByml(&Byml::GetFloat), "data"_a); m.def("get_int", BorrowByml(&Byml::GetInt), "data"_a); m.def("get_int64", BorrowByml(&Byml::GetInt64), "data"_a); - m.def("get_string", BorrowByml(&Byml::GetString), "data"_a); + m.def("get_string", BorrowByml(py::overload_cast<>(&Byml::GetString, py::const_)), "data"_a); m.def("get_uint", BorrowByml(&Byml::GetUInt), "data"_a); m.def("get_uint64", BorrowByml(&Byml::GetUInt64), "data"_a); diff --git a/src/byml.cpp b/src/byml.cpp index 1c5c9bb..e6baa0b 100644 --- a/src/byml.cpp +++ b/src/byml.cpp @@ -460,6 +460,18 @@ std::vector Byml::ToBinary(bool big_endian, int version) const { return ctx.writer.Finalize(); } +Byml::Hash& Byml::GetHash() { + return Get(); +} + +Byml::Array& Byml::GetArray() { + return Get(); +} + +Byml::String& Byml::GetString() { + return Get(); +} + const Byml::Hash& Byml::GetHash() const { return Get(); } diff --git a/src/include/oead/byml.h b/src/include/oead/byml.h index f4bfb36..e8cb67b 100644 --- a/src/include/oead/byml.h +++ b/src/include/oead/byml.h @@ -134,6 +134,9 @@ class Byml { // Some of them will perform type conversions automatically. // If value types are incorrect, an exception is thrown. + Hash& GetHash(); + Array& GetArray(); + String& GetString(); const Hash& GetHash() const; const Array& GetArray() const; const String& GetString() const;