diff options
Diffstat (limited to 'veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp')
-rw-r--r-- | veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp new file mode 100644 index 0000000..efe73aa --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp @@ -0,0 +1,42 @@ +#include "XCodecsInUseImp.h" + +XCodecsInUseImp::XCodecsInUseImp(const XString& codecIdentifier, + XInteger numberInUse): + codecIdentifier_(codecIdentifier), + numberInUse_(numberInUse) +{ + +} + +void XCodecsInUseImp::setCodecIdentifier(const XString& codecIdentifier) +{ + comVals_["codecIdentifier"] = codecIdentifier; +} + +void XCodecsInUseImp::setNumberInUse(XInteger numberInUse) +{ + comVals_["numberInUse"] = numberInUse; +} + +json XCodecsInUseImp::toJson() +{ + try + { + json field = { + {"codecIdentifier", codecIdentifier_}, + {"numberInUse", numberInUse_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XCodecsInUse to json object:{}.", e.what()); + return json(); + } +} +
\ No newline at end of file |