7d42c44cdd
Convert to SkJSON APIs and remove RapidJSON dependency. TBR= Change-Id: I5b4fd78821a443326e3a5b370748d840b80ef279 Reviewed-on: https://skia-review.googlesource.com/134612 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
35 lines
608 B
C++
35 lines
608 B
C++
/*
|
|
* 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 SkottieJson_DEFINED
|
|
#define SkottieJson_DEFINED
|
|
|
|
#include "SkJSON.h"
|
|
#include "SkRefCnt.h"
|
|
|
|
class SkData;
|
|
class SkStream;
|
|
class SkString;
|
|
|
|
namespace skottie {
|
|
|
|
template <typename T>
|
|
bool Parse(const skjson::Value&, T*);
|
|
|
|
template <typename T>
|
|
T ParseDefault(const skjson::Value& v, const T& defaultValue) {
|
|
T res;
|
|
if (!Parse<T>(v, &res)) {
|
|
res = defaultValue;
|
|
}
|
|
return res;
|
|
}
|
|
|
|
} // namespace skottie
|
|
|
|
#endif // SkottieJson_DEFINED
|