Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion LightWeightJsonParser/LWJson.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;

namespace LightWeightJsonParser
{
Expand Down Expand Up @@ -38,8 +39,13 @@ public virtual LWJson this[string key]
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
#endregion

public virtual bool ContainsKey(string key) => false;

public virtual IEnumerator<LWJson> GetEnumerator()
=> throw new NotImplementedException();

#endregion

#region EVENTS
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions LightWeightJsonParser/LWJsonArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public override LWJson this[string key]
}
#endregion

public override IEnumerator<LWJson> GetEnumerator()
{
foreach (var lwJson in ArrayData)
yield return lwJson;
}

#region PROPERTIES
public override JsonDataType DataType { get { return JsonDataType.Array; } }
Expand Down
3 changes: 1 addition & 2 deletions LightWeightJsonParser/LWJsonObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public override LWJson this[string key]
}
#endregion


#region PROPERTIES
public override JsonDataType DataType { get { return JsonDataType.Object; } }

Expand Down Expand Up @@ -123,7 +122,7 @@ public LWJsonObject Remove(string key)
/// </summary>
/// <param name="key"></param>
/// <returns>True if this object contains a data-pair with the provided key, false otherwise.</returns>
public bool ContainsKey(string key)
public override bool ContainsKey(string key)
{
return m_ObjectData.ContainsKey(key);
}
Expand Down