Changeset 16233 for issm/trunk-jpl/src/c/kml/KML_Object.cpp
- Timestamp:
- 09/23/13 11:01:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/kml/KML_Object.cpp
r15104 r16233 295 295 } 296 296 /*}}}*/ 297 /*FUNCTION KML_Object::FindAttrib {{{*/298 void KML_Object::FindAttrib(char** pvalue,char* name,char* deflt){299 300 int i;301 KML_Attribute* katt=NULL;302 303 /* loop over any attributes for the object */304 305 if (attrib->Size())306 for (i=0; i<attrib->Size(); i++)307 if (!strcmp(((KML_Attribute *)attrib->GetObjectByOffset(i))->name,name)) {308 katt=(KML_Attribute *)attrib->GetObjectByOffset(i);309 break;310 }311 312 /* if found, get the value; otherwise use the default */313 314 if (katt)315 katt->Get(pvalue,deflt);316 else {317 *pvalue=xNew<char>(strlen(deflt)+1);318 memcpy(*pvalue,deflt,(strlen(deflt)+1)*sizeof(char));319 }320 321 return;322 }323 /*}}}*/324 297 /*FUNCTION KML_Object::WriteAttrib {{{*/ 325 298 void KML_Object::WriteAttrib(FILE* filout,const char* indent){ … … 363 336 } 364 337 /*}}}*/ 365 /*FUNCTION KML_Object::FindCommnt {{{*/366 void KML_Object::FindCommnt(char** pvalue,int inum){367 368 KML_Comment* kcom=NULL;369 370 /* loop over any comments for the object */371 372 if (inum <= commnt->Size())373 kcom=(KML_Comment *)commnt->GetObjectByOffset(inum-1);374 375 /* if found, get the value; otherwise use the NULL */376 377 if (kcom)378 kcom->Get(pvalue);379 380 return;381 }382 /*}}}*/383 338 /*FUNCTION KML_Object::WriteCommnt {{{*/ 384 339 void KML_Object::WriteCommnt(FILE* filout,const char* indent){
Note:
See TracChangeset
for help on using the changeset viewer.