3#include "VaultRecordRef.h"
4#include "VaultParamInput.hpp"
14 static_assert(!std::is_array<T>::value,
"It is not possible to use a c array as a key value. \n\
15 If you want to use a string as a key, you must specialize the function with a string. Like this: \n\
16 SetData<std::string>(\"Key\", \"Value\") or SetData(\"Key\", std::string(\"Value\"))");
20 res.RequestedType =
typeid(
T);
22 if (VaultRecordPtr ==
nullptr)
24 res.IsOperationSuccess =
false;
32 if (!VaultRecordPtr->GetIsValid())
34 res.IsOperationSuccess =
false;
39 res = Vlt->SetDataToRecord(VaultRecordPtr,
key,
data);
49 static_assert(!std::is_array<T>::value,
"It is not possible to use a c array as a key value. \n\
50 If you want to use a string as a key, you must specialize the function with a string. Like this: \n\
51 GetData<std::string>(\"Key\", \"Value\") or GetData(\"Key\", std::string(\"Value\"))");
56 res.RequestedType =
typeid(
T);
59 if (VaultRecordPtr ==
nullptr)
61 res.IsOperationSuccess =
false;
70 if (!VaultRecordPtr->GetIsValid())
72 res.IsOperationSuccess =
false;
78 if(!Vlt->GetKeyType(
key,
res.SavedType))
80 res.IsOperationSuccess =
false;
86 if (
res.SavedType !=
res.RequestedType)
88 res.IsOperationSuccess =
false;
93 VaultRecordPtr->GetData(
key,
data);
94 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:45
@ 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:44