| 25 |  | * @file ElementsTable.cpp | 
| 26 |  | * @author gezelter | 
| 27 |  | * @date 12/21/2007 | 
| 28 | – | * @time 11:30am | 
| 28 |  | * @version 1.0 | 
| 29 |  | */ | 
| 30 |  |  | 
| 39 |  | #include "utils/simError.h" | 
| 40 |  | #include "io/ifstrstream.hpp" | 
| 41 |  |  | 
| 43 | – | #ifdef _MSC_VER | 
| 44 | – | #define strncasecmp _strnicmp | 
| 45 | – | #define strcasecmp _stricmp | 
| 46 | – | #endif | 
| 47 | – |  | 
| 48 | – |  | 
| 42 |  | #ifdef WIN32 | 
| 43 |  | #define FILE_SEP_CHAR "\\" | 
| 44 |  | #else | 
| 62 |  |  | 
| 63 |  | ElementsTable::~ElementsTable() { | 
| 64 |  | std::vector<Element*>::iterator i; | 
| 65 | < | for (i = elements_.begin(); i != elements_.end(); i++) | 
| 65 | > | for (i = elements_.begin(); i != elements_.end(); ++i) | 
| 66 |  | delete *i; | 
| 67 |  | } | 
| 68 |  |  | 
| 69 |  | void ElementsTable::ParseLine(const char *line) { | 
| 70 |  | int num, maxbonds; | 
| 71 | < | char symbol[5]; | 
| 71 | > | char symbol[6]; | 
| 72 |  | char name[256]; | 
| 73 |  | RealType Rcov,Rvdw,mass, elNeg, ionize, elAffin; | 
| 74 |  | RealType red, green, blue; | 
| 263 |  | Init(); | 
| 264 |  |  | 
| 265 |  | std::vector<Element*>::iterator i; | 
| 266 | < | for (i = elements_.begin();i != elements_.end();i++) | 
| 266 | > | for (i = elements_.begin();i != elements_.end(); ++i) | 
| 267 |  | if (!strncasecmp(sym,(*i)->GetSymbol(),2)) | 
| 268 |  | return((*i)->GetAtomicNum()); | 
| 269 |  |  | 
| 320 |  | simError(); | 
| 321 |  | } | 
| 322 |  |  | 
| 323 | < | char charBuffer[BUFF_SIZE]; | 
| 323 | > |  | 
| 324 |  | if ((*ifsP)) { | 
| 325 | + | char charBuffer[BUFF_SIZE]; | 
| 326 |  | while(ifsP->getline(charBuffer,BUFF_SIZE)) | 
| 327 |  | ParseLine(charBuffer); | 
| 328 | < |  | 
| 328 | > |  | 
| 329 |  | if (ifs1) | 
| 330 |  | ifs1.close(); | 
| 331 |  | if (ifs2) |