rFastForwardCommandLineAnalyzer Class Reference

Inheritance diagram for rFastForwardCommandLineAnalyzer:

Inheritance graph
[legend]
Collaboration diagram for rFastForwardCommandLineAnalyzer:

Collaboration graph
[legend]

List of all members.

Private Member Functions

virtual bool DoAnalyze (tCommandLineParser &parser)
 Analyzes the command line option.
virtual void DoHelp (std::ostream &s)
 Analyzes the command line option.


Detailed Description

Definition at line 427 of file rSysdep.cpp.


Member Function Documentation

virtual bool rFastForwardCommandLineAnalyzer::DoAnalyze ( tCommandLineParser parser  )  [inline, private, virtual]

Analyzes the command line option.

Parameters:
parser parser to analyze
Returns:
true if anaysis was succesful

Implements tCommandLineAnalyzer.

Definition at line 430 of file rSysdep.cpp.

References tCommandLineParser::GetOption(), tCommandLineParser::GetSwitch(), s_benchmark, s_fastForward, s_fastForwardTo, s_videoout, and s_videooutDest.

00430        :
00431     virtual bool DoAnalyze( tCommandLineParser & parser )
00432     {
00433         // get option
00434         tString forward;
00435         if ( parser.GetOption( forward, "--fastforward" ) )
00436         {
00437             // set fast forward mode
00438             s_fastForward = true;
00439 
00440             // read time
00441             std::stringstream str(static_cast< char const * >( forward ) );
00442             str >> s_fastForwardTo;
00443 
00444             return true;
00445         }
00446 
00447         if ( parser.GetSwitch( "--benchmark" ) )
00448         {
00449             // set benchmark mode
00450             s_benchmark = true;
00451             return true;
00452         }
00453 
00454 #ifndef DEDICATED
00455         if ( parser.GetSwitch( "--videoout" ) )
00456         {
00457             // redirect all regular output to stderr
00458             if ((s_videooutDest = dup(fileno(stdout))) == -1)
00459                 std::cout << "Warning: Failed to duplicate stdout descriptor for video\n";
00460             else {
00461                 if (-1 == dup2(fileno(stderr), fileno(stdout)))
00462                     std::cout << "Warning: Failed to redirect default output to stderr\n";
00463                 else
00464                     std::cout << "Video Output: normal output redirected to stderr\n";
00465             }
00466             // set video out mode
00467             s_videoout = true;
00468             return true;
00469         }
00470 #endif
00471 
00472         return false;
    }

Here is the call graph for this function:

virtual void rFastForwardCommandLineAnalyzer::DoHelp ( std::ostream &  s  )  [inline, private, virtual]

Analyzes the command line option.

Parameters:
s string to write help to

Implements tCommandLineAnalyzer.

Definition at line 474 of file rSysdep.cpp.

00476     {                                      //
00477         s << "--fastforward <time>         : lets time run very fast until the given time is reached\n";
00478         s << "--benchmark                  : renders frames as they were recorded\n";
00479 #ifndef DEDICATED
00480         s << "--videoout                   : writes a raw video stream of frames to stdout\n";
00481 #endif


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:52:29 2008 for Armagetron Advanced by  doxygen 1.5.4