5#include <Common/assertion.h>
12template<
typename Owner,
typename SdlValueType = TSdlValue<std::
string, Owner>>
15 static_assert(std::is_base_of_v<TSdlAbstractValue<std::string, Owner>, SdlValueType>,
16 "SdlValueType should be a subclass of TSdlAbstractValue.");
19 template<
typename ValueType>
20 TSdlString(std::string valueName, ValueType Owner::* const valuePtr) :
21 SdlValueType(
"string",
std::move(valueName), valuePtr)
31 std::string*
const str = this->
getValue(owner);
52 out_clause.
value =
'"';
57 out_clause.
value += *str;
60 out_clause.
value +=
'"';
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
Definition SdlNativeData.h:88
static SdlNativeData fromSingleElement(ElementType *elementPtr, ESdlDataFormat elementContainer, ESdlDataType elementType, bool canSet=false, bool canDirectAccess=false)
Creates native data for a single element pointer.
Definition SdlNativeData.ipp:86
Carries SDL representation of various data during the output process. Helps to write output data such...
Definition SdlOutputClause.h:14
std::string value
Stores stringified data of a clause. As the output clause generator knows best how its data look like...
Definition SdlOutputClause.h:29
Data that SDL output process can rely on.
Definition SdlOutputContext.h:19
Definition TSdlString.h:14
std::string valueAsString(const std::string &str) const override
Definition TSdlString.h:24
TSdlString(std::string valueName, ValueType Owner::*const valuePtr)
Definition TSdlString.h:20
void saveToSdl(const Owner &owner, SdlOutputClause &out_clause, const SdlOutputContext &ctx) const override
Convert actual value back to SDL value. Saving a loaded value as SDL value should rarely fail–as load...
Definition TSdlString.h:46
void loadFromSdl(Owner &owner, const SdlInputClause &clause, const SdlInputContext &ctx) const override
Load SDL value to actual value and store it in the owner's field. Implementations are highly encourag...
Definition TSdlString.h:37
SdlNativeData ownedNativeData(Owner &owner) const override
Direct access to the field memory of an owner. Short-lived owner objects such as function parameter s...
Definition TSdlString.h:29
void setValue(Owner &owner, T value) const override
Store a value.
Definition TSdlValue.ipp:38
const T * getConstValue(const Owner &owner) const override
Get a pointer to the stored value.
Definition TSdlValue.ipp:50
T * getValue(Owner &owner) const override
Get a pointer to the stored value.
Definition TSdlValue.ipp:44
The root for all renderer implementations.
Definition EEngineProject.h:6