App: Change indentation to 4 spaces in String*PyImp.cpp

This commit is contained in:
marioalexis
2023-08-08 19:18:10 -03:00
parent 04bd0b2d20
commit 0987f94185
2 changed files with 80 additions and 61 deletions

View File

@@ -32,61 +32,69 @@ using namespace App;
// returns a string which represent the object e.g. when printed in python
std::string StringIDPy::representation() const
{
return getStringIDPtr()->toString(_index);
return getStringIDPtr()->toString(this->_index);
}
PyObject* StringIDPy::isSame(PyObject *args)
{
PyObject *other = nullptr;
if (!PyArg_ParseTuple(args, "O!", &StringIDPy::Type, &other)) {
return nullptr;
}
PyObject *other = nullptr;
if (!PyArg_ParseTuple(args, "O!", &StringIDPy::Type, &other)) {
return nullptr;
}
auto *otherPy = static_cast<StringIDPy*>(other);
bool same = (otherPy->getStringIDPtr() == this->getStringIDPtr())
&& (otherPy->_index == this->_index);
auto *otherPy = static_cast<StringIDPy*>(other);
bool same = (otherPy->getStringIDPtr() == this->getStringIDPtr())
&& (otherPy->_index == this->_index);
return PyBool_FromLong(same ? 1 : 0);
return PyBool_FromLong(same ? 1 : 0);
}
Py::Int StringIDPy::getValue() const {
return Py::Int(getStringIDPtr()->value());
Py::Long StringIDPy::getValue() const
{
return Py::Long(getStringIDPtr()->value());
}
Py::List StringIDPy::getRelated() const {
Py::List list;
for (const auto &id : getStringIDPtr()->relatedIDs()) {
list.append(Py::Long(id.value()));
}
return list;
Py::List StringIDPy::getRelated() const
{
Py::List list;
for (const auto &id : getStringIDPtr()->relatedIDs()) {
list.append(Py::Long(id.value()));
}
return list;
}
Py::String StringIDPy::getData() const {
return {Py::String(getStringIDPtr()->dataToText(this->_index))};
Py::String StringIDPy::getData() const
{
return Py::String(getStringIDPtr()->dataToText(this->_index));
}
Py::Boolean StringIDPy::getIsBinary() const {
return {getStringIDPtr()->isBinary()};
Py::Boolean StringIDPy::getIsBinary() const
{
return Py::Boolean(getStringIDPtr()->isBinary());
}
Py::Boolean StringIDPy::getIsHashed() const {
return {getStringIDPtr()->isHashed()};
Py::Boolean StringIDPy::getIsHashed() const
{
return Py::Boolean(getStringIDPtr()->isHashed());
}
Py::Int StringIDPy::getIndex() const {
return Py::Int(this->_index);
Py::Long StringIDPy::getIndex() const
{
return Py::Long(this->_index);
}
void StringIDPy::setIndex(Py::Int index) {
this->_index = index;
void StringIDPy::setIndex(Py::Long index)
{
this->_index = index;
}
PyObject *StringIDPy::getCustomAttributes(const char* /*attr*/) const
{
return nullptr;
return nullptr;
}
int StringIDPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
{
return 0;
return 0;
}