|
-
March 28th, 2009, 04:24 AM
#1
argv processing
Getting bogged down on finishing my first serious prog.
I have created a class to hold all command line args, constants, program variables (perhaps globals and constants better describes it):
Code:
class c_program_variables
{
public:
string m_testname;
// output filenames
string m_s_filename_timout_piped;
string m_s_filename_timout_evt;
string m_s_filename_timout_err;
// Input file names
string m_s_filename_comout;
string m_s_filename_runout;
// error terminates run, warning written to m_s_filename_timout_err
bool m_b_error_flag;
bool m_b_warning_flag;
int m_i_95_percentile; // additional percentile output req'd
int m_i_response_precision;
bool m_b_timout_evt_reqd; // output formatted timeout
bool m_b_timout_piped_reqd; // output piped timout for spreadsheet input
// timestamp limits input by arguments
static time_t d_starttime; // = 0;
time_t d_endtime; // = 159999999;
// timestamps used to store min and max in comout
time_t d_earliesttime; // = 159999999;
time_t d_latesttime; // = 0;
// methods
c_program_variables::c_program_variables (int argc, char *argv);
}
I want the constructor to process argc, argv and set the other various global type information.
Qs
1. Is this a good idea?
2. How do I usefully pass *argv[] into my constructor?
Any help greatly appreciated. Nigel
Last edited by nigelhoath; March 28th, 2009 at 04:53 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|