buffet: Adding GCD command definition schema - phase 1.
Initial implementation of GCD command definition schema
and parsing command definition provided as JSON.
This change introduces the class hierarchy to describe
parameter type description (ParamType-derived classes),
parameter values (ParamValue-derived classes), constraints,
and general object schema which is a collection of
parameter definition for an object which corresponds
almost directly into a GCD command definition.
Object definition parsing from JSON is implemented
as well as validation of parameter values with rich
error reporting.
This is a basis for future command definition implementation
and device draft definition for GCD devices.
BUG=chromium:374860
TEST=Unit tests pass
Change-Id: I82d185b155956ff31a2d2e33f75bec9605ef32ee
Reviewed-on: https://chromium-review.googlesource.com/201159
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/commands/prop_values.cc b/buffet/commands/prop_values.cc
new file mode 100644
index 0000000..e2eabc0
--- /dev/null
+++ b/buffet/commands/prop_values.cc
@@ -0,0 +1,23 @@
+// Copyright 2014 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "buffet/commands/prop_values.h"
+
+#include <memory>
+
+#include <base/values.h>
+
+#include "buffet/commands/prop_types.h"
+
+namespace buffet {
+
+// Specializations of generic GetValueType<T>() for supported C++ types.
+template<> ValueType GetValueType<int>() { return ValueType::Int; }
+template<> ValueType GetValueType<double>() { return ValueType::Double; }
+template<> ValueType GetValueType<std::string>() { return ValueType::String; }
+template<> ValueType GetValueType<bool>() { return ValueType::Boolean; }
+
+PropValue::~PropValue() {}
+
+} // namespace buffet