11#include <fsdk/FSDKError.h>
12#include <fsdk/IObject.h>
13#include <fsdk/Types.h>
18#ifndef DOXYGEN_SHOULD_SKIP_THIS
58 MemoryAllocationFailed,
72 virtual
void setDefaultPath(const
char* path) noexcept = 0;
89 virtual
Result<
Error> loadFromString(const
char* content) noexcept = 0;
96 virtual
bool save(const
char* path) const noexcept = 0;
102 virtual
void clear() noexcept = 0;
108 virtual
bool isEmpty() const noexcept = 0;
136 std::uint64_t m_value;
208 Value(
int x,
int y,
int z) noexcept;
217 Value(
int x,
int y,
int z,
int w) noexcept;
237 Value(
float x,
float y,
float z) noexcept;
246 Value(
float x,
float y,
float z,
float w) noexcept;
283 operator
bool() const noexcept;
290 bool is(
Type type) const noexcept;
297 bool setString(const
char*
string) noexcept;
305 bool getString(
char*
string) const noexcept;
312 void setRect(const
Rect& rect) noexcept;
321 bool getRect(
Rect* rect) const noexcept;
328 void setSize(const
Size& size) noexcept;
337 bool getSize(
Size* size) const noexcept;
344 void setPoint2i(const
Point2i& point) noexcept;
353 bool getPoint2i(
Point2i* point) const noexcept;
360 void setPoint2f(const
Point2f& point) noexcept;
369 bool getPoint2f(
Point2f* point) const noexcept;
375 void setBool(
bool x) noexcept;
384 bool getBool(
bool* x) const noexcept;
391 void setInt(
int x) noexcept;
399 bool getInt(
int* x) const noexcept;
405 void setULong(std::uint64_t x) noexcept;
413 bool getULong(std::uint64_t* x) const noexcept;
421 void setInt(
int x,
int y) noexcept;
431 bool getInt(
int* x,
int* y) const noexcept;
440 void setInt(
int x,
int y,
int z) noexcept;
451 bool getInt(
int* x,
int* y,
int* z) const noexcept;
461 void setInt(
int x,
int y,
int z,
int w) noexcept;
473 bool getInt(
int* x,
int* y,
int* z,
int* w) const noexcept;
480 void setFloat(
float x) noexcept;
488 bool getFloat(
float* x) const noexcept;
496 void setFloat(
float x,
float y) noexcept;
506 bool getFloat(
float* x,
float* y) const noexcept;
515 void setFloat(
float x,
float y,
float z) noexcept;
526 bool getFloat(
float* x,
float* y,
float* z) const noexcept;
536 void setFloat(
float x,
float y,
float z,
float w) noexcept;
548 bool getFloat(
float* x,
float* y,
float* z,
float* w) const noexcept;
557 float asFloat(
float defaultValue = 0.f) const noexcept;
577 bool asBool(
bool defaultValue = false) const noexcept;
586 int asInt(
int defaultValue = 0) const noexcept;
594 std::uint64_t asULong(std::uint64_t defaultValue = 0) const noexcept;
634 const
char* asString(const
char* defaultValue = "") const noexcept;
639 inline
Value& operator=(const
Value& other) = delete;
658 Key(const
char* section, const
char* parameter) noexcept;
664 const
char* getSection() const noexcept;
670 const
char* getParameter() const noexcept;
676 void setSection(const
char* section) noexcept;
682 void setParameter(const
char* parameter) noexcept;
692 static const
unsigned int m_bufferLength = 128;
693 char m_section[m_bufferLength];
694 char m_parameter[m_bufferLength];
707 Desc(const
char* desc) noexcept;
713 const
char* getDesc() const noexcept;
719 void setDesc(const
char* desc) noexcept;
722 static const
unsigned int m_bufferLength = 256;
723 char m_desc[m_bufferLength];
751 void setDesc(const
Desc& desc) noexcept;
757 void setValue(
Value&& value) noexcept;
763 const
Desc& getDesc() const noexcept;
769 const
Value& getValue() const noexcept;
779 virtual
void setDesc(const
Key& key, const
Desc& desc) noexcept = 0;
789 void setDesc(const
char* section, const
char* parameter, const
Desc& desc) noexcept;
798 virtual
void setValue(const
Key& key,
Value&& value) noexcept = 0;
808 void setValue(const
char* section, const
char* parameter,
Value&& value) noexcept;
817 virtual
void setEntry(const
Key& key,
Entry&& entry) noexcept = 0;
827 void setEntry(const
Key& key, const
Desc& desc,
Value&& value) noexcept;
838 void setEntry(const
char* section, const
char* parameter, const
Desc& desc,
Value&& value) noexcept;
847 virtual const
Entry& getEntry(const
Key& key) const noexcept = 0;
866 Desc getDesc(const
char* section, const
char* parameter) const noexcept;
875 const
Value& getValue(const
Key& key) const noexcept;
885 const
Value& getValue(const
char* section, const
char* parameter) const noexcept;
894 createSettingsProvider(const
char* path) noexcept;
903 createSettingsProviderFromString(const
char* content) noexcept;
912 return error == ISettingsProvider::Error::Ok;
917 case ISettingsProvider::Error::Ok:
919 case ISettingsProvider::Error::Memory:
920 return "Could not allocate memory";
921 case ISettingsProvider::Error::IOError:
922 return "Error reading from file";
923 case ISettingsProvider::Error::Internal:
924 return "Internal error";
925 case ISettingsProvider::Error::InvalidPi:
926 return "Error during document declaration/processing instruction parsing";
927 case ISettingsProvider::Error::InvalidTag:
928 return "Parser could not determine tag type";
929 case ISettingsProvider::Error::InvalidCdata:
930 return "Error during CDATA section parsing";
931 case ISettingsProvider::Error::FileNotFound:
932 return "File was not found";
933 case ISettingsProvider::Error::InvalidPcdata:
934 return "Error during PCDATA section parsing";
935 case ISettingsProvider::Error::InvalidComment:
936 return "Error during comment parsing";
937 case ISettingsProvider::Error::InvalidDocType:
938 return "Error during document type declaration parsing";
939 case ISettingsProvider::Error::InvalidSettings:
940 return "Settings sections is invalid or absent";
941 case ISettingsProvider::Error::InvalidAttribute:
942 return "Error during element attribute parsing";
943 case ISettingsProvider::Error::InvalidEndElement:
944 return "Error during end element tag parsing";
945 case ISettingsProvider::Error::AppendInvalidRoot:
946 return "Root type is not node_element or node_document";
947 case ISettingsProvider::Error::NoDocumentElement:
948 return "Document without element nodes";
949 case ISettingsProvider::Error::EndElementMismatch:
950 return "Mismatch of start-end tags";
951 case ISettingsProvider::Error::InvalidStartElement:
952 return "Error during start element tag parsing";
954 return "Unknown error";
#define FSDK_API
Dummy.
Definition Def.h:27
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition Def.h:56
SDK namespace.
Definition IAGSEstimator.h:8
FSDKError
Common SDK error codes.
Definition FSDKError.h:17
@ Internal
Internal error.
const char * toString(Image::MemoryResidence residence)
Returns a string representation of a MemoryResidence type.
Base strong reference counted object interface.
Definition IRefCounted.h:37
Configuration parameter description.
Definition ISettingsProvider.h:698
Desc() noexcept
Initialize an empty description.
Configuration parameter entry.
Definition ISettingsProvider.h:727
Entry() noexcept=default
Initialize an empty entry.
Desc m_desc
Parameter description.
Definition ISettingsProvider.h:730
Value m_value
Parameter value.
Definition ISettingsProvider.h:729
Configuration parameter key.
Definition ISettingsProvider.h:648
Key() noexcept
Initialize an empty key.
Definition ISettingsProvider.h:139
Definition ISettingsProvider.h:143
Definition ISettingsProvider.h:147
Definition ISettingsProvider.h:151
Definition ISettingsProvider.h:119
Definition ISettingsProvider.h:123
Definition ISettingsProvider.h:127
Definition ISettingsProvider.h:131
Definition ISettingsProvider.h:155
Definition ISettingsProvider.h:135
Configuration parameter value.
Definition ISettingsProvider.h:113
Type
Value type.
Definition ISettingsProvider.h:163
@ ULong
std::uint64_t.
Definition ISettingsProvider.h:169
@ Int1
Integer.
Definition ISettingsProvider.h:165
@ Float4
4D floating point.
Definition ISettingsProvider.h:173
@ Undefined
Unkown value type.
Definition ISettingsProvider.h:164
@ Int3
3D integer.
Definition ISettingsProvider.h:167
@ Float3
3D floating point.
Definition ISettingsProvider.h:172
@ Int4
4D integer.
Definition ISettingsProvider.h:168
@ Float2
2D floating point.
Definition ISettingsProvider.h:171
@ Int2
2D integer.
Definition ISettingsProvider.h:166
@ Float1
floating point.
Definition ISettingsProvider.h:170
Value() noexcept
Initialize an empty value.
SDK settings provider interface.
Definition ISettingsProvider.h:32
Error
Config parsing error codes.
Definition ISettingsProvider.h:37
virtual const char * getDefaultPath() const noexcept=0
Get settings path this provider is bound to.
A structure that encapsulates an action result enumeration.
Definition Result.h:27
Addon for Result to output some value aside the result. Specialization for copiable types.
Definition ResultValue.h:21
Value data.
Definition ISettingsProvider.h:118