public int GetMembers(NamedJsonBuffer[] members, int index, int count) { if (index < 0) { throw new ArgumentOutOfRangeException("index", index, null); } JsonBufferReader reader = CreateReader(); if (!reader.MoveToContent()) { throw new JsonException("Unexpected EOF."); } if (reader.TokenClass == JsonTokenClass.Null) { return(0); } reader.ReadToken(JsonTokenClass.Object); int readCount = 0; while (reader.TokenClass == JsonTokenClass.Member) { if (count-- == 0) { return(~readCount); } if (members != null) { members[index++] = new NamedJsonBuffer(reader.Text, reader.BufferValue()); } else { reader.Skip(); } readCount++; } return(readCount); }
public NamedJsonBuffer[] GetMembersArray() { NamedJsonBuffer[] members = new NamedJsonBuffer[GetMemberCount()]; GetMembers(members); return(members); }
public bool Equals(NamedJsonBuffer other) { return(Name == other.Name && Buffer.Equals(other.Buffer)); }