47 lines
1.5 KiB
C
47 lines
1.5 KiB
C
#pragma once
|
|
|
|
/// \file text_value.h
|
|
/// \author Folling <folling@ikarus.world>
|
|
|
|
#include <ikarus/macros.h>
|
|
|
|
/// \addtogroup values Values
|
|
/// @{
|
|
|
|
IKARUS_BEGIN_HEADER
|
|
|
|
/// \brief A true/false boolean-like value. For example "IsDead".
|
|
struct IkarusTextValue;
|
|
|
|
/// \brief Creates a text value from a boolean.
|
|
/// \param value The text value.
|
|
/// \return The entity value.
|
|
/// \remark Must be freed with #ikarus_free.
|
|
IKA_API IkarusTextValue * ikarus_text_value_create(char const * value);
|
|
|
|
/// \brief Creates an indeterminate text value.
|
|
/// \return The entity value.
|
|
/// \remark Must be freed with #ikarus_free.
|
|
IKA_API IkarusTextValue * ikarus_text_value_create_indeterminate();
|
|
|
|
/// \brief Fetches the underlying value of a text value.
|
|
/// \param value The text value.
|
|
/// \return The underlying value.
|
|
/// \warning Undefined if the value is indeterminate.
|
|
/// \remark The value is owned by libikarus and must not be freed.
|
|
IKA_API char const * ikarus_text_value_get_underlying(IkarusTextValue const * value);
|
|
|
|
/// \brief Sets the value of a text value.
|
|
/// \param value The text value.
|
|
/// \pre \li Must not be null.
|
|
/// \param new_value The new value.
|
|
IKA_API void ikarus_text_value_set(IkarusTextValue * value, bool new_value);
|
|
|
|
/// \brief Converts a text value to an entity value.
|
|
/// \param text_value The text value to convert.
|
|
/// \return The converted entity value.
|
|
IKA_API struct IkarusValue * ikarus_text_value_to_value(IkarusTextValue * text_value);
|
|
|
|
IKARUS_END_HEADER
|
|
|
|
/// @}
|