diff options
Diffstat (limited to 'veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp')
-rwxr-xr-x | veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp new file mode 100755 index 0000000..a32ae1e --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp @@ -0,0 +1,22 @@ +#include "XInternal.h" + +json vagt::encode::mergeCommonValues(json jsonObj, const std::map<std::string, XCommonValue>& values) +{ + for (auto it : values) + { + if (XDataTypeInteger == it.second.dataType_) + { + jsonObj[it.first] = it.second.intVal_; + } + else if (XDataTypeNumber == it.second.dataType_) + { + jsonObj[it.first] = it.second.numberVal_; + } + else if (XDataTypeString == it.second.dataType_) + { + jsonObj[it.first] = it.second.strVal_; + } + } + + return jsonObj; +} |