add object_get/set_name/information

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
folling 2024-01-14 02:11:13 +01:00 committed by Folling
parent b5939bbabd
commit bf2c971669
Signed by: folling
SSH key fingerprint: SHA256:S9qEx5WCFFLK49tE/LKnKuJYM5sw+++Dn6qJbbyxnCY
2 changed files with 99 additions and 0 deletions

View file

@ -22,17 +22,55 @@ struct IkarusObject;
/// \brief Fetches the project of an object.
/// \param object The object to fetch the project from.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The project of the object or null if an error occurs.
IKA_API struct IkarusProject * ikarus_object_get_project(IkarusObject const * object, IkarusErrorData * error_out);
/// \brief Fetches the name of an object.
/// \param object The object to fetch the name from.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The name of the object or null if an error occurs.
IKA_API char const * ikarus_object_get_name(IkarusObject const * object, IkarusErrorData * error_out);
/// \brief Sets the name of an object.
/// \param object The object to set the name of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param new_name The new name of the object.
/// \pre \li Must not be null.
/// \pre \li Must not be empty.
/// \param error_out \see errors.h
IKA_API void ikarus_object_set_name(IkarusObject const * object, char const * new_name, IkarusErrorData * error_out);
/// \brief Fetches the information of an object.
/// \param object The object to fetch the information from.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The information of the object or null if an error occurs.
IKA_API char const * ikarus_object_get_info(IkarusObject const * object, IkarusErrorData * error_out);
/// \brief Sets the information of an object.
/// \param object The object to set the information of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param new_info The new information of the object.
/// \pre \li Must not be null.
/// \param error_out \see errors.h
IKA_API void ikarus_object_set_info(IkarusObject const * object, char const * new_info, IkarusErrorData * error_out);
/// \brief Compares two objects for equality.
/// \details This neither compares the pointers nor does a deep copy. Instead it figures out if the objects _are_ the
/// same object.
/// \param lhs The left hand side object.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param rhs The right hand side object.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return True if the objects are equal, false otherwise.
IKA_API bool ikarus_object_is_equal(IkarusObject const * lhs, IkarusObject const * rhs, IkarusErrorData * error_out);