16#include <Common/primitive_type.h>
28real
load_real(std::string_view sdlRealStr);
34template<
typename FloatType>
35FloatType
load_float(std::string_view sdlFloatStr);
40template<
typename IntType>
41IntType
load_int(std::string_view sdlIntStr);
46template<
typename NumberType>
47NumberType
load_number(std::string_view sdlNumberStr);
49template<
typename NumberType, std::
size_t EXTENT = std::dynamic_extent>
52template<
typename Element>
53math::TVector2<Element>
load_vector2(std::string_view sdlVec2Str);
55template<
typename Element>
56math::TVector3<Element>
load_vector3(std::string_view sdlVec3Str);
58template<
typename Element>
59math::TVector4<Element>
load_vector4(std::string_view sdlVec4Str);
61template<
typename Element>
64template<
typename NumberType>
67template<
typename Element>
68std::vector<math::TVector3<Element>>
load_vector3_array(std::string_view sdlVec3ArrayStr);
74void save_real(real value, std::string& out_str);
87template<
typename FloatType>
88void save_float(FloatType value, std::string& out_str);
95template<
typename IntType>
96void save_int(IntType value, std::string& out_str);
103template<
typename NumberType>
104void save_number(NumberType value, std::string& out_str);
110template<
typename NumberType, std::
size_t EXTENT = std::dynamic_extent>
117template<
typename Element>
118void save_vector2(
const math::TVector2<Element>& value, std::string& out_str);
124template<
typename Element>
125void save_vector3(
const math::TVector3<Element>& value, std::string& out_str);
131template<
typename Element>
132void save_vector4(
const math::TVector4<Element>& value, std::string& out_str);
138template<
typename Element>
139void save_quaternion(
const math::TQuaternion<Element>& value, std::string& out_str);
145template<
typename NumberType>
152template<
typename Element>
157void save_field_id(
const SdlField* sdlField, SdlOutputClause& clause);
167std::string
gen_pretty_name(
const SdlClass* clazz,
const SdlField* field);
174-> std::vector<std::pair<const SdlFunction*, const SdlClass*>>;
184template<std::
integral IntType>
187template<std::
floating_po
int FloatType>
190template<CNumber NumberType>
204template<
typename DstType,
typename SrcType>
205DstType*
cast_to(SrcType* srcResource);
222std::string
name_to_camel_case(std::string_view sdlName,
bool capitalizedFront =
false);
Definition sdl_spectrum_io.cpp:17
void save_vector3(const math::TVector3< Element > &value, std::string &out_str)
Definition sdl_helpers.ipp:323
std::string name_to_camel_case(const std::string_view sdlName, const bool capitalizedFront)
Make a standard SDL name to camel case. Example: "some-sdl-name" will be "someSdlName" (if capitalize...
Definition sdl_helpers.cpp:110
std::string gen_pretty_name(const SdlClass *const clazz)
Generate a human-readable name for the SDL types. These helpers allow input types to be null.
Definition sdl_helpers.cpp:24
integer load_integer(std::string_view sdlIntegerStr)
Definition sdl_helpers.ipp:109
IntType load_int(std::string_view sdlIntStr)
Returns a integer number by processing its SDL representation. Supports ph::integer and all signed an...
Definition sdl_helpers.ipp:37
void save_number_array(TSpanView< NumberType > values, std::string &out_str)
Definition sdl_helpers.ipp:368
void save_int(IntType value, std::string &out_str)
Converts a integer number to its SDL representation. Supports ph::real, float, double,...
Definition sdl_helpers.ipp:248
void load_numbers(std::string_view sdlNumbersStr, TSpan< NumberType, EXTENT > out_numbers)
Definition sdl_helpers.ipp:65
NumberType load_number(std::string_view sdlNumberStr)
Returns a number by processing its SDL representation. Accepts all types supported by load_float() an...
Definition sdl_helpers.ipp:50
DstType * cast_to(SrcType *srcResource)
Cast between SDL resource types. Cast the input SDL resource instance of SrcType to an instance of Ds...
Definition sdl_helpers.ipp:549
void save_integer(integer value, std::string &out_str)
Definition sdl_helpers.ipp:229
std::vector< math::TVector3< Element > > load_vector3_array(std::string_view sdlVec3ArrayStr)
Definition sdl_helpers.ipp:200
void save_vector4(const math::TVector4< Element > &value, std::string &out_str)
Definition sdl_helpers.ipp:338
void save_field_id(const SdlField *const sdlField, SdlOutputClause &clause)
Save the identity of the field to output clause.
Definition sdl_helpers.cpp:16
std::string name_to_title_case(const std::string_view sdlName)
Make a standard SDL name to canonical capitalized form. Make the SDL name capitalized and separated b...
Definition sdl_helpers.cpp:78
void save_quaternion(const math::TQuaternion< Element > &value, std::string &out_str)
Definition sdl_helpers.ipp:353
constexpr ESdlDataType int_type_of()
Definition sdl_helpers.ipp:422
void save_number(NumberType value, std::string &out_str)
Converts a number to its SDL representation. Accepts all types supported by save_float() and save_int...
Definition sdl_helpers.ipp:261
constexpr ESdlTypeCategory category_of()
Statically gets the SDL category of T.
Definition sdl_helpers.ipp:409
void save_numbers(TSpanView< NumberType, EXTENT > numbers, std::string &out_str)
Definition sdl_helpers.ipp:276
void save_float(FloatType value, std::string &out_str)
Converts a floating-point number to its SDL representation. Supports ph::real, float,...
Definition sdl_helpers.ipp:235
constexpr ESdlDataType resource_type_of()
Definition sdl_helpers.ipp:492
FloatType load_float(std::string_view sdlFloatStr)
Returns a floating-point number by processing its SDL representation. Supports ph::real,...
Definition sdl_helpers.ipp:24
void save_real(real value, std::string &out_str)
Definition sdl_helpers.ipp:224
math::TQuaternion< Element > load_quaternion(std::string_view sdlQuatStr)
Definition sdl_helpers.ipp:160
auto get_all_callable_functions(const SdlClass *const callableParentClass) -> std::vector< std::pair< const SdlFunction *, const SdlClass * > >
Get a list of callable functions from the class.
Definition sdl_helpers.cpp:59
math::TVector4< Element > load_vector4(std::string_view sdlVec4Str)
Definition sdl_helpers.ipp:145
math::TVector2< Element > load_vector2(std::string_view sdlVec2Str)
Definition sdl_helpers.ipp:115
std::vector< NumberType > load_number_array(std::string_view sdlNumberArrayStr)
Definition sdl_helpers.ipp:175
std::string name_to_snake_case(const std::string_view sdlName)
Make a standard SDL name to snake case. Example: "some-sdl-name" will be "some_sdl_name".
Definition sdl_helpers.cpp:125
void save_vector3_array(TSpanView< math::TVector3< Element > > values, std::string &out_str)
Definition sdl_helpers.ipp:383
constexpr ESdlDataType number_type_of()
Definition sdl_helpers.ipp:478
void save_vector2(const math::TVector2< Element > &value, std::string &out_str)
Definition sdl_helpers.ipp:308
constexpr ESdlDataType float_type_of()
Definition sdl_helpers.ipp:464
math::TVector3< Element > load_vector3(std::string_view sdlVec3Str)
Definition sdl_helpers.ipp:130
real load_real(std::string_view sdlRealStr)
Definition sdl_helpers.ipp:104
std::span< const T, EXTENT > TSpanView
Same as TSpan, except that the objects are const-qualified. Note that for pointer types,...
Definition TSpan.h:19
std::span< T, EXTENT > TSpan
A contiguous sequence of objects of type T. Effectively the same as std::span.
Definition TSpan.h:12
ESdlDataType
Common data types used by SDL. Each listed data type has some form of one to one mapping to a specifi...
Definition ESdlDataType.h:13
ESdlTypeCategory
Definition ESdlTypeCategory.h:15