Interhaptics SDK for Unity 1.6
Loading...
Searching...
No Matches
SimpleJSON.JSONArray Class Reference
Inheritance diagram for SimpleJSON.JSONArray:
SimpleJSON.JSONNode

Public Member Functions

override Enumerator GetEnumerator ()
 
override void Add (string aKey, JSONNode aItem)
 
override JSONNode Remove (int aIndex)
 
override JSONNode Remove (JSONNode aNode)
 
override JSONNode Clone ()
 
- Public Member Functions inherited from SimpleJSON.JSONNode
virtual void Add (JSONNode aItem)
 
virtual JSONNode Remove (string aKey)
 
virtual bool HasKey (string aKey)
 
virtual JSONNode GetValueOrDefault (string aKey, JSONNode aDefault)
 
override string ToString ()
 
virtual string ToString (int aIndent)
 
Enumerator GetEnumerator ()
 
override bool Equals (object obj)
 
override int GetHashCode ()
 

Properties

override bool Inline [get, set]
 
override JSONNodeType Tag [get]
 
override bool IsArray [get]
 
override JSONNode this[int aIndex] [get, set]
 
override JSONNode this[string aKey] [get, set]
 
override int Count [get]
 
override IEnumerable< JSONNodeChildren [get]
 
- Properties inherited from SimpleJSON.JSONNode
JSONNodeType Tag [get]
 
virtual JSONNode this[int aIndex] [get, set]
 
virtual JSONNode this[string aKey] [get, set]
 
virtual string Value [get, set]
 
virtual int Count [get]
 
virtual bool IsNumber [get]
 
virtual bool IsString [get]
 
virtual bool IsBoolean [get]
 
virtual bool IsNull [get]
 
virtual bool IsArray [get]
 
virtual bool IsObject [get]
 
virtual bool Inline [get, set]
 
virtual IEnumerable< JSONNodeChildren [get]
 
IEnumerable< JSONNodeDeepChildren [get]
 
IEnumerable< KeyValuePair< string, JSONNode > > Linq [get]
 
KeyEnumerator Keys [get]
 
ValueEnumerator Values [get]
 
virtual double AsDouble [get, set]
 
virtual int AsInt [get, set]
 
virtual float AsFloat [get, set]
 
virtual bool AsBool [get, set]
 
virtual long AsLong [get, set]
 
virtual JSONArray AsArray [get]
 
virtual JSONObject AsObject [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from SimpleJSON.JSONNode
static implicit operator JSONNode (string s)
 
static implicit operator string (JSONNode d)
 
static implicit operator JSONNode (double n)
 
static implicit operator double (JSONNode d)
 
static implicit operator JSONNode (float n)
 
static implicit operator float (JSONNode d)
 
static implicit operator JSONNode (int n)
 
static implicit operator int (JSONNode d)
 
static implicit operator JSONNode (long n)
 
static implicit operator long (JSONNode d)
 
static implicit operator JSONNode (bool b)
 
static implicit operator bool (JSONNode d)
 
static implicit operator JSONNode (KeyValuePair< string, JSONNode > aKeyValue)
 
static bool operator== (JSONNode a, object b)
 
static bool operator!= (JSONNode a, object b)
 
static JSONNode Parse (string aJSON)
 
- Static Public Attributes inherited from SimpleJSON.JSONNode
static bool forceASCII = false
 
static bool longAsString = false
 
static bool allowLineComments = true
 

Detailed Description

Definition at line 685 of file SimpleJSON.cs.

Member Function Documentation

◆ Add()

override void SimpleJSON.JSONArray.Add ( string aKey,
JSONNode aItem )
virtual

Reimplemented from SimpleJSON.JSONNode.

Definition at line 734 of file SimpleJSON.cs.

735 {
736 if (aItem == null)
737 aItem = JSONNull.CreateOrGet();
738 m_List.Add(aItem);
739 }

References SimpleJSON.JSONNode.Add(), and SimpleJSON.JSONNull.CreateOrGet().

◆ Clone()

override JSONNode SimpleJSON.JSONArray.Clone ( )
virtual

Reimplemented from SimpleJSON.JSONNode.

Definition at line 756 of file SimpleJSON.cs.

757 {
758 var node = new JSONArray();
759 node.m_List.Capacity = m_List.Capacity;
760 foreach(var n in m_List)
761 {
762 if (n != null)
763 node.Add(n.Clone());
764 else
765 node.Add(null);
766 }
767 return node;
768 }

◆ GetEnumerator()

override Enumerator SimpleJSON.JSONArray.GetEnumerator ( )

Definition at line 697 of file SimpleJSON.cs.

697{ return new Enumerator(m_List.GetEnumerator()); }

◆ Remove() [1/2]

override JSONNode SimpleJSON.JSONArray.Remove ( int aIndex)
virtual

Reimplemented from SimpleJSON.JSONNode.

Definition at line 741 of file SimpleJSON.cs.

742 {
743 if (aIndex < 0 || aIndex >= m_List.Count)
744 return null;
745 JSONNode tmp = m_List[aIndex];
746 m_List.RemoveAt(aIndex);
747 return tmp;
748 }

◆ Remove() [2/2]

override JSONNode SimpleJSON.JSONArray.Remove ( JSONNode aNode)
virtual

Reimplemented from SimpleJSON.JSONNode.

Definition at line 750 of file SimpleJSON.cs.

751 {
752 m_List.Remove(aNode);
753 return aNode;
754 }

References SimpleJSON.JSONNode.Remove().

Property Documentation

◆ Children

override IEnumerable<JSONNode> SimpleJSON.JSONArray.Children
get

Definition at line 770 of file SimpleJSON.cs.

771 {
772 get
773 {
774 foreach (JSONNode N in m_List)
775 yield return N;
776 }
777 }

◆ Count

override int SimpleJSON.JSONArray.Count
get

Definition at line 729 of file SimpleJSON.cs.

730 {
731 get { return m_List.Count; }
732 }

◆ Inline

override bool SimpleJSON.JSONArray.Inline
getset

Definition at line 689 of file SimpleJSON.cs.

690 {
691 get { return inline; }
692 set { inline = value; }
693 }

◆ IsArray

override bool SimpleJSON.JSONArray.IsArray
get

Definition at line 696 of file SimpleJSON.cs.

696{ get { return true; } }

◆ Tag

override JSONNodeType SimpleJSON.JSONArray.Tag
get

Definition at line 695 of file SimpleJSON.cs.

695{ get { return JSONNodeType.Array; } }

◆ this[int aIndex]

override JSONNode SimpleJSON.JSONArray.this[int aIndex]
getset

Definition at line 699 of file SimpleJSON.cs.

700 {
701 get
702 {
703 if (aIndex < 0 || aIndex >= m_List.Count)
704 return new JSONLazyCreator(this);
705 return m_List[aIndex];
706 }
707 set
708 {
709 if (value == null)
710 value = JSONNull.CreateOrGet();
711 if (aIndex < 0 || aIndex >= m_List.Count)
712 m_List.Add(value);
713 else
714 m_List[aIndex] = value;
715 }
716 }

◆ this[string aKey]

override JSONNode SimpleJSON.JSONArray.this[string aKey]
getset

Definition at line 718 of file SimpleJSON.cs.

719 {
720 get { return new JSONLazyCreator(this); }
721 set
722 {
723 if (value == null)
724 value = JSONNull.CreateOrGet();
725 m_List.Add(value);
726 }
727 }

The documentation for this class was generated from the following file: