72using std::ostringstream;
87int main(
int argc,
char ** argv)
95 vector<string>::const_iterator file_iter =
gAllFiles.begin();
96 for( ; file_iter !=
gAllFiles.end(); ++file_iter) {
97 string filename = *file_iter;
98 LOG(
"gspladd",
pNOTICE) <<
" ---- >> Loading file : " << filename;
106 <<
" ****** Saving all loaded splines into : " <<
gOutFile;
114 vector<string> files;
116 vector<string>::const_iterator file_iter;
117 vector<string>::const_iterator dir_iter;
121 for( ; file_iter !=
gInpFiles.end(); ++file_iter) {
122 string filename = *file_iter;
123 files.push_back(filename);
128 for( ; dir_iter !=
gInpDirs.end(); ++dir_iter) {
129 string path = *dir_iter;
133 file_iter = path_files.begin();
134 for( ; file_iter != path_files.end(); ++file_iter) {
135 string filename = *file_iter;
136 files.push_back(filename);
145 LOG(
"gspladd",
pNOTICE) <<
"Parsing command line arguments";
155 LOG(
"gspladd",
pINFO) <<
"Reading input files";
157 if(inpfiles.find(
",") != string::npos) {
167 LOG(
"gspladd",
pINFO) <<
"Reading input directories";
169 if(inpdirs.find(
",") != string::npos) {
179 LOG(
"gspladd",
pINFO) <<
"Reading output file name";
182 LOG(
"gspladd",
pFATAL) <<
"You must specify an output file name";
189 LOG(
"gspladd",
pFATAL) <<
"There must be at least 2 input files";
198 <<
"\n\n" <<
"Syntax:" <<
"\n"
199 <<
" gspladd -f file_list -d directory_list -o output.xml\n"
200 <<
" [--message-thresholds xml_file]\n";
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Command line argument parser.
string ArgAsString(char opt)
bool OptionExists(char opt)
was option set?
void ReadFromCommandLine(int argc, char **argv)
static RunOpt * Instance(void)
List of cross section vs energy splines.
void SaveAsXml(const string &filename, bool save_init=true) const
XmlParserStatus_t LoadFromXml(const string &filename, bool keep=false)
static XSecSplineList * Instance()
vector< string > gAllFiles
list of all input files
vector< string > gInpFiles
list of input XML files
vector< string > gInpDirs
list of input dirs (to look for XML files)
void GetCommandLineArgs(int argc, char **argv)
vector< string > GetAllInputFiles(void)
string gOutFile
output XML file
void MesgThresholds(string inpfile)
vector< string > Split(string input, string delim)
vector< string > GetAllFilesInPath(string path, string extension="")
THE MAIN GENIE PROJECT NAMESPACE
enum genie::EXmlParseStatus XmlParserStatus_t