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;
197 Value(
int x,
int y,
int z) noexcept;
206 Value(
int x,
int y,
int z,
int w) noexcept;
226 Value(
float x,
float y,
float z) noexcept;
235 Value(
float x,
float y,
float z,
float w) noexcept;
272 operator
bool() const noexcept;
279 bool is(
Type type) const noexcept;
286 bool setString(const
char*
string) noexcept;
294 bool getString(
char*
string) const noexcept;
301 void setRect(const
Rect& rect) noexcept;
310 bool getRect(
Rect* rect) const noexcept;
317 void setSize(const
Size& size) noexcept;
326 bool getSize(
Size* size) const noexcept;
333 void setPoint2i(const
Point2i& point) noexcept;
342 bool getPoint2i(
Point2i* point) const noexcept;
349 void setPoint2f(const
Point2f& point) noexcept;
358 bool getPoint2f(
Point2f* point) const noexcept;
364 void setBool(
bool x) noexcept;
373 bool getBool(
bool* x) const noexcept;
380 void setInt(
int x) noexcept;
388 bool getInt(
int* x) const noexcept;
396 void setInt(
int x,
int y) noexcept;
406 bool getInt(
int* x,
int* y) const noexcept;
415 void setInt(
int x,
int y,
int z) noexcept;
426 bool getInt(
int* x,
int* y,
int* z) const noexcept;
436 void setInt(
int x,
int y,
int z,
int w) noexcept;
448 bool getInt(
int* x,
int* y,
int* z,
int* w) const noexcept;
455 void setFloat(
float x) noexcept;
463 bool getFloat(
float* x) const noexcept;
471 void setFloat(
float x,
float y) noexcept;
481 bool getFloat(
float* x,
float* y) const noexcept;
490 void setFloat(
float x,
float y,
float z) noexcept;
501 bool getFloat(
float* x,
float* y,
float* z) const noexcept;
511 void setFloat(
float x,
float y,
float z,
float w) noexcept;
523 bool getFloat(
float* x,
float* y,
float* z,
float* w) const noexcept;
532 float asFloat(
float defaultValue = 0.f) const noexcept;
552 bool asBool(
bool defaultValue = false) const noexcept;
561 int asInt(
int defaultValue = 0) const noexcept;
601 const
char* asString(const
char* defaultValue = "") const noexcept;
606 inline
Value& operator=(const
Value& other) = delete;
625 Key(const
char* section, const
char* parameter) noexcept;
631 const
char* getSection() const noexcept;
637 const
char* getParameter() const noexcept;
643 void setSection(const
char* section) noexcept;
649 void setParameter(const
char* parameter) noexcept;
659 static const
unsigned int m_bufferLength = 128;
660 char m_section[m_bufferLength];
661 char m_parameter[m_bufferLength];
674 Desc(const
char* desc) noexcept;
680 const
char* getDesc() const noexcept;
686 void setDesc(const
char* desc) noexcept;
689 static const
unsigned int m_bufferLength = 256;
690 char m_desc[m_bufferLength];
718 void setDesc(const
Desc& desc) noexcept;
724 void setValue(
Value&& value) noexcept;
730 const
Desc& getDesc() const noexcept;
736 const
Value& getValue() const noexcept;
746 virtual
void setDesc(const
Key& key, const
Desc& desc) noexcept = 0;
756 void setDesc(const
char* section, const
char* parameter, const
Desc& desc) noexcept;
765 virtual
void setValue(const
Key& key,
Value&& value) noexcept = 0;
775 void setValue(const
char* section, const
char* parameter,
Value&& value) noexcept;
784 virtual
void setEntry(const
Key& key,
Entry&& entry) noexcept = 0;
794 void setEntry(const
Key& key, const
Desc& desc,
Value&& value) noexcept;
805 void setEntry(const
char* section, const
char* parameter, const
Desc& desc,
Value&& value) noexcept;
814 virtual const
Entry& getEntry(const
Key& key) const noexcept = 0;
833 Desc getDesc(const
char* section, const
char* parameter) const noexcept;
842 const
Value& getValue(const
Key& key) const noexcept;
852 const
Value& getValue(const
char* section, const
char* parameter) const noexcept;
861 createSettingsProvider(const
char* path) noexcept;
870 createSettingsProviderFromString(const
char* content) noexcept;
879 return error == ISettingsProvider::Error::Ok;
884 case ISettingsProvider::Error::Ok:
886 case ISettingsProvider::Error::Memory:
887 return "Could not allocate memory";
888 case ISettingsProvider::Error::IOError:
889 return "Error reading from file";
890 case ISettingsProvider::Error::Internal:
891 return "Internal error";
892 case ISettingsProvider::Error::InvalidPi:
893 return "Error during document declaration/processing instruction parsing";
894 case ISettingsProvider::Error::InvalidTag:
895 return "Parser could not determine tag type";
896 case ISettingsProvider::Error::InvalidCdata:
897 return "Error during CDATA section parsing";
898 case ISettingsProvider::Error::FileNotFound:
899 return "File was not found";
900 case ISettingsProvider::Error::InvalidPcdata:
901 return "Error during PCDATA section parsing";
902 case ISettingsProvider::Error::InvalidComment:
903 return "Error during comment parsing";
904 case ISettingsProvider::Error::InvalidDocType:
905 return "Error during document type declaration parsing";
906 case ISettingsProvider::Error::InvalidSettings:
907 return "Settings sections is invalid or absent";
908 case ISettingsProvider::Error::InvalidAttribute:
909 return "Error during element attribute parsing";
910 case ISettingsProvider::Error::InvalidEndElement:
911 return "Error during end element tag parsing";
912 case ISettingsProvider::Error::AppendInvalidRoot:
913 return "Root type is not node_element or node_document";
914 case ISettingsProvider::Error::NoDocumentElement:
915 return "Document without element nodes";
916 case ISettingsProvider::Error::EndElementMismatch:
917 return "Mismatch of start-end tags";
918 case ISettingsProvider::Error::InvalidStartElement:
919 return "Error during start element tag parsing";
921 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:665
Desc() noexcept
Initialize an empty description.
Configuration parameter entry.
Definition ISettingsProvider.h:694
Entry() noexcept=default
Initialize an empty entry.
Desc m_desc
Parameter description.
Definition ISettingsProvider.h:697
Value m_value
Parameter value.
Definition ISettingsProvider.h:696
Configuration parameter key.
Definition ISettingsProvider.h:615
Key() noexcept
Initialize an empty key.
Definition ISettingsProvider.h:135
Definition ISettingsProvider.h:139
Definition ISettingsProvider.h:143
Definition ISettingsProvider.h:147
Definition ISettingsProvider.h:119
Definition ISettingsProvider.h:123
Definition ISettingsProvider.h:127
Definition ISettingsProvider.h:131
Definition ISettingsProvider.h:151
Configuration parameter value.
Definition ISettingsProvider.h:113
Type
Value type.
Definition ISettingsProvider.h:159
@ Int1
Integer.
Definition ISettingsProvider.h:161
@ Float4
4D floating point.
Definition ISettingsProvider.h:168
@ Undefined
Unkown value type.
Definition ISettingsProvider.h:160
@ Int3
3D integer.
Definition ISettingsProvider.h:163
@ Float3
3D floating point.
Definition ISettingsProvider.h:167
@ Int4
4D integer.
Definition ISettingsProvider.h:164
@ Float2
2D floating point.
Definition ISettingsProvider.h:166
@ Int2
2D integer.
Definition ISettingsProvider.h:162
@ Float1
floating point.
Definition ISettingsProvider.h:165
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