18 #ifndef DOXYGEN_SHOULD_SKIP_THIS
56 MemoryAllocationFailed,
64 virtual const char* getDefaultPath() const noexcept = 0;
72 virtual
Result<Error> load(const
char* path) noexcept = 0;
79 virtual
bool save(const
char* path) const noexcept = 0;
85 virtual
void clear() noexcept = 0;
91 virtual
bool isEmpty() const noexcept = 0;
103 struct Int1 {
int m_value; } m_int1;
104 struct Int2 {
int m_value[2]; } m_int2;
105 struct Int3 {
int m_value[3]; } m_int3;
106 struct Int4 {
int m_value[4]; } m_int4;
107 struct Float1 {
float m_value; } m_float1;
108 struct Float2 {
float m_value[2]; } m_float2;
109 struct Float3 {
float m_value[3]; } m_float3;
110 struct Float4 {
float m_value[4]; } m_float4;
111 struct String {
char* m_value; } m_string;
140 Value(
int x) noexcept;
147 Value(
int x,
int y) noexcept;
155 Value(
int x,
int y,
int z) noexcept;
164 Value(
int x,
int y,
int z,
int w) noexcept;
170 Value(
float x) noexcept;
177 Value(
float x,
float y) noexcept;
184 Value(
float x,
float y,
float z) noexcept;
193 Value(
float x,
float y,
float z,
float w) noexcept;
200 Value(const
char*
string) noexcept;
206 Value(const
Rect& rect) noexcept;
212 Value(const
Size& size) noexcept;
218 Value(const
Point2f& point) noexcept;
224 Value(
bool x) noexcept;
230 operator
bool() const noexcept;
237 bool is(Type type) const noexcept;
244 bool setString(const
char*
string) noexcept;
252 bool getString(
char*
string) const noexcept;
259 void setRect(const
Rect& rect) noexcept;
267 bool getRect(
Rect* rect) const noexcept;
274 void setSize(const
Size& size) noexcept;
282 bool getSize(
Size* size) const noexcept;
289 void setPoint2i(const
Point2i& point) noexcept;
297 bool getPoint2i(
Point2i* point) const noexcept;
304 void setPoint2f(const
Point2f& point) noexcept;
312 bool getPoint2f(
Point2f* point) const noexcept;
318 void setBool(
bool x) noexcept;
326 bool getBool(
bool* x) const noexcept;
333 void setInt(
int x) noexcept;
341 bool getInt(
int* x) const noexcept;
349 void setInt(
int x,
int y) noexcept;
358 bool getInt(
int* x,
int* y) const noexcept;
367 void setInt(
int x,
int y,
int z) noexcept;
377 bool getInt(
int* x,
int* y,
int* z) const noexcept;
387 void setInt(
int x,
int y,
int z,
int w) noexcept;
398 bool getInt(
int* x,
int* y,
int* z,
int* w) const noexcept;
405 void setFloat(
float x) noexcept;
413 bool getFloat(
float* x) const noexcept;
421 void setFloat(
float x,
float y) noexcept;
430 bool getFloat(
float* x,
float* y) const noexcept;
439 void setFloat(
float x,
float y,
float z) noexcept;
449 bool getFloat(
float* x,
float* y,
float* z) const noexcept;
459 void setFloat(
float x,
float y,
float z,
float w) noexcept;
470 bool getFloat(
float* x,
float* y,
float* z,
float* w) const noexcept;
479 float asFloat(
float defaultValue = 0.f) const noexcept;
497 bool asBool(
bool defaultValue = false) const noexcept;
506 int asInt(
int defaultValue = 0) const noexcept;
515 Size asSize(const
Size& defaultValue =
Size()) const noexcept;
533 Rect asRect(const
Rect& defaultValue =
Rect()) const noexcept;
543 const
char* asString(const
char* defaultValue = "") const noexcept;
545 inline Value(const Value& other) = delete;
546 Value(Value&& other);
548 inline Value& operator=(const Value& other) = delete;
549 Value& operator=(Value&& other);
551 void swap(Value& first, Value& second);
568 Key(
const char* section,
const char* parameter) noexcept;
574 const char* getSection()
const noexcept;
580 const char* getParameter()
const noexcept;
586 void setSection(
const char* section) noexcept;
592 void setParameter(
const char* parameter) noexcept;
602 static const unsigned int m_bufferLength = 128;
603 char m_section [m_bufferLength];
604 char m_parameter [m_bufferLength];
618 Desc(
const char* desc) noexcept;
624 const char* getDesc()
const noexcept;
630 void setDesc(
const char* desc) noexcept;
633 static const unsigned int m_bufferLength = 256;
634 char m_desc [m_bufferLength];
645 Entry() noexcept = default;
657 Entry(const
Desc& desc, Value&& value) noexcept;
663 void setDesc(const
Desc& desc) noexcept;
669 void setValue(Value&& value) noexcept;
675 const
Desc& getDesc() const noexcept;
681 const Value& getValue() const noexcept;
691 virtual
void setDesc(const
Key& key, const
Desc& desc) noexcept = 0;
703 const
char* parameter,
704 const
Desc& desc) noexcept;
713 virtual
void setValue(const
Key& key, Value&& value) noexcept = 0;
725 const
char* parameter,
726 Value&& value) noexcept;
735 virtual
void setEntry(const
Key& key,
Entry&& entry) noexcept = 0;
748 Value&& value) noexcept;
761 const
char* parameter,
763 Value&& value) noexcept;
772 virtual const
Entry& getEntry(const
Key& key) const noexcept = 0;
781 Desc getDesc(const
Key& key) const noexcept;
791 Desc getDesc(const
char* section, const
char* parameter) const noexcept;
800 const Value& getValue(const
Key& key) const noexcept;
810 const Value& getValue(const
char* section, const
char* parameter) const noexcept;
835 return "Could not allocate memory";
837 return "Error reading from file";
839 return "Internal error";
841 return "Error during document declaration/processing instruction parsing";
843 return "Parser could not determine tag type";
845 return "Error during CDATA section parsing";
847 return "File was not found";
849 return "Error during PCDATA section parsing";
851 return "Error during comment parsing";
853 return "Error during document type declaration parsing";
855 return "Settings sections is invalid or absent";
857 return "Error during element attribute parsing";
859 return "Error during end element tag parsing";
861 return "Root type is not node_element or node_document";
863 return "Document without element nodes";
865 return "Mismatch of start-end tags";
867 return "Error during start element tag parsing";
868 default:
return "Unknown error";
Could not allocate memory.
2D floating point.
Definition: ISettingsProvider.h:124
floating point.
Definition: ISettingsProvider.h:123
Error
Config parsing error codes.
Definition: ISettingsProvider.h:37
3D floating point.
Definition: ISettingsProvider.h:125
#define FSDK_API
Dummy.
Definition: Def.h:27
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
Unable to append nodes since root type is not node_element or node_document (exclusive to xml_node::a...
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
Common data types and structures.
Configuration parameter key.
Definition: ISettingsProvider.h:558
Definition: ISettingsProvider.h:104
Object system types and interfaces.
Definition: ISettingsProvider.h:106
Parser could not determine tag type.
4D floating point.
Definition: ISettingsProvider.h:126
Type
Value type.
Definition: ISettingsProvider.h:117
Desc m_desc
Parameter description.
Definition: ISettingsProvider.h:642
Base strong reference counted object interface.
Definition: IRefCounted.h:36
Definition: ISettingsProvider.h:110
Value data.
Definition: ISettingsProvider.h:102
Definition: ISettingsProvider.h:108
There was a mismatch of start-end tags (closing tag had incorrect name, some tag was not closed or th...
Parsing error occurred while parsing document declaration/processing instruction. ...
Parsing error occurred while parsing document type declaration.
Parsing error occurred while parsing comment.
Definition: ISettingsProvider.h:103
Configuration parameter description.
Definition: ISettingsProvider.h:609
Definition: ISettingsProvider.h:105
bool operator<(Version lhs, Version rhs) noexcept
Check if one version is less than another.
Definition: Version.h:36
Integer.
Definition: ISettingsProvider.h:119
File was not found during load_file()
Addon for Result to output some value aside the result. Specialization for copiable types...
Definition: ResultValue.h:25
Definition: ISettingsProvider.h:109
Definition: ISettingsProvider.h:107
4D integer.
Definition: ISettingsProvider.h:122
Parsing resulted in a document without element nodes.
Parsing error occurred while parsing end element tag.
Settings section is invalid or absent.
2D integer.
Definition: ISettingsProvider.h:120
Parsing error occurred while parsing PCDATA section.
Configuration parameter entry.
Definition: ISettingsProvider.h:639
FSDKError
Common SDK error codes.
Definition: FSDKError.h:17
Configuration parameter value.
Definition: ISettingsProvider.h:97
Parsing error occurred while parsing start element tag.
Error reading from file/stream.
FSDK_API ResultValue< FSDKError, ISettingsProviderPtr > createSettingsProvider(const char *path) noexcept
Create a settings provider.
3D integer.
Definition: ISettingsProvider.h:121
Value m_value
Parameter value.
Definition: ISettingsProvider.h:641
Unkown value type.
Definition: ISettingsProvider.h:118
Definition: ISettingsProvider.h:111
Parsing error occurred while parsing element attribute.
Parsing error occurred while parsing CDATA section.
SDK settings provider interface.
Definition: ISettingsProvider.h:32