3#include "VaultRecordRef.h"
4#include "VaultParamInput.hpp"
12 static_assert(!std::is_array<T>::value,
"It is not possible to use a c array as a key value. \n\
13 If you want to use a string as a key, you must specialize the function with a string. Like this: \n\
14 SetData<std::string>(\"Key\", \"Value\") or SetData(\"Key\", std::string(\"Value\"))");
18 res.RequestedType =
typeid(
T);
20 if (VaultRecordPtr ==
nullptr)
22 res.IsOperationSuccess =
false;
30 if (!VaultRecordPtr->GetIsValid())
32 res.IsOperationSuccess =
false;
37 res = Vlt->SetDataToRecord(VaultRecordPtr,
key,
data);
45 static_assert(!std::is_array<T>::value,
"It is not possible to use a c array as a key value. \n\
46 If you want to use a string as a key, you must specialize the function with a string. Like this: \n\
47 GetData<std::string>(\"Key\", \"Value\") or GetData(\"Key\", std::string(\"Value\"))");
52 res.RequestedType =
typeid(
T);
55 if (VaultRecordPtr ==
nullptr)
57 res.IsOperationSuccess =
false;
66 if (!VaultRecordPtr->GetIsValid())
68 res.IsOperationSuccess =
false;
74 if(!Vlt->GetKeyType(
key,
res.SavedType))
76 res.IsOperationSuccess =
false;
82 if (
res.SavedType !=
res.RequestedType)
84 res.IsOperationSuccess =
false;
89 VaultRecordPtr->GetData(
key,
data);
90 res.IsOperationSuccess =
true;
Iterator class for all library maps.
Definition Map.h:18
VaultOperationResult SetData(const std::string &key, const T &data) noexcept
Method for updating data inside Vault.
Definition VaultRecordRef.hpp:10
VaultOperationResult GetData(const std::string &key, T &data) const noexcept
A method for getting data using a key.
Definition VaultRecordRef.hpp:43
@ Success
This value is returned when the request was completely successful.
@ DataRecordNotValid
This code is returned when data is requested from the VaultRecordRef and the record it refers to is n...
@ WrongKey
This code is returned when the requested key has not been found.
@ WrongType
This code is returned when the requested type does not match the saved type.
Structure for storing the results of MVault operations.
Definition VaultOperationResult.h:40