summaryrefslogtreecommitdiff
path: root/src/components/smart_objects/include/smart_objects/smart_object.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/smart_objects/include/smart_objects/smart_object.h')
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/components/smart_objects/include/smart_objects/smart_object.h b/src/components/smart_objects/include/smart_objects/smart_object.h
index 98e58fffd1..cc2bc7e22c 100644
--- a/src/components/smart_objects/include/smart_objects/smart_object.h
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -40,6 +40,7 @@
#include "smart_objects/smart_schema.h"
#include "utils/custom_string.h"
+#include "rpc_base/validation_report.h"
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
@@ -670,11 +671,20 @@ class SmartObject FINAL {
bool isValid() const;
/**
+ * @deprecated
* @brief Validates object according to attached schema.
*
* @return Result of validation.
*/
- Errors::eType validate();
+ DEPRECATED Errors::eType validate();
+
+ /**
+ * @brief Validates object according to attached schema.
+ *
+ * @param report__ object for reporting errors during validation
+ * @return Result of validation.
+ */
+ Errors::eType validate(rpc::ValidationReport* report__);
/**
* @brief Sets new schema
@@ -727,6 +737,35 @@ class SmartObject FINAL {
return !(*this == Other);
}
+ static std::string typeToString(SmartType type) {
+ switch (type) {
+ case SmartType_Null:
+ return "Null";
+ case SmartType_Boolean:
+ return "Boolean";
+ case SmartType_Integer:
+ return "Integer";
+ case SmartType_Character:
+ return "Character";
+ case SmartType_String:
+ return "String";
+ case SmartType_Double:
+ return "Double";
+ case SmartType_Map:
+ return "Object";
+ case SmartType_Array:
+ return "Array";
+ case SmartType_Binary:
+ return "Binary_Data";
+ case SmartType_UInteger:
+ return "Unsigned_Integer";
+ case SmartType_Invalid:
+ return "Invalid_Type";
+ default:
+ return "Unknown_Type";
+ }
+ }
+
protected:
static std::string OperatorToTransform(const SmartMap::value_type& pair);
/**