summaryrefslogtreecommitdiff
path: root/lib/src
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2025-05-20 16:49:49 +0200
committerFelix Morgner <felix.morgner@gmail.com>2025-05-20 16:49:49 +0200
commitbce0c3d0a21c4a0f53984d55c00d1505957353a3 (patch)
tree7e17b84585e27acb3b57a74978befe70ac8a800b /lib/src
parent7d9d987d6ccb80aabe98ee1fdb9e5bcc7394ddf2 (diff)
downloadturns-bce0c3d0a21c4a0f53984d55c00d1505957353a3.tar.xz
turns-bce0c3d0a21c4a0f53984d55c00d1505957353a3.zip
lib: add wrapper for id
Diffstat (limited to 'lib/src')
-rw-r--r--lib/src/turns-participant.h2
-rw-r--r--lib/src/turnsmm/participant.cpp5
-rw-r--r--lib/src/turnsmm/participant.hpp1
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/src/turns-participant.h b/lib/src/turns-participant.h
index 6ed8ac6..edfdf9e 100644
--- a/lib/src/turns-participant.h
+++ b/lib/src/turns-participant.h
@@ -68,7 +68,7 @@ TurnsParticipantDisposition turns_participant_get_disposition(TurnsParticipant c
* @brief Get the id of a participant.
*
* @param self A participant instance. The value *must not* be NULL.
- * @return The id of the instance. The value is owned by the caller of the function.
+ * @return The id of the instance. The data ist owned by the instance.
*/
gchar const * turns_participant_get_id(TurnsParticipant const * self);
diff --git a/lib/src/turnsmm/participant.cpp b/lib/src/turnsmm/participant.cpp
index 38dfb3e..170c3a2 100644
--- a/lib/src/turnsmm/participant.cpp
+++ b/lib/src/turnsmm/participant.cpp
@@ -110,6 +110,11 @@ namespace Turns
return static_cast<Disposition>(turns_participant_get_disposition(const_cast<BaseObjectType *>(unwrap(this))));
}
+ auto Participant::get_id() const noexcept -> Glib::ustring
+ {
+ return Glib::convert_const_gchar_ptr_to_ustring(turns_participant_get_id(unwrap(this)));
+ }
+
auto Participant::get_name() const -> Glib::ustring
{
return turns_participant_get_name(const_cast<BaseObjectType *>(unwrap(this)));
diff --git a/lib/src/turnsmm/participant.hpp b/lib/src/turnsmm/participant.hpp
index b23fd42..c76cc29 100644
--- a/lib/src/turnsmm/participant.hpp
+++ b/lib/src/turnsmm/participant.hpp
@@ -47,6 +47,7 @@ namespace Turns
[[nodiscard]] auto get_active() const noexcept -> bool;
[[nodiscard]] auto get_defeated() const noexcept -> bool;
[[nodiscard]] auto get_disposition() const noexcept -> Disposition;
+ [[nodiscard]] auto get_id() const noexcept -> Glib::ustring;
[[nodiscard]] auto get_name() const -> Glib::ustring;
[[nodiscard]] auto get_priority() const noexcept -> float;