18 #ifndef DOXYGEN_SHOULD_SKIP_THIS
56 MemoryAllocationFailed,
64 virtual const char* getDefaultPath() const noexcept = 0;
70 virtual
void setDefaultPath(const
char* path) noexcept = 0;
78 virtual
Result<Error> load(const
char* path) noexcept = 0;
86 virtual
Result<Error> loadFromString(const
char* content) noexcept = 0;
93 virtual
bool save(const
char* path) const noexcept = 0;
99 virtual
void clear() noexcept = 0;
105 virtual
bool isEmpty() const noexcept = 0;
117 struct Int1 {
int m_value; } m_int1;
118 struct Int2 {
int m_value[2]; } m_int2;
119 struct Int3 {
int m_value[3]; } m_int3;
120 struct Int4 {
int m_value[4]; } m_int4;
121 struct Float1 {
float m_value; } m_float1;
122 struct Float2 {
float m_value[2]; } m_float2;
123 struct Float3 {
float m_value[3]; } m_float3;
124 struct Float4 {
float m_value[4]; } m_float4;
125 struct String {
char* m_value; } m_string;
154 Value(
int x) noexcept;
161 Value(
int x,
int y) noexcept;
169 Value(
int x,
int y,
int z) noexcept;
178 Value(
int x,
int y,
int z,
int w) noexcept;
184 Value(
float x) noexcept;
191 Value(
float x,
float y) noexcept;
198 Value(
float x,
float y,
float z) noexcept;
207 Value(
float x,
float y,
float z,
float w) noexcept;
214 Value(const
char*
string) noexcept;
220 Value(const
Rect& rect) noexcept;
226 Value(const
Size& size) noexcept;
232 Value(const
Point2f& point) noexcept;
238 Value(
bool x) noexcept;
244 operator
bool() const noexcept;
251 bool is(Type type) const noexcept;
258 bool setString(const
char*
string) noexcept;
266 bool getString(
char*
string) const noexcept;
273 void setRect(const
Rect& rect) noexcept;
281 bool getRect(
Rect* rect) const noexcept;
288 void setSize(const
Size& size) noexcept;
296 bool getSize(
Size* size) const noexcept;
303 void setPoint2i(const
Point2i& point) noexcept;
311 bool getPoint2i(
Point2i* point) const noexcept;
318 void setPoint2f(const
Point2f& point) noexcept;
326 bool getPoint2f(
Point2f* point) const noexcept;
332 void setBool(
bool x) noexcept;
340 bool getBool(
bool* x) const noexcept;
347 void setInt(
int x) noexcept;
355 bool getInt(
int* x) const noexcept;
363 void setInt(
int x,
int y) noexcept;
372 bool getInt(
int* x,
int* y) const noexcept;
381 void setInt(
int x,
int y,
int z) noexcept;
391 bool getInt(
int* x,
int* y,
int* z) const noexcept;
401 void setInt(
int x,
int y,
int z,
int w) noexcept;
412 bool getInt(
int* x,
int* y,
int* z,
int* w) const noexcept;
419 void setFloat(
float x) noexcept;
427 bool getFloat(
float* x) const noexcept;
435 void setFloat(
float x,
float y) noexcept;
444 bool getFloat(
float* x,
float* y) const noexcept;
453 void setFloat(
float x,
float y,
float z) noexcept;
463 bool getFloat(
float* x,
float* y,
float* z) const noexcept;
473 void setFloat(
float x,
float y,
float z,
float w) noexcept;
484 bool getFloat(
float* x,
float* y,
float* z,
float* w) const noexcept;
493 float asFloat(
float defaultValue = 0.f) const noexcept;
511 bool asBool(
bool defaultValue = false) const noexcept;
520 int asInt(
int defaultValue = 0) const noexcept;
529 Size asSize(const
Size& defaultValue =
Size()) const noexcept;
547 Rect asRect(const
Rect& defaultValue =
Rect()) const noexcept;
557 const
char* asString(const
char* defaultValue = "") const noexcept;
559 inline Value(const Value& other) = delete;
560 Value(Value&& other);
562 inline Value& operator=(const Value& other) = delete;
563 Value& operator=(Value&& other);
565 void swap(Value& first, Value& second);
582 Key(
const char* section,
const char* parameter) noexcept;
588 const char* getSection()
const noexcept;
594 const char* getParameter()
const noexcept;
600 void setSection(
const char* section) noexcept;
606 void setParameter(
const char* parameter) noexcept;
616 static const unsigned int m_bufferLength = 128;
617 char m_section [m_bufferLength];
618 char m_parameter [m_bufferLength];
632 Desc(
const char* desc) noexcept;
638 const char* getDesc()
const noexcept;
644 void setDesc(
const char* desc) noexcept;
647 static const unsigned int m_bufferLength = 256;
648 char m_desc [m_bufferLength];
659 Entry() noexcept = default;
671 Entry(const
Desc& desc, Value&& value) noexcept;
677 void setDesc(const
Desc& desc) noexcept;
683 void setValue(Value&& value) noexcept;
689 const
Desc& getDesc() const noexcept;
695 const Value& getValue() const noexcept;
705 virtual
void setDesc(const
Key& key, const
Desc& desc) noexcept = 0;
717 const
char* parameter,
718 const
Desc& desc) noexcept;
727 virtual
void setValue(const
Key& key, Value&& value) noexcept = 0;
739 const
char* parameter,
740 Value&& value) noexcept;
749 virtual
void setEntry(const
Key& key,
Entry&& entry) noexcept = 0;
762 Value&& value) noexcept;
775 const
char* parameter,
777 Value&& value) noexcept;
786 virtual const
Entry& getEntry(const
Key& key) const noexcept = 0;
795 Desc getDesc(const
Key& key) const noexcept;
805 Desc getDesc(const
char* section, const
char* parameter) const noexcept;
814 const Value& getValue(const
Key& key) const noexcept;
824 const Value& getValue(const
char* section, const
char* parameter) const noexcept;
859 return "Could not allocate memory";
861 return "Error reading from file";
863 return "Internal error";
865 return "Error during document declaration/processing instruction parsing";
867 return "Parser could not determine tag type";
869 return "Error during CDATA section parsing";
871 return "File was not found";
873 return "Error during PCDATA section parsing";
875 return "Error during comment parsing";
877 return "Error during document type declaration parsing";
879 return "Settings sections is invalid or absent";
881 return "Error during element attribute parsing";
883 return "Error during end element tag parsing";
885 return "Root type is not node_element or node_document";
887 return "Document without element nodes";
889 return "Mismatch of start-end tags";
891 return "Error during start element tag parsing";
892 default:
return "Unknown error";
Could not allocate memory.
2D floating point.
Definition: ISettingsProvider.h:138
floating point.
Definition: ISettingsProvider.h:137
Error
Config parsing error codes.
Definition: ISettingsProvider.h:37
3D floating point.
Definition: ISettingsProvider.h:139
#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:572
Definition: ISettingsProvider.h:118
Object system types and interfaces.
Definition: ISettingsProvider.h:120
FSDK_API ResultValue< FSDKError, ISettingsProviderPtr > createSettingsProviderFromString(const char *content) noexcept
Creates a settings provider from the xml-formatted string.
Parser could not determine tag type.
4D floating point.
Definition: ISettingsProvider.h:140
Type
Value type.
Definition: ISettingsProvider.h:131
Desc m_desc
Parameter description.
Definition: ISettingsProvider.h:656
Base strong reference counted object interface.
Definition: IRefCounted.h:36
Definition: ISettingsProvider.h:124
Value data.
Definition: ISettingsProvider.h:116
Definition: ISettingsProvider.h:122
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:117
Configuration parameter description.
Definition: ISettingsProvider.h:623
Definition: ISettingsProvider.h:119
bool operator<(Version lhs, Version rhs) noexcept
Check if one version is less than another.
Definition: Version.h:36
Integer.
Definition: ISettingsProvider.h:133
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:123
Definition: ISettingsProvider.h:121
4D integer.
Definition: ISettingsProvider.h:136
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:134
Parsing error occurred while parsing PCDATA section.
Configuration parameter entry.
Definition: ISettingsProvider.h:653
FSDKError
Common SDK error codes.
Definition: FSDKError.h:17
Configuration parameter value.
Definition: ISettingsProvider.h:111
Parsing error occurred while parsing start element tag.
Error reading from file/stream.
FSDK_API ResultValue< FSDKError, ISettingsProviderPtr > createSettingsProvider(const char *path) noexcept
Creates a settings provider.
3D integer.
Definition: ISettingsProvider.h:135
Value m_value
Parameter value.
Definition: ISettingsProvider.h:655
Unkown value type.
Definition: ISettingsProvider.h:132
Definition: ISettingsProvider.h:125
Parsing error occurred while parsing element attribute.
Parsing error occurred while parsing CDATA section.
SDK settings provider interface.
Definition: ISettingsProvider.h:32