Lines Matching refs:skjson
69 SkFromJsonVisitor(const skjson::Value& v) : fRoot(v) {
83 if (const skjson::ArrayValue* lines = get(name)) {
86 for (const skjson::StringValue* line : *lines) {
101 const skjson::StringValue* typeString = get("Type");
107 fStack.push_back((const skjson::ObjectValue*)get(name));
114 const skjson::ArrayValue* arrVal = get(name);
126 const skjson::Value& get(const char* name) {
127 if (const skjson::Value* cur = fStack.back()) {
128 if (cur->is<skjson::ArrayValue>()) {
130 return cur->as<skjson::ArrayValue>()[fArrayIndexStack.back()++];
133 } else if (cur->is<skjson::ObjectValue>()) {
134 return cur->as<skjson::ObjectValue>()[name];
137 static skjson::NullValue gNull;
141 static bool TryParse(const skjson::Value& v, float& f) {
142 if (const skjson::NumberValue* num = v) {
149 static bool TryParse(const skjson::Value& v, int& i) {
150 if (const skjson::NumberValue* num = v) {
158 static bool TryParse(const skjson::Value& v, SkString& s) {
159 if (const skjson::StringValue* str = v) {
166 static bool TryParse(const skjson::Value& v, bool& b) {
168 case skjson::Value::Type::kNumber:
169 b = SkToBool(*v.as<skjson::NumberValue>());
171 case skjson::Value::Type::kBool:
172 b = *v.as<skjson::BoolValue>();
181 const skjson::Value& fRoot;
182 SkSTArray<16, const skjson::Value*, true> fStack;