Changeset 12894 for fact/Evidence/Evidence.cc
- Timestamp:
- 02/16/12 14:44:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/Evidence/Evidence.cc
r12892 r12894 421 421 } 422 422 423 // Simplify format "?;1" to "?"424 if (strlen(Format)==3 && Format[2]=='1') Format[1] = '\0';425 426 // Structure: print hex representation427 if (strlen(Format) != 1) {428 for (int i=0; i<Size; i++) {429 Text << setw(2) << hex << *((char *) Data + i) << " ";430 }431 return Text.str();432 }433 434 423 // String if format "C" and terminated with \0 435 424 if (strcmp(Format, "C") == 0 && Size > 0 && *((char *) Data+Size-1)=='\0') { 436 425 return string((char *) Data); 437 426 } 438 427 428 // Check if format is made of identical component types 429 vector<string> Components = Tokenize(Format, ";"); 430 431 for (unsigned int i=0; i<Components.size(); i++) { 432 if (Components[i].empty()) return string(); 433 434 // Print hex representation if format complex 435 if (Components[i][0] != Components[0][0]) { 436 for (int i=0; i<Size; i++) { 437 Text << setw(2) << hex << *((char *) Data + i) << " "; 438 } 439 return Text.str(); 440 } 441 } 442 439 443 // Number array 440 444 int ElementSize; 445 441 446 switch (toupper(*Format)) { 442 447 case 'B':
Note:
See TracChangeset
for help on using the changeset viewer.