57 #ifndef ST_GET_CONFIG_VALUE_HH
58 #define ST_GET_CONFIG_VALUE_HH
63 #include "StGlobals.hh"
64 #if !defined(ST_NO_NAMESPACES)
69 void StGetConfigValue(
const char* filename,
const char* name, T& value)
71 ifstream ifs(filename);
76 while (ifs.good() && !ifs.eof()) {
77 #if defined(__SUNPRO_CC)
79 while ((c = ifs.get()) && c !=
'\n' && !ifs.eof()) line += c;
81 getline(ifs,line,
'\n');
83 if ((pos = line.find(
'#')) != StNPOS)
84 line.erase(pos,line.length());
85 if ((pos = line.find(
"//")) != StNPOS)
86 line.erase(pos,line.length());
87 if ((pos = line.find(name)) != StNPOS) {
88 if ((pos = line.find(
':')) != StNPOS) {
90 istrstream ist(line.c_str());
101 void StGetConfigValue(
const char* filename,
const char* name, T& value,
int nitems)
103 ifstream ifs(filename);
108 while (ifs.good() && !ifs.eof()) {
109 #if defined(__SUNPRO_CC)
110 char c; line.erase();
111 while ((c = ifs.get()) && c !=
'\n' && !ifs.eof()) line += c;
113 getline(ifs,line,
'\n');
115 if ((pos = line.find(
'#')) != StNPOS)
116 line.erase(pos,line.length());
117 if ((pos = line.find(
"//")) != StNPOS)
118 line.erase(pos,line.length());
119 if ((pos = line.find(name)) != StNPOS) {
120 if ((pos = line.find(
':')) != StNPOS) {
122 istrstream ist(line.c_str());
123 for (
int i=0; i<nitems; i++)