Skip to content
Snippets Groups Projects
Commit 1ef3e745 authored by Stefan Spettel's avatar Stefan Spettel
Browse files

feat(model): add to_string methods for UDM

parent 0d1c5a36
No related branches found
No related tags found
2 merge requests!29Fix UDM common models,!27Add curl timeout parameter
This commit is part of merge request !27. Comments created here will be created in the context of that merge request.
......@@ -141,6 +141,19 @@ bool fromStringValue(const std::string& inStr, double& value) {
return true;
}
bool fromStringValue(
const std::string& inStr, oai::model::common::PlmnId& value) {
nlohmann::json json_value = nlohmann::json::parse(inStr);
from_json(json_value, value);
return true;
}
bool fromStringValue(
const std::string& inStr, oai::model::common::Snssai& value) {
nlohmann::json json_value = nlohmann::json::parse(inStr);
from_json(json_value, value);
return true;
}
bool validate_regex(
const std::string& regex, const std::string& value, std::stringstream& msg,
const std::string& pathPrefix) {
......
......@@ -25,6 +25,8 @@
#include <vector>
#include <map>
#include <nlohmann/json.hpp>
#include "PlmnId.h"
#include "Snssai.h"
namespace oai::model::common::helpers {
......@@ -105,6 +107,11 @@ bool fromStringValue(const std::string& inStr, int64_t& value);
bool fromStringValue(const std::string& inStr, bool& value);
bool fromStringValue(const std::string& inStr, float& value);
bool fromStringValue(const std::string& inStr, double& value);
bool fromStringValue(
const std::string& inStr, oai::model::common::PlmnId& value);
bool fromStringValue(
const std::string& inStr, oai::model::common::Snssai& value);
template<typename T>
bool fromStringValue(
const std::vector<std::string>& inStr, std::vector<T>& value) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment