Exemplo n.º 1
0
 public virtual void endObject(XJson doc, string k)
 {
     if (fkey == k) {
         doc.setListener(fparent);
         close();
     }
 }
Exemplo n.º 2
0
 public override void beginObject(XJson doc, string k)
 {
     if (k == "data") fData.__open(fjson,k);
 }
Exemplo n.º 3
0
 public virtual void beginObject(XJson doc, string k)
 {
 }
Exemplo n.º 4
0
 public override void beginObject(XJson doc, string k)
 {
     switch(k) 
     {
         case "attributes":
             if (!fIsRelations)
             doc.startDumpBlock();
             break;
         case "geometry":
             fIsGeometry = true;
             break;
         case "featureAssociations":
             fIsRelations = true;
             break;
     }
 }
Exemplo n.º 5
0
        public override void endObject(XJson doc, string k)
        {
            if (k == "attributes") {

                if (!fIsRelations)
                {
                    fe.attrs = doc.stopDumpBlock();

#if (test_enabled)
                    bool rc = new XJson().ParseFromString(fe.attrs);
                    if (!rc)
                    {
                        doc.__message(fe.Name(), "attributes parse error");
                        doc.__message(null, fe.attrs);
                    }
#endif
                }

            } else

            if (k == "geometry") {
                if (fgeometry.Enabled) fe.geometry(fgeometry);
            } else

            if (k == "featureAssociations") {
                if (frelation.Enabled) fe.relation(frelation);
            } 
            
            else base.endObject(doc, k);
        }
Exemplo n.º 6
0
 public void __open(XJson doc, string key)
 {
     doc.setListener(this);
     fkey = key; reset(key);
 }
Exemplo n.º 7
0
 public override void beginObject(XJson doc, string k)
 {
     frings = false;
     if (k != null) frings = (k == "rings");
 }
Exemplo n.º 8
0
 public override void endObject(XJson doc, string k)
 {
     if (k == "internalPoints")
         c.internalPoint(flat, flon);
     else
         base.endObject(doc, k);
 }
Exemplo n.º 9
0
 public override void beginObject(XJson doc, string k)
 {
     finternalPoints = false;
     if (k != null) finternalPoints = (k == "internalPoints");
 }
Exemplo n.º 10
0
        public override void beginObject(XJson doc, string k)
        {
            string id = null;
            tsObjectRef tag = tsConvert.StrToRef(k,ref id);

            switch (tag)
            {
                case tsObjectRef.refPoint:
                    fPoint.__open(doc,k);
                    break;

                case tsObjectRef.refPolyline:
                    fPolyline.__open(doc, k);
                    break;

                case tsObjectRef.refPolygon:
                    fPolygon.__open(doc, k);
                    break;

                case tsObjectRef.refFeature:
                    fFeature.__open(doc, k);
                    break;

            }
        }
Exemplo n.º 11
-1
        public bool ParseStream(StreamReader stream, tmessage message)
        {
            fjson = new XJson();
            fjson.message = message;
            fjson.setListener(this);

            bool rc = true;
            if (fdoc != null) {
                tsContentBound bound = new tsContentBound();

                jsonData temp = fData;
                fData = new jsonData(this, bound);

                fjson.setListener(this);
                fjson.Parse(stream);

                fData = temp;

                if (bound.count > 0)
                rc = fdoc.Bound(bound.minLat, bound.minLon, bound.maxLat, bound.maxLon);
            }

            if (rc) 
            if (fdoc == null)
                rc=ParseStage(stream,0);
            else
                for(int i=0; i < fdoc.GetStageCount(); i++ )
                rc=ParseStage(stream,i);

            if (rc) fData.log(message);

            fjson.Close();

            return rc; 
        }