Base: Units: return std::string

This commit is contained in:
Ladislav Michl
2024-07-12 20:51:54 +02:00
committed by Yorik van Havre
parent 24f4deef70
commit 379d7ea9d5
24 changed files with 181 additions and 174 deletions

View File

@@ -38,7 +38,7 @@ std::string UnitPy::representation() const
Unit* self = getUnitPtr();
ret << "Unit: ";
ret << self->getString().toUtf8().constData() << " (";
ret << self->getString() << " (";
ret << (*self).length() << ",";
ret << (*self).mass() << ",";
ret << (*self).time() << ",";
@@ -48,7 +48,7 @@ std::string UnitPy::representation() const
ret << (*self).luminousIntensity() << ",";
ret << (*self).angle() << ")";
std::string type = self->getTypeString().toUtf8().constData();
std::string type = self->getTypeString();
if (!type.empty()) {
ret << " [" << type << "]";
}
@@ -207,7 +207,7 @@ PyObject* UnitPy::richCompare(PyObject* v, PyObject* w, int op)
Py::String UnitPy::getType() const
{
return {getUnitPtr()->getTypeString().toUtf8(), "utf-8"};
return {getUnitPtr()->getTypeString(), "utf-8"};
}
Py::Tuple UnitPy::getSignature() const