Flutter Engine
The Flutter Engine
SkottieJson.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkottieJson_DEFINED
9#define SkottieJson_DEFINED
10
11namespace skjson {
12class ObjectValue;
13class StringValue;
14class Value;
15} // namespace skjson
16
17namespace skottie {
18
19template <typename T>
20bool Parse(const skjson::Value&, T*);
21
22template <typename T>
23T ParseDefault(const skjson::Value& v, const T& defaultValue) {
24 T res;
25 if (!Parse<T>(v, &res)) {
26 res = defaultValue;
27 }
28 return res;
29}
30
32
33} // namespace skottie
34
35#endif // SkottieJson_DEFINED
T ParseDefault(const skjson::Value &v, const T &defaultValue)
Definition: SkottieJson.h:23
bool Parse(const skjson::Value &, T *)
const skjson::StringValue * ParseSlotID(const skjson::ObjectValue *jobj)
#define T
Definition: precompiler.cc:65