Пример #1
0
 public TinyJsonInterface(Allocator allocator)
 {
     m_RootData = new TinyJsonData(allocator);
     Object     = new TinyJsonObject {
         Type = JsonValueType.Object, m_Data = m_RootData
     };
 }
Пример #2
0
 TinyJsonObject(TinyJsonArray array)
 {
     this             = default;
     Type             = JsonValueType.Array;
     m_Data           = array.m_Data;
     m_ArrayRefHandle = array.m_ArrayRefHandle;
 }
Пример #3
0
        internal void DeepCopyFields(ref TinyJsonData source)
        {
            TinyJsonObject.CheckNotSameObject(source, this);

            foreach (var keyValue in source.m_RootObjMap)
            {
                var objectCopy = source.CreateObjectFromJsonHandle(keyValue.Value); // read from source
                AddOrUpdateField(keyValue.Key, objectCopy);                         // write to destination
            }
        }
Пример #4
0
        internal void AddOrUpdateObject(FixedString128 key, ref TinyJsonData source)
        {
            var newObj = CreateObjectField(key);

            newObj.m_Data.DeepCopyFields(ref source);
        }