14#include "TInterpreter.h"
18int usage(
const std::string& command_name,
int exit_code );
21 int parse(
int argc,
char *argv[] );
23 std::string m_connectionString =
"sqlite://;schema=/afs/cern.ch/user/a/atlasdqm/dqmdisk1/cherrypy-devel/RefDB.db;dbname=REFDB";
24 long m_runNumber = 2147483646;
40 int rc = arg.parse( argc, argv );
43 std::string infileName( arg.mconfig );
47 std::string outfileName;
49 std::string::size_type s = infileName.size();
50 std::string::size_type p = infileName.rfind(
'.', s );
51 outfileName = infileName.substr( 0, p );
52 outfileName +=
".hcfg";
55 config.AssembleAndSave( infileName, outfileName, arg.m_connectionString, arg.m_runNumber, arg.m_bulk);
66int CmdLineArgs::parse(
int argc,
char *argv[] )
69 if( argc > 10 )
return usage( command, 1 );
70 if( argc < 2 )
return usage( command, 0 );
78 std::string par0 =
argv[
ic];
81 m_connectionString =
argv[
ic + 1];
82 std::cout <<
"Setting DB connection string to " << m_connectionString << std::endl;
85 }
else if(par0 ==
"-r") {
88 m_runNumber = std::stol(argv[ic + 1]);
89 std::cout <<
"Setting run number to " << m_runNumber << std::endl;
91 }
catch(std::exception& e) {
92 std::cout <<
"Error with input arguments, specified run " <<
argv[
ic+1] <<
" not a long" <<
'\n';
95 }
else if(par0 ==
"-b") {
97 m_bulk = (strcmp(argv[ic+1],
"true") == 0);
98 std::cout <<
"Setting bulk processing mode to " << (m_bulk ?
"true" :
"false") << std::endl;
111int usage(
const std::string& command_name,
int exit_code )
115 message +=
"This program takes as an argument the name of a file containing\n";
116 message +=
"a MiniConfig configuration and produces a similarly named Root file\n";
117 message +=
"containing a configuration for the \'han\' application\n";
119 std::string::size_type
s = command_name.size();
120 std::string::size_type
p = command_name.rfind(
'/', s );
121 std::string short_name = command_name.substr( p+1, s );
124 std::cout <<
"Usage: " << short_name <<
" <filename>\n";
int main(int, char **)
Main class for all the CppUnit test classes.
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
static ConditionsSingleton & getInstance()
void setCondition(const std::string &c)
int ir
counter of the current depth
void ubsan_suppress(void(*func)())
Helper for suppressing ubsan warnings.
Helper for suppressing ubsan warnings.