Changeset 10629
- Timestamp:
- 11/14/11 11:49:47 (13 years ago)
- Location:
- issm/trunk/src/c/objects/KML
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/KML/KMLFileReadUtils.cpp
r10627 r10629 40 40 while ((c=getc(fid)) != EOF) { 41 41 /* ignore leading blanks */ 42 // printf("point 0 c=%c\n",c);43 42 if (inew && isspace(c)) 44 43 continue; … … 49 48 /* distinguish between tag or comment */ 50 49 if (c == '<') { 51 // printf("point 1 c=%c\n",c);52 50 ungetc(c,fid); 53 51 if (!(bufferc=KMLFileTokenComment(fid))) { 54 52 c=getc(fid); 55 // printf("point 2 c=%c\n",c);56 53 itag=1; 57 54 } 58 55 else { 59 // printf("point 3 buffer=%s\n",buffer);60 56 xfree((void**)&bufferc); 61 57 inew=1; … … 117 113 } 118 114 119 if (itag)120 _printf_(true,"tag buffer (length=%d):\n",ibuf);121 else if (ifield)122 _printf_(true,"field buffer (length=%d):\n",ibuf);123 _printf_(true,"%s\n",buffer);115 // if (itag) 116 // _printf_(true,"tag buffer (length=%d):\n",ibuf); 117 // else if (ifield) 118 // _printf_(true,"field buffer (length=%d):\n",ibuf); 119 // _printf_(true,"%s\n",buffer); 124 120 125 121 if (!ibuf) … … 147 143 148 144 while ((c=getc(fid)) != EOF) { 149 // printf("point 10 c=%c\n",c);150 145 /* ignore leading blanks */ 151 146 if (inew && isspace(c)) … … 165 160 for (i=ibuf-1; i>=0; i--) 166 161 ungetc(buffer[i],fid); 167 // printf("point 11 buffer=%p\n",buffer);168 162 xfree((void**)&buffer); 169 // printf("point 12 buffer=%p\n",buffer);170 163 return(buffer); 171 164 } … … 188 181 } 189 182 190 _printf_(true,"comment buffer (length=%d):\n",ibuf);191 _printf_(true,"%s\n",buffer);183 // _printf_(true,"comment buffer (length=%d):\n",ibuf); 184 // _printf_(true,"%s\n",buffer); 192 185 193 186 if (!ibuf) … … 224 217 225 218 /*FUNCTION KMLFileTagAttrib {{{1*/ 226 voidKMLFileTagAttrib(KML_Object* kobj,227 219 int KMLFileTagAttrib(KML_Object* kobj, 220 char* ktag){ 228 221 229 222 /* for the given tag buffer, read and store the attributes */ … … 233 226 char* ktokv; 234 227 char quote[]={'\"','\0'}; 228 int isolo=0; 235 229 236 230 /* strtok modifies ktag, so work on copy */ … … 241 235 /* loop through tag to find all attributes */ 242 236 237 /* return first non blank and move past subsequent blank */ 243 238 ktokn=strtok(ktagi," "); 244 while (ktokn=strtok(NULL," =?>")) { 245 239 // _printf_(true,"KMLFileTagAttrib -- initial token=\"%s\".\n",ktokn); 240 241 /* return next non " =?/>" and move past subsequent " =?/>" */ 242 while (ktokn=strtok(NULL," =?/>")) { 243 244 /* return next non quote and move past subsequent quote */ 246 245 ktokv=strtok(NULL,quote); 247 246 // _printf_(true,"KMLFileTagAttrib -- attribute %s=\"%s\".\n",ktokn,ktokv); … … 255 254 xfree((void**)&ktagi); 256 255 257 return; 256 /* check for xml declaration, dtd declaration, or solo tag */ 257 258 if ((!strncmp(&ktag[0],"<?" ,2) && !strncmp(&ktag[strlen(ktag)-2],"?>",2)) || 259 (!strncmp(&ktag[0],"<!DOCTYPE",9) && !strncmp(&ktag[strlen(ktag)-1], ">",1)) || 260 (!strncmp(&ktag[0],"<" ,1) && !strncmp(&ktag[strlen(ktag)-2],"/>",2))) 261 isolo=1; 262 // _printf_(true,"KMLFileTagAttrib -- isolo=%d.\n",isolo); 263 264 return(isolo); 258 265 } 259 266 /*}}}*/ -
issm/trunk/src/c/objects/KML/KMLFileReadUtils.h
r10627 r10629 20 20 int c, 21 21 int bufblk); 22 voidKMLFileTagAttrib(KML_Object* kobj,23 22 int KMLFileTagAttrib(KML_Object* kobj, 23 char* ktag); 24 24 int KMLFileTokenParse(int* pival, 25 25 char* ktag, -
issm/trunk/src/c/objects/KML/KML_Document.cpp
r9761 r10629 92 92 char* kstri; 93 93 94 /* get object attributes */94 /* get object attributes and check for solo tag */ 95 95 96 KMLFileTagAttrib(this, 97 kstr); 96 if (KMLFileTagAttrib(this, 97 kstr)) 98 return; 98 99 99 100 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_File.cpp
r10257 r10629 127 127 KML_Object* kobj; 128 128 129 /* get object attributes */ 130 131 KMLFileTagAttrib(this, 132 kstr); 129 /* get object attributes and check for solo tag */ 130 131 if (KMLFileTagAttrib(this, 132 kstr)) 133 return; 133 134 134 135 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_Folder.cpp
r9761 r10629 92 92 char* kstri; 93 93 94 /* get object attributes */94 /* get object attributes and check for solo tag */ 95 95 96 KMLFileTagAttrib(this, 97 kstr); 96 if (KMLFileTagAttrib(this, 97 kstr)) 98 return; 98 99 99 100 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_GroundOverlay.cpp
r9761 r10629 125 125 char* kstri; 126 126 127 /* get object attributes */127 /* get object attributes and check for solo tag */ 128 128 129 KMLFileTagAttrib(this, 130 kstr); 129 if (KMLFileTagAttrib(this, 130 kstr)) 131 return; 131 132 132 133 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_Icon.cpp
r9761 r10629 131 131 char* kstri; 132 132 133 /* get object attributes */133 /* get object attributes and check for solo tag */ 134 134 135 KMLFileTagAttrib(this, 136 kstr); 135 if (KMLFileTagAttrib(this, 136 kstr)) 137 return; 137 138 138 139 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_LatLonBox.cpp
r9761 r10629 114 114 char* kstri; 115 115 116 /* get object attributes */116 /* get object attributes and check for solo tag */ 117 117 118 KMLFileTagAttrib(this, 119 kstr); 118 if (KMLFileTagAttrib(this, 119 kstr)) 120 return; 120 121 121 122 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_LineString.cpp
r10255 r10629 129 129 char* kstri; 130 130 131 /* get object attributes */ 132 133 KMLFileTagAttrib(this, 134 kstr); 131 /* get object attributes and check for solo tag */ 132 133 if (KMLFileTagAttrib(this, 134 kstr)) 135 return; 135 136 136 137 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_LineStyle.cpp
r9761 r10629 99 99 char* kstri; 100 100 101 /* get object attributes */101 /* get object attributes and check for solo tag */ 102 102 103 KMLFileTagAttrib(this, 104 kstr); 103 if (KMLFileTagAttrib(this, 104 kstr)) 105 return; 105 106 106 107 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_LinearRing.cpp
r9761 r10629 129 129 char* kstri; 130 130 131 /* get object attributes */ 132 133 KMLFileTagAttrib(this, 134 kstr); 131 /* get object attributes and check for solo tag */ 132 133 if (KMLFileTagAttrib(this, 134 kstr)) 135 return; 135 136 136 137 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_MultiGeometry.cpp
r10257 r10629 127 127 KML_Object* kobj; 128 128 129 /* get object attributes */ 130 131 KMLFileTagAttrib(this, 132 kstr); 129 /* get object attributes and check for solo tag */ 130 131 if (KMLFileTagAttrib(this, 132 kstr)) 133 return; 133 134 134 135 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_Overlay.cpp
r9761 r10629 1 1 /*!\file KML_Overlay.cpp 2 * \brief: implementation of the kml_ containerabstract object2 * \brief: implementation of the kml_overlay abstract object 3 3 */ 4 4 -
issm/trunk/src/c/objects/KML/KML_Placemark.cpp
r10257 r10629 127 127 KML_Object* kobj; 128 128 129 /* get object attributes */ 130 131 KMLFileTagAttrib(this, 132 kstr); 129 /* get object attributes and check for solo tag */ 130 131 if (KMLFileTagAttrib(this, 132 kstr)) 133 return; 133 134 134 135 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_Point.cpp
r10274 r10629 112 112 char* kstri; 113 113 114 /* get object attributes */114 /* get object attributes and check for solo tag */ 115 115 116 KMLFileTagAttrib(this, 117 kstr); 116 if (KMLFileTagAttrib(this, 117 kstr)) 118 return; 118 119 119 120 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_PolyStyle.cpp
r9761 r10629 103 103 char* kstri; 104 104 105 /* get object attributes */105 /* get object attributes and check for solo tag */ 106 106 107 KMLFileTagAttrib(this, 108 kstr); 107 if (KMLFileTagAttrib(this, 108 kstr)) 109 return; 109 110 110 111 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_Polygon.cpp
r9761 r10629 167 167 KML_Object* kobj; 168 168 169 /* get object attributes */ 170 171 KMLFileTagAttrib(this, 172 kstr); 169 /* get object attributes and check for solo tag */ 170 171 if (KMLFileTagAttrib(this, 172 kstr)) 173 return; 173 174 174 175 /* loop over and process fields within opening and closing tags */ -
issm/trunk/src/c/objects/KML/KML_Style.cpp
r9761 r10629 180 180 char* kstri; 181 181 182 /* get object attributes */ 183 184 KMLFileTagAttrib(this, 185 kstr); 182 /* get object attributes and check for solo tag */ 183 184 if (KMLFileTagAttrib(this, 185 kstr)) 186 return; 186 187 187 188 /* loop over and process fields within opening and closing tags */
Note:
See TracChangeset
for help on using the changeset viewer.