Sha256: d4886fd76584a34e4c56d69f33a52137bf8798e68f53426614ba18500560853c

Contents?: true

Size: 1.3 KB

Versions: 23

Compression:

Stored size: 1.3 KB

Contents

using System;
using System.Collections.Generic;
using rho.common;
using fastJSON;

namespace rho.json
{
    public class JSONArrayIterator
    {
        List<Object> m_array;
        int    m_nCurItem;
	
	    public JSONArrayIterator(String szData)
	    {
            m_array = (List<Object>)JsonParser.JsonDecode(szData);
	        m_nCurItem = 0;
	    }

	    public JSONArrayIterator(JSONEntry oEntry, String strName)
	    {
	        m_array = (List<Object>)oEntry.getObject(strName);
	        m_nCurItem = 0;
	    }

	    private JSONArrayIterator()
	    {
		    m_array = null;
		    m_nCurItem = 0;
	    }

        public boolean isEnd()
	    {
	        return !(m_array != null && m_nCurItem < m_array.Count);
	    }

        public void next()
	    {
	        m_nCurItem++;
	    }

        public void reset(int nPos)
        {
    	    m_nCurItem = nPos;
        }

        public int getCurPos() { return m_nCurItem; }

        public JSONEntry getCurItem()
	    {
            return new JSONEntry(isEnd() ? null : (Dictionary<string, object>)m_array[m_nCurItem]);
	    }

        public JSONArrayIterator getCurArrayIter()
	    {
		    JSONArrayIterator res = new JSONArrayIterator();
		    if ( isEnd() )
			    return res;

            res.m_array = (List<Object>)m_array[m_nCurItem];
	        return res;
	    }
    }
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rhodes-3.0.2 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.2.beta.1 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.1 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.1.beta.8 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.1.beta.7 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.1.beta.6 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.1.beta.5 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.1.beta.4 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.1.beta.3 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.1.beta.2 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.0 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.0.beta.7 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.0.beta.6 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.0.beta.5 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.0.beta.4 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.0.beta.3 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.0.beta.2 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-3.0.0.beta.1 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-2.4.1 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs
rhodes-2.4.1.beta.1 platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs