internal LottieJsonObjectElement(LottieCompositionReader owner, JsonElement wrapped) { Debug.Assert(wrapped.ValueKind == JsonValueKind.Object, "Precondition"); _owner = owner; // Get the properties. _properties = wrapped.EnumerateObject().Select(jp => (true, jp)).ToArray(); // Sort the names so they can be binary searched. Array.Sort(_properties, Comparer.Instance); }
internal Reader(LottieCompositionReader owner, ReadOnlySpan <byte> jsonText) { _owner = owner; _jsonReader = new Utf8JsonReader( jsonText, new JsonReaderOptions { // Be resilient about trailing commas - ignore them. AllowTrailingCommas = true, // Be resilient about comments - ignore them. CommentHandling = JsonCommentHandling.Skip, // Fail if the JSON exceeds this depth. MaxDepth = 64, }); }
internal LottieJsonElement(LottieCompositionReader owner, JsonElement wrapped) { _owner = owner; _wrapped = wrapped; }
internal LottieJsonArrayElement(LottieCompositionReader owner, JsonElement wrapped) { Debug.Assert(wrapped.ValueKind == JsonValueKind.Array, "Precondition"); _owner = owner; _wrapped = wrapped; }