From: Daniel M. <tub...@us...> - 2003-06-02 20:37:54
|
Update of /cvsroot/epp-rtk/epp-rtk/c++/src In directory sc8-pr-cvs1:/tmp/cvs-serv9802 Modified Files: testTools.cc testTools.h Log Message: easier-to-use handleArgs() with vector of strings of extra usage Index: testTools.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/testTools.cc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** testTools.cc 28 May 2003 19:56:46 -0000 1.22 --- testTools.cc 2 Jun 2003 20:37:50 -0000 1.23 *************** *** 188,191 **** --- 188,200 ---- const string & extra_usage) { + vector<string> extra_usage_vec; + if ( ! extra_usage.empty() ) extra_usage_vec.push_back(extra_usage); + return handleArgs(sess,argc,argv,username,password,extra_usage_vec); + } + + bool handleArgs(epp_Session & sess, int argc, char * argv[], + string & username, string & password, + const vector<string> & extra_usage) + { // CHANGE TRANSPORT HERE: typedef epp_TransportSSL myTransport; *************** *** 234,240 **** } ! if (!extra_usage.empty()) { cout << endl; ! cout << prognamespaces << " " << extra_usage; } --- 243,253 ---- } ! if ( extra_usage.size() > 0 ) { ! for ( vector<string>::const_iterator i = extra_usage.begin(); ! i != extra_usage.end(); ! i++ ) { cout << endl; ! cout << prognamespaces << " " << *i; ! } } Index: testTools.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/testTools.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** testTools.h 22 May 2003 20:27:07 -0000 1.16 --- testTools.h 2 Jun 2003 20:37:51 -0000 1.17 *************** *** 107,110 **** --- 107,125 ---- const std::string & extra_usage = (std::string)""); + /** Function that handles the command line arguments sent to the program + * and initializes the transport accordingly + * @param sess Session to use when communicating with server + * @param argc Count of command line arguments + * @param argv Actual command line arguments + * @param username Login name on server + * @param password Password on server + * @param extra_usage Extra usage parameters + * @return true if arguments set correcetly, otherwise false + */ + bool handleArgs(eppobject::epp::epp_Session & sess, + int argc, char * argv[], + std::string & username, std::string & password, + const std::vector<std::string> & extra_usage); + /** Function that tries to login to a server using information in the * eppobject::epp::epp_Session object |