IJSONArray Interface

Provides simplified DOM-like JSON serialization and de-serialization API.

Members

Name Description
Method Add Adds new variant value to the array.
Method AddBoolean Adds new boolean value to the array.
Method AddDate Adds new DATE value to the array.
Method AddDouble Adds new double value to the array.
Method AddDoubleEx Adds new double value to the array. Stores precision for use in ToJSON and ToJSONString
Method AddJSONArray Adds new nested array to the array.
Method AddJSONObject Adds new nested object to the array.
Method AddLong Adds new long value to the array.
Method AddNull Adds new null value to the array.
Method AddString Adds new string value to the array.
Method ClearAll Removes all values.
Read-only property Count Returns an array size.
Method CreateMemberArray Creates and adds new member to the member collection. Returns E_​FAIL if creation of the member fails.
Method CreateMemberObject Creates and adds new member to the member collection. Returns E_​FAIL if creation of the member fails.
Method IsValueNull Checks if an array value at a given index is NULL.
Method ParseJSON Parses JSON array from IJSONReader into memory. Useful if you want to have random acces to just a part of a JSON.
Method ParseString Parses JSON array from string into memory.
Method RemoveValue Remove a value from the member collection.
Method ToJSON Converts IJSONArray to JSON representation using provided IJSONWriter. Useful when you have complex JSON response you want to combine from the output of several methods.
Method ToJSONString Converts IJSONArray to JSON representation using IJSONWriter internally. 'props' parameter is to control IJSONWriter properties. It's safe to set it to NULL.
Method TryGetValueAsArray Returns array value at a given index as IJSONArray. If index is out of bounds or type coercion fails, returns VARIANT_​FALSE in 'success' parameter.
Method TryGetValueAsBoolean Returns array value at a given index as boolean. If index is out of bounds or type coercion fails, returns VARIANT_​FALSE in 'success' parameter.
Method TryGetValueAsDate Returns array value at a given index as DATE. If index is out of bounds or type coercion fails, returns VARIANT_​FALSE in 'success' parameter.
Method TryGetValueAsDouble Returns array value at a given index as double. If index is out of bounds or type coercion fails, returns VARIANT_​FALSE in 'success' parameter.
Method TryGetValueAsLong Returns array value at a given index as long. If index is out of bounds or type coercion fails, returns VARIANT_​FALSE in 'success' parameter.
Method TryGetValueAsObject Returns array value at a given index as IJSONObject. If index is out of bounds or type coercion fails, returns VARIANT_​FALSE in 'success' parameter.
Method TryGetValueAsString Returns array value at a given index as string. If index is out of bounds or type coercion fails, returns VARIANT_​FALSE in 'success' parameter.
Read-only property Value Returns an array value at a given index. Returns E_​INVALIDARG if index is out of bounds.

IJSONArray.Add Method

Adds new variant value to the array.

Public Sub Add ( _
    ByVal Value As Object _
)
public void Add (
    object Value
);

IJSONArray.AddBoolean Method

Adds new boolean value to the array.

Public Sub AddBoolean ( _
    ByVal Value As Boolean _
)
public void AddBoolean (
    bool Value
);

IJSONArray.AddDate Method

Adds new DATE value to the array.

Public Sub AddDate ( _
    ByVal Value As DateTime _
)
public void AddDate (
    DateTime Value
);

IJSONArray.AddDouble Method

Adds new double value to the array.

Public Sub AddDouble ( _
    ByVal Value As Double _
)
public void AddDouble (
    double Value
);

IJSONArray.AddDoubleEx Method

Adds new double value to the array. Stores precision for use in ToJSON and ToJSONString

Public Sub AddDoubleEx ( _
    ByVal Value As Double, _
    ByVal precision As Integer _
)
public void AddDoubleEx (
    double Value,
    int precision
);

IJSONArray.AddJSONArray Method

Adds new nested array to the array.

Public Sub AddJSONArray ( _
    ByVal Value As IJSONArray _
)
public void AddJSONArray (
    IJSONArray Value
);

IJSONArray.AddJSONObject Method

Adds new nested object to the array.

Public Sub AddJSONObject ( _
    ByVal Value As IJSONObject _
)
public void AddJSONObject (
    IJSONObject Value
);

IJSONArray.AddLong Method

Adds new long value to the array.

Public Sub AddLong ( _
    ByVal Value As Integer _
)
public void AddLong (
    int Value
);

IJSONArray.AddNull Method

Adds new null value to the array.

Public Sub AddNull ( _
)
public void AddNull (
);

IJSONArray.AddString Method

Adds new string value to the array.

Public Sub AddString ( _
    ByVal Value As String _
)
public void AddString (
    string Value
);

IJSONArray.ClearAll Method

Removes all values.

Public Sub ClearAll ( _
)
public void ClearAll (
);

IJSONArray.Count Property

Returns an array size.

Public ReadOnly Property Count As Integer
public int Count {get;}

IJSONArray.CreateMemberArray Method

Creates and adds new member to the member collection. Returns E_FAIL if creation of the member fails.

Public Sub CreateMemberArray ( _
    ByRef Value As IJSONArray _
)
public void CreateMemberArray (
    ref IJSONArray Value
);

IJSONArray.CreateMemberObject Method

Creates and adds new member to the member collection. Returns E_FAIL if creation of the member fails.

Public Sub CreateMemberObject ( _
    ByRef Value As IJSONObject _
)
public void CreateMemberObject (
    ref IJSONObject Value
);

IJSONArray.IsValueNull Method

Checks if an array value at a given index is NULL.

Public Function IsValueNull ( _
    ByVal Index As Integer _
) As Boolean
public bool IsValueNull (
    int Index
);

IJSONArray.ParseJSON Method

Parses JSON array from IJSONReader into memory. Useful if you want to have random acces to just a part of a JSON.

Public Sub ParseJSON ( _
    ByVal pReader As IJSONReader _
)
public void ParseJSON (
    IJSONReader pReader
);

IJSONArray.ParseString Method

Parses JSON array from string into memory.

Public Sub ParseString ( _
    ByVal json As String _
)
public void ParseString (
    string json
);

IJSONArray.RemoveValue Method

Remove a value from the member collection.

Public Sub RemoveValue ( _
    ByVal Index As Integer _
)
public void RemoveValue (
    int Index
);

IJSONArray.ToJSON Method

Converts IJSONArray to JSON representation using provided IJSONWriter. Useful when you have complex JSON response you want to combine from the output of several methods.

Public Sub ToJSON ( _
    ByVal objectName As String, _
    ByVal pWriter As IJSONWriter _
)
public void ToJSON (
    string objectName,
    IJSONWriter pWriter
);

IJSONArray.ToJSONString Method

Converts IJSONArray to JSON representation using IJSONWriter internally. 'props' parameter is to control IJSONWriter properties. It's safe to set it to NULL.

Public Function ToJSONString ( _
    ByVal props As IPropertySet _
) As String
public string ToJSONString (
    IPropertySet props
);

IJSONArray.TryGetValueAsArray Method

Returns array value at a given index as IJSONArray. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Public Function TryGetValueAsArray ( _
    ByVal Index As Integer, _
    ByRef Value As IJSONArray _
) As Boolean
public bool TryGetValueAsArray (
    int Index,
    ref IJSONArray Value
);

IJSONArray.TryGetValueAsBoolean Method

Returns array value at a given index as boolean. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Public Function TryGetValueAsBoolean ( _
    ByVal Index As Integer, _
    ByRef Value As Boolean _
) As Boolean
public bool TryGetValueAsBoolean (
    int Index,
    ref bool Value
);

IJSONArray.TryGetValueAsDate Method

Returns array value at a given index as DATE. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Public Function TryGetValueAsDate ( _
    ByVal Index As Integer, _
    ByRef Value As DateTime& _
) As Boolean
public bool TryGetValueAsDate (
    int Index,
    ref DateTime& Value
);

IJSONArray.TryGetValueAsDouble Method

Returns array value at a given index as double. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Public Function TryGetValueAsDouble ( _
    ByVal Index As Integer, _
    ByRef Value As Double _
) As Boolean
public bool TryGetValueAsDouble (
    int Index,
    ref double Value
);

IJSONArray.TryGetValueAsLong Method

Returns array value at a given index as long. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Public Function TryGetValueAsLong ( _
    ByVal Index As Integer, _
    ByRef Value As Integer _
) As Boolean
public bool TryGetValueAsLong (
    int Index,
    ref int Value
);

IJSONArray.TryGetValueAsObject Method

Returns array value at a given index as IJSONObject. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Public Function TryGetValueAsObject ( _
    ByVal Index As Integer, _
    ByRef Value As IJSONObject _
) As Boolean
public bool TryGetValueAsObject (
    int Index,
    ref IJSONObject Value
);

IJSONArray.TryGetValueAsString Method

Returns array value at a given index as string. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Public Function TryGetValueAsString ( _
    ByVal Index As Integer, _
    ByRef Value As String _
) As Boolean
public bool TryGetValueAsString (
    int Index,
    ref string Value
);

IJSONArray.Value Property

Returns an array value at a given index. Returns E_INVALIDARG if index is out of bounds.

Public Function get_Value ( _
    ByVal Index As Integer _
) As Object
public object get_Value (
    int Index
);

Classes that implement IJSONArray

Classes Description
JSONArray Simplified JSON API coclass

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.