30 #include "StGlobals.hh"
31 #include "StGetConfigValue.hh"
32 #include "StThreeVector.hh"
35 #if !defined(ST_NO_NAMESPACES)
41 const char* filename =
"example.conf";
43 if (access(filename, R_OK)) {
44 cerr <<
"Cannot access file '" << filename <<
"'" << endl;
48 double singleValue = 10;
49 StGetConfigValue(filename,
"singleValue", singleValue);
50 cout <<
"singleValue = " << singleValue << endl;
52 float *manyValues =
new float[10];
53 StGetConfigValue(filename,
"manyValues", manyValues, 10);
54 cout <<
"manyValues = ";
55 for (
int i=0; i<10; i++) cout << manyValues[i] <<
' ';
58 #ifdef ST_NO_TEMPLATE_DEF_ARGS
59 vector<double, allocator<double> > vec(10,0);
62 vector<double> vec(10);
64 vector<double> vec(10,0);
65 #endif // GNU_GCC %$#&
67 StGetConfigValue(filename,
"vec", vec, 5);
69 for (
int k=0; k<10; k++) cout << vec[k] <<
' ';
73 StGetConfigValue(filename,
"vec3", vec3);
74 cout <<
"vec3 = " << vec3 << endl;
76 #if !defined(__SUNPRO_CC)
77 string anyName(
"default");
78 StGetConfigValue(filename,
"anyName", anyName);
79 cout <<
"anyName = " << anyName.c_str() << endl;
83 StGetConfigValue(filename,
"xfoo", xfoo);
84 cout <<
"xfoo = " << xfoo << endl;