Inherits AZ::SettingsRegistryInterface.
|
|
| AZ_CLASS_ALLOCATOR (SettingsRegistryImpl, AZ::OSAllocator) |
| |
|
| AZ_RTTI (AZ::SettingsRegistryImpl, "{E9C34190-F888-48CA-83C9-9F24B4E21D72}", AZ::SettingsRegistryInterface) |
| |
| | SettingsRegistryImpl (bool useFileIo) |
| |
|
| AZ_DISABLE_COPY_MOVE (SettingsRegistryImpl) |
| |
|
void | SetContext (SerializeContext *context) |
| |
|
void | SetContext (JsonRegistrationContext *context) |
| |
| SettingsType | GetType (AZStd::string_view path) const override |
| | Returns the type of an entry in the Settings Registry or Type::None if there's no value or the path is invalid.
|
| |
| bool | Visit (Visitor &visitor, AZStd::string_view path) const override |
| |
| bool | Visit (const VisitorCallback &callback, AZStd::string_view path) const override |
| |
| NotifyEventHandler | RegisterNotifier (NotifyCallback callback) override |
| |
| void | RegisterNotifier (NotifyEventHandler &hanlder) override |
| |
|
void | ClearNotifiers () |
| |
| PreMergeEventHandler | RegisterPreMergeEvent (PreMergeEventCallback callback) override |
| |
| void | RegisterPreMergeEvent (PreMergeEventHandler &handler) override |
| |
| PostMergeEventHandler | RegisterPostMergeEvent (PostMergeEventCallback callback) override |
| |
| void | RegisterPostMergeEvent (PostMergeEventHandler &handler) override |
| |
|
void | ClearMergeEvents () |
| |
| bool | Get (bool &result, AZStd::string_view path) const override |
| |
| bool | Get (s64 &result, AZStd::string_view path) const override |
| |
| bool | Get (u64 &result, AZStd::string_view path) const override |
| |
| bool | Get (double &result, AZStd::string_view path) const override |
| |
| bool | Get (AZStd::string &result, AZStd::string_view path) const override |
| |
| bool | Get (SettingsRegistryInterface::FixedValueString &result, AZStd::string_view path) const override |
| |
| bool | GetObject (void *result, AZ::Uuid resultTypeID, AZStd::string_view path) const override |
| |
| bool | Set (AZStd::string_view path, bool value) override |
| |
| bool | Set (AZStd::string_view path, s64 value) override |
| |
| bool | Set (AZStd::string_view path, u64 value) override |
| |
| bool | Set (AZStd::string_view path, double value) override |
| |
| bool | Set (AZStd::string_view path, AZStd::string_view value) override |
| |
| bool | Set (AZStd::string_view path, const char *value) override |
| |
| bool | SetObject (AZStd::string_view path, const void *value, AZ::Uuid valueTypeID) override |
| |
| bool | Remove (AZStd::string_view path) override |
| |
| bool | MergeCommandLineArgument (AZStd::string_view argument, AZStd::string_view anchorKey, const CommandLineArgumentSettings &commandLineSettings) override |
| |
| MergeSettingsResult | MergeSettings (AZStd::string_view data, Format format, AZStd::string_view anchorKey="") override |
| |
| MergeSettingsResult | MergeSettingsFile (AZStd::string_view path, Format format, AZStd::string_view anchorKey="", AZStd::vector< char > *scratchBuffer=nullptr) override |
| |
| MergeSettingsResult | MergeSettingsFolder (AZStd::string_view path, const Specializations &specializations, AZStd::string_view platform, AZStd::string_view anchorKey="", AZStd::vector< char > *scratchBuffer=nullptr) override |
| |
| void | SetNotifyForMergeOperations (bool notify) override |
| |
| bool | GetNotifyForMergeOperations () const override |
| |
| void | SetUseFileIO (bool useFileIo) override |
| |
|
| AZ_RTTI (AZ::SettingsRegistryInterface, "{D62619D8-0C0B-4D9F-9FE8-F8EBC330DC55}") |
| |
|
| AZ_DISABLE_COPY_MOVE (SettingsRegistryInterface) |
| |
| template<typename T > |
| bool | GetObject (T &result, AZStd::string_view path) const |
| |
| template<typename T > |
| bool | SetObject (AZStd::string_view path, const T &value) |
| |
|
| enum class | Type {
NoType
, Null
, Boolean
, Integer
,
FloatingPoint
, String
, Array
, Object
} |
| | Type of the store value, or None if there's no value stored.
|
| |
| enum class | Signedness { None
, Signed
, Unsigned
} |
| | Type of an integer.
|
| |
| enum class | VisitResponse { Continue
, Skip
, Done
} |
| | The response to let the visit call know what to do next. More...
|
| |
| enum class | VisitAction { Begin
, Value
, End
} |
| | The action the visit call is taken. More...
|
| |
| enum class | Format { JsonPatch
, JsonMergePatch
} |
| | File formats supported to load settings from. More...
|
| |
| enum class | MergeSettingsReturnCode { Unset = 0
, Success = 1
, PartialSuccess
, Failure = -1
} |
| |
| using | FixedValueString = AZ::StringFunc::Path::FixedString |
| |
|
using | FilenameTags = Specializations |
| |
|
using | NotifyCallback = AZStd::function< void(const NotifyEventArgs ¬ifierArgs)> |
| |
|
using | NotifyEvent = AZ::Event< const NotifyEventArgs & > |
| |
|
using | NotifyEventHandler = typename NotifyEvent::Handler |
| |
|
using | PreMergeEventCallback = AZStd::function< void(const MergeEventArgs &)> |
| |
|
using | PostMergeEventCallback = AZStd::function< void(const MergeEventArgs &)> |
| |
|
using | PreMergeEvent = AZ::Event< const MergeEventArgs & > |
| |
|
using | PostMergeEvent = AZ::Event< const MergeEventArgs & > |
| |
|
using | PreMergeEventHandler = typename PreMergeEvent::Handler |
| |
|
using | PostMergeEventHandler = typename PostMergeEvent::Handler |
| |
|
using | VisitorCallback = AZStd::function< VisitResponse(const VisitArgs &, VisitAction action)> |
| |
◆ SettingsRegistryImpl()
| AZ::SettingsRegistryImpl::SettingsRegistryImpl |
( |
bool |
useFileIo | ) |
|
|
explicit |
- Parameters
-
| useFileIo | - If true attempt to redirect file read operations through the FileIOBase instance first before falling back to SystemFile otherwise always use SystemFile |
◆ Get() [1/6]
Gets the string value at the provided path.
- Parameters
-
| result | The target to write the result to. |
| path | The path to the value. |
- Returns
- Whether or not the value was retrieved. An invalid path or type-mismatch will return false;
Implements AZ::SettingsRegistryInterface.
◆ Get() [2/6]
Gets the boolean value at the provided path.
- Parameters
-
| result | The target to write the result to. |
| path | The path to the value. |
- Returns
- Whether or not the value was retrieved. An invalid path or type-mismatch will return false;
Implements AZ::SettingsRegistryInterface.
◆ Get() [3/6]
Gets the floating point value at the provided path.
- Parameters
-
| result | The target to write the result to. |
| path | The path to the value. |
- Returns
- Whether or not the value was retrieved. An invalid path or type-mismatch will return false;
Implements AZ::SettingsRegistryInterface.
◆ Get() [4/6]
Gets the integer value at the provided path.
- Parameters
-
| result | The target to write the result to. |
| path | The path to the value. |
- Returns
- Whether or not the value was retrieved. An invalid path or type-mismatch will return false;
Implements AZ::SettingsRegistryInterface.
◆ Get() [5/6]
◆ Get() [6/6]
◆ GetNotifyForMergeOperations()
| bool AZ::SettingsRegistryImpl::GetNotifyForMergeOperations |
( |
| ) |
const |
|
overridevirtual |
◆ GetObject()
Gets the object value at the provided path serialized to the target struct/class. Classes retrieved through this call needs to be registered with the Serialize Context. Prefer to use GetObject(T& result, AZStd::string_view path) over this one.
- Parameters
-
| result | The target to write the result to. |
| resultTypeId | The type id of the target that's being written to. |
| path | The path to the value. |
- Returns
- Whether or not the value was stored. An invalid path will return false;
Implements AZ::SettingsRegistryInterface.
◆ GetType()
Returns the type of an entry in the Settings Registry or Type::None if there's no value or the path is invalid.
Implements AZ::SettingsRegistryInterface.
◆ MergeCommandLineArgument()
Merges a single command line argument into the settings registry. Command line arguments take the form of <path>=
for instance: "/My/Path=My string value" Values are interpreted as follows:
- "true" (case sensitive) -> boolean with true value
- "false" (case sensitive) -> boolean with false value
- all digits -> number
- all digits and dot -> floating point number
- Everything else is considered a string.
- Parameters
-
| argument | The command line argument. |
| anchorKey | The key where the merged command line argument will be anchored under |
| commandLineSettings | structure which contains functors which determine what characters are delimiters |
- Returns
- True if the command line argument could be parsed, otherwise false.
Implements AZ::SettingsRegistryInterface.
◆ MergeSettings()
Merges the json data provided into the settings registry.
- Parameters
-
| data | The json data stored in a string. |
| format | The format of the provided data. |
| anchorKey | The key where the merged json content will be anchored under. |
- Returns
- MergeSettingsResult value that is convertible to bool(true) if the data was successfully merged. If the json string was not merged successfully, the
MergeSettingsResult::GetMessages() function contains messages around why the operation has failed.
Implements AZ::SettingsRegistryInterface.
◆ MergeSettingsFile()
Loads a settings file and merges it into the registry.
- Parameters
-
| path | The path to the registry file. |
| format | The format of the text data in the file at the provided path. |
| anchorKey | The key where the content of the settings file will be anchored. |
| scratchBuffer | An optional buffer that's used to load the file into. Use this when loading multiple patches to reduce the number of intermediate memory allocations. |
- Returns
- MergeSettingsResult value that is convertible to bool(true) if the registry file was successfully merged. If the file is is not merged successfully the MergeSettingsResult messages structure will be populated with error messages of why the operation failed
Implements AZ::SettingsRegistryInterface.
◆ MergeSettingsFolder()
Loads all settings files in a folder and merges them into the registry. With the specializations "a" and "b" and platform "c" the files would be loaded in the order:
- file1.setreg
- Platform/c/file1.setreg
- file1.a.setreg
- Platform/c/file.b.setreg
- file1.a.b.setreg
- file2.setreg
- Parameters
-
| path | The path to the registry folder. |
| specializations | The specializations that will be used filter out registry files. |
| platform | An optional name of a platform. Platform overloads are located at <path>/Platform/<platform>/ Files in a platform are applied in the same order as for the main folder but always after the same file in the main folder. |
| anchorKey | The registry path location where the settings will be anchored |
| scratchBuffer | An optional buffer that's used to load the file into. Use this when loading multiple patches to reduce the number of intermediate memory allocations. |
- Returns
- MergeSettingsResult value that is convertible to bool(true) if the registry folder was successfully merged.
Implements AZ::SettingsRegistryInterface.
◆ RegisterNotifier() [1/2]
| NotifyEventHandler AZ::SettingsRegistryImpl::RegisterNotifier |
( |
NotifyCallback |
callback | ) |
|
|
overridevirtual |
Register a callback that will be called whenever an entry gets a new/updated value.
@callback The function to call when an entry gets a new/updated value.
- Returns
- NotifyEventHandler instance which must persist to receive event signal
Implements AZ::SettingsRegistryInterface.
◆ RegisterNotifier() [2/2]
| void AZ::SettingsRegistryImpl::RegisterNotifier |
( |
NotifyEventHandler & |
handler | ) |
|
|
overridevirtual |
Register a notify event handler with the NotifyEvent. The handler will be called whenever an entry gets a new/updated value.
- Parameters
-
| handler | The handler to register with the NotifyEvent. |
Implements AZ::SettingsRegistryInterface.
◆ RegisterPostMergeEvent() [1/2]
Register a function that will be called after a file is merged.
- Parameters
-
| callback | The function to call after a file is merged. |
- Returns
- PostMergeEventHandler instance which must persist to receive event signal
Implements AZ::SettingsRegistryInterface.
◆ RegisterPostMergeEvent() [2/2]
| void AZ::SettingsRegistryImpl::RegisterPostMergeEvent |
( |
PostMergeEventHandler & |
handler | ) |
|
|
overridevirtual |
Register a post-merge hahndler with the PostMergeEvent. The handler will be called after a file is merged.
- Parameters
-
| handler | The handler to register with the PostmergeEVent. |
Implements AZ::SettingsRegistryInterface.
◆ RegisterPreMergeEvent() [1/2]
Register a function that will be called before a file is merged.
- Parameters
-
| callback | The function to call before a file is merged. |
- Returns
- PreMergeEventHandler instance which must persist to receive event signal
Implements AZ::SettingsRegistryInterface.
◆ RegisterPreMergeEvent() [2/2]
| void AZ::SettingsRegistryImpl::RegisterPreMergeEvent |
( |
PreMergeEventHandler & |
handler | ) |
|
|
overridevirtual |
Register a pre-merge handler with the PreMergeEvent. The handler will be called before a file is merged.
- Parameters
-
| handler | The hanlder to register with the PreMergeEvent. |
Implements AZ::SettingsRegistryInterface.
◆ Remove()
Remove the value at the provided path
- Parameters
-
| path | The path to a value that should be removed |
- Returns
- Whether or not the path was found and removed. An invalid path will return false;
Implements AZ::SettingsRegistryInterface.
◆ Set() [1/6]
Sets or replaces the string value at the provided path.
- Parameters
-
| path | The path to the value. |
| value | The new value to store. |
- Returns
- Whether or not the value was stored. An invalid path will return false;
Implements AZ::SettingsRegistryInterface.
◆ Set() [2/6]
Sets or replaces the boolean value at the provided path.
- Parameters
-
| path | The path to the value. |
| value | The new value to store. |
- Returns
- Whether or not the value was stored. An invalid path will return false;
Implements AZ::SettingsRegistryInterface.
◆ Set() [3/6]
Sets or replaces the string value at the provided path. Note that this overload was added as the compiler considers boolean a more closer match than string_view.
- Parameters
-
| path | The path to the value. |
| value | The new value to store. |
- Returns
- Whether or not the value was stored. An invalid path will return false;
Implements AZ::SettingsRegistryInterface.
◆ Set() [4/6]
Sets or replaces the floating point value at the provided path.
- Parameters
-
| path | The path to the value. |
| value | The new value to store. |
- Returns
- Whether or not the value was stored. An invalid path will return false;
Implements AZ::SettingsRegistryInterface.
◆ Set() [5/6]
Sets or replaces the integer value at the provided path.
- Parameters
-
| path | The path to the value. |
| value | The new value to store. |
- Returns
- Whether or not the value was stored. An invalid path will return false;
Implements AZ::SettingsRegistryInterface.
◆ Set() [6/6]
◆ SetNotifyForMergeOperations()
| void AZ::SettingsRegistryImpl::SetNotifyForMergeOperations |
( |
bool |
notify | ) |
|
|
overridevirtual |
Indicates whether the Merge functions should send notification events for individual operations using JSON Patch or JSON Merge Patch.
- Parameters
-
| notify | If true, the patching operations are forwarded through the NotifyEvent |
Implements AZ::SettingsRegistryInterface.
◆ SetObject()
Sets the value at the provided path to the serialized version of the provided struct/class. Classes used for this call need to be registered with the Serialize Context. Prefer to use SetObject(AZStd::string_view path, const T& result) over this one.
- Parameters
-
| path | The path to the value. |
| value | The new value to store. |
| valueTypeId | The type id of the target that's being stored. |
- Returns
- Whether or not the value was stored. An invalid path will return false;
Implements AZ::SettingsRegistryInterface.
◆ SetUseFileIO()
| void AZ::SettingsRegistryImpl::SetUseFileIO |
( |
bool |
useFileIo | ) |
|
|
overridevirtual |
Stores option to indicate whether the FileIOBase instance should be used for file operations
- Parameters
-
| useFileIo | If true the FileIOBase instance will attempted to be used for FileIOBase operations before falling back to use SystemFile |
Implements AZ::SettingsRegistryInterface.
◆ Visit() [1/2]
Traverses over the entries in the Settings Registry. Use this version if only the names and/or types are needed.
- Parameters
-
| callback | A callback function that will repeatedly be called as entries are encountered. |
| path | An offset at which traversal should start. |
- Returns
- Whether or not entries could be visited.
Implements AZ::SettingsRegistryInterface.
◆ Visit() [2/2]
Traverses over the entries in the Settings Registry. Use this version to retrieve the values of entries as well.
- Parameters
-
| visitor | An instance of a class derived from Visitor that will repeatedly be called as entries are encountered. |
| path | An offset at which traversal should start. |
- Returns
- Whether or not entries could be visited.
Implements AZ::SettingsRegistryInterface.
The documentation for this class was generated from the following file:
- Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.h