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);
            }
Пример #2
0
            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,
                });
            }
Пример #3
0
 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;
 }