ProcessCmdLine Struct Reference

List of all members.

Public Member Functions

 ProcessCmdLine ()
void Process (wxCmdLineParser &parser)

Public Attributes

std::vector< std::string > argv
bool console
bool debug
bool quiet
bool help
bool graphical_dialog
bool text_dialog
bool no_console
bool proceed
std::map< std::string,
std::string > 
param_map
std::vector< std::string > input_file


Detailed Description

Definition at line 34 of file bbi.cxx.


Constructor & Destructor Documentation

ProcessCmdLine::ProcessCmdLine (  )  [inline]

Definition at line 36 of file bbi.cxx.

00036 {}


Member Function Documentation

void ProcessCmdLine::Process ( wxCmdLineParser &  parser  ) 

Definition at line 56 of file bbi.cxx.

References _T, console, debug, bbtk::GetVersion(), graphical_dialog, help, input_file, no_console, param_map, proceed, quiet, text_dialog, and bbtk::wx2std().

Referenced by main(), and wxBBIApp::OnCmdLineParsed().

00057 {
00058   proceed = true;
00059   if (parser.Found(_T("D"))) 
00060     {
00061       bbtk::StaticInitTime::PrintObjectListInfo = true;
00062     }
00063   
00064   debug = ( parser.Found(_T("d")) );  
00065   quiet = ( parser.Found(_T("q")) );
00066   help = ( parser.Found(_T("h")) );
00067   graphical_dialog = ( parser.Found(_T("g")) );
00068   text_dialog = ( parser.Found(_T("t")) );
00069   no_console = ( parser.Found(_T("N")) );
00070   
00071   if (quiet) bbtk::MessageManager::SetMessageLevel("max",0);
00072   if (debug) bbtk::MessageManager::SetMessageLevel("all",9);
00073 
00074   // parse the arguments and consider those which contain a "=" 
00075   // as set input commands, other as files
00076   int pargc = parser.GetParamCount();
00077   for (int i=0; i<pargc; ++i) 
00078     {
00079       std::string s = bbtk::wx2std(parser.GetParam(i));
00080       std::string::size_type pos = s.find_first_of("=");
00081       if (std::string::npos != pos) 
00082         {
00083           std::string left = s.substr(0,pos);
00084           std::string right = s.substr(pos+1,s.size());
00085           param_map[left]=right;
00086         }
00087       else 
00088         {
00089           input_file.push_back(s);
00090         }
00091     }
00092 
00093   bool usage = (help && (input_file.size()==0));
00094   if (usage) {
00095     std::cout << "BBI (The Black Box Interpreter) - bbtk "
00096               << bbtk::GetVersion() << " - (c) Creatis 2007-2008"
00097               << std::endl;
00098     parser.Usage();
00099     proceed = false;
00100   }
00101 
00102   console = ( parser.Found(_T("c")) || 
00103               ((input_file.size() == 0) && 
00104                (!no_console) &&
00105                (!usage) ) );
00106   
00107 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

std::vector<std::string> ProcessCmdLine::argv

Definition at line 40 of file bbi.cxx.

Definition at line 41 of file bbi.cxx.

Referenced by wxBBIApp::OnInit(), and Process().

Definition at line 42 of file bbi.cxx.

Referenced by wxBBIApp::OnInit(), and Process().

Definition at line 43 of file bbi.cxx.

Referenced by wxBBIApp::OnInit(), and Process().

Definition at line 44 of file bbi.cxx.

Referenced by main(), wxBBIApp::OnInit(), and Process().

Definition at line 45 of file bbi.cxx.

Referenced by wxBBIApp::OnInit(), and Process().

Definition at line 46 of file bbi.cxx.

Referenced by main(), wxBBIApp::OnInit(), and Process().

Definition at line 47 of file bbi.cxx.

Referenced by main(), wxBBIApp::OnInit(), and Process().

Definition at line 48 of file bbi.cxx.

Referenced by main(), and Process().

std::map<std::string,std::string> ProcessCmdLine::param_map

Definition at line 49 of file bbi.cxx.

Referenced by main(), wxBBIApp::OnInit(), and Process().

std::vector<std::string> ProcessCmdLine::input_file

Definition at line 50 of file bbi.cxx.

Referenced by main(), wxBBIApp::OnInit(), and Process().


The documentation for this struct was generated from the following file:

Generated on Wed Nov 12 11:38:15 2008 for BBTK by  doxygen 1.5.6