aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/skottie/SkottieParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/skottie/SkottieParser.h')
-rw-r--r--experimental/skottie/SkottieParser.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/experimental/skottie/SkottieParser.h b/experimental/skottie/SkottieParser.h
new file mode 100644
index 0000000000..b805484cd0
--- /dev/null
+++ b/experimental/skottie/SkottieParser.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkottieParser_DEFINED
+#define SkottieParser_DEFINED
+
+namespace Json { class Value; }
+
+namespace skottie {
+
+template <typename T>
+bool Parse(const Json::Value&, T*);
+
+template <typename T>
+static inline T ParseDefault(const Json::Value& jv, const T& defaultValue) {
+ T v;
+ if (!Parse<T>(jv, &v))
+ v = defaultValue;
+ return v;
+}
+
+} // nasmespace skottie
+
+#endif // SkottieParser_DEFINED