5 #ifndef UTILITIES_COLLECTION_DSTINFO
6 #define UTILITIES_COLLECTION_DSTINFO
23 class DstInfo :
public CmdLineArgs2
37 std::pair<std::string,std::string>
nameAndType(
unsigned int);
39 std::string
name(
unsigned int);
40 std::string
type(
unsigned int);
56 markers[
"-dst"].desc <<
"<output collection name> <output collection type> " << std::endl
57 <<
"List of name-type pairs is space separated; "
58 <<
"Choices for collection types are " << std::endl;
63 markers[
"-dst"].desc << *at << std::endl;
65 markers[
"-dstconnect"].desc <<
"[Output database connection string] " << std::endl
66 <<
"The connection string will be looked up in $CORAL_DBLOOKUP_PATH/dblookup.xml" << std::endl
67 <<
"Database user authentication is done using CORAL_AUTH_PATH/authentication.xml" << std::endl
68 <<
" or CORAL_AUTH_USER and CORAL_AUTH_PASSWORD variables" << std::endl;
79 if (!retc)
return retc;
81 if ( this->
hasQual(
"-dstconnect") ) {
82 int ifirst = (*this)[
"-dstconnect"].first;
87 int ifirst = (*this)[
"-dst"].first;
88 int ilast = (*this)[
"-dst"].second;
89 std::string dstCollName =
"";
90 std::string dstCollType =
"";
93 dstCollName = std::string(
argv[
i]); ++
i;
94 dstCollType = std::string(
argv[
i]);
101 std::cerr <<
" ERROR Collection type " << dstCollType
102 <<
" is not presently handled by this program."
116 inline std::pair<std::string,std::string>
122 std::cerr <<
"Out of range request for dst (name,type) pair" << std::endl;
123 return std::pair<std::string,std::string>(
"BAD",
"BAD");
132 std::cerr <<
"Out of range request for dst name" << std::endl;
133 return std::string(
"BAD");
142 std::cerr <<
"Out of range request for dst type" << std::endl;
143 return std::string(
"BAD");
151 return this->
nArgs(
"-dst");
156 #endif // UTILITIES_COLLECTION_DSTINFO