| 29 |
|
* @version 1.0 |
| 30 |
|
*/ |
| 31 |
|
|
| 32 |
+ |
#include <iostream> |
| 33 |
|
#include "config.h" |
| 34 |
+ |
#include <cstdlib> |
| 35 |
|
#include <string> |
| 36 |
|
#include <fstream> |
| 37 |
+ |
#include <cstdlib> |
| 38 |
|
#include "utils/ElementsTable.hpp" |
| 39 |
|
#include "utils/simError.h" |
| 40 |
+ |
#include "io/basic_ifstrstream.hpp" |
| 41 |
|
|
| 42 |
|
#if !HAVE_STRNCASECMP |
| 43 |
|
extern "C" int strncasecmp(const char *s1, const char *s2, size_t n); |
| 99 |
|
elNeg, ionize, elAffin, red, green, blue, |
| 100 |
|
name); |
| 101 |
|
elements_.push_back(ele); |
| 102 |
+ |
|
| 103 |
|
} |
| 104 |
|
} |
| 105 |
|
|
| 289 |
|
init_ = true; |
| 290 |
|
|
| 291 |
|
std::string buffer, subbuffer; |
| 292 |
< |
std::ifstream ifs1, ifs2, ifs3, ifs4, *ifsP; |
| 292 |
> |
ifstrstream ifs1, ifs2, ifs3, ifs4, *ifsP; |
| 293 |
|
// First, look for an environment variable |
| 294 |
|
if (getenv(envvar_.c_str()) != NULL) { |
| 295 |
|
buffer = getenv(envvar_.c_str()); |
| 322 |
|
if ((*ifsP)) { |
| 323 |
|
while(ifsP->getline(charBuffer,BUFF_SIZE)) |
| 324 |
|
ParseLine(charBuffer); |
| 325 |
< |
|
| 326 |
< |
if (ifs1) |
| 327 |
< |
ifs1.close(); |
| 328 |
< |
if (ifs2) |
| 329 |
< |
ifs2.close(); |
| 330 |
< |
if (ifs3) |
| 331 |
< |
ifs3.close(); |
| 332 |
< |
if (ifs4) |
| 333 |
< |
ifs4.close(); |
| 334 |
< |
|
| 335 |
< |
if (GetSize() == 0) { |
| 336 |
< |
sprintf( painCave.errMsg, |
| 337 |
< |
"ElementsTable error.\n" |
| 338 |
< |
"\tCannot initialize database %s \n", filename_.c_str()); |
| 339 |
< |
painCave.isFatal = 0; |
| 340 |
< |
simError(); |
| 341 |
< |
} |
| 325 |
> |
|
| 326 |
> |
if (ifs1) |
| 327 |
> |
ifs1.close(); |
| 328 |
> |
if (ifs2) |
| 329 |
> |
ifs2.close(); |
| 330 |
> |
if (ifs3) |
| 331 |
> |
ifs3.close(); |
| 332 |
> |
if (ifs4) |
| 333 |
> |
ifs4.close(); |
| 334 |
> |
|
| 335 |
> |
if (GetSize() == 0) { |
| 336 |
> |
sprintf( painCave.errMsg, |
| 337 |
> |
"ElementsTable error.\n" |
| 338 |
> |
"\tCannot initialize database %s \n", filename_.c_str()); |
| 339 |
> |
painCave.isFatal = 0; |
| 340 |
> |
simError(); |
| 341 |
> |
} |
| 342 |
|
|
| 343 |
|
} |
| 344 |
|
|