tDirectoriesCommandLineAnalyzer Class Reference

Inheritance diagram for tDirectoriesCommandLineAnalyzer:

Inheritance graph
[legend]
Collaboration diagram for tDirectoriesCommandLineAnalyzer:

Collaboration graph
[legend]

List of all members.

Private Member Functions

virtual void DoInitialize (tCommandLineParser &parser)
 Prints option help.
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 1569 of file tDirectories.cpp.


Member Function Documentation

virtual void tDirectoriesCommandLineAnalyzer::DoInitialize ( tCommandLineParser parser  )  [inline, private, virtual]

Prints option help.

Parameters:
parser parser to analyze

Reimplemented from tCommandLineAnalyzer.

Definition at line 1572 of file tDirectories.cpp.

References tCommandLineParser::Executable(), FindConfigurationPath(), FindDataPath(), s_topSourceDir, tPathToExecutable::Set(), st_DataDir, st_IncludedResourceDir, st_UserDataDir, TestConfigurationPath(), TestDataPath(), and TestPath().

01573     {
01574         // Puts the data files in the executable's bundle
01575 #ifndef MACOSX_XCODE
01576         try
01577         {
01578             st_pathToExecutable.Set( parser.Executable() );
01579             FindDataPath();
01580             FindConfigurationPath();
01581         }
01582         catch( tRunningInBuildDirectory )
01583         {
01584             // last fallback for debugging (activated only if there is data in the current directory)
01585             if ( TestPath( ".", "language/languages.txt") && TestDataPath(s_topSourceDir) && TestConfigurationPath(st_DataDir + "/config") )
01586             {
01587                 // we must be running the game in debug mode; set user data dir to current directory.
01588                 st_UserDataDir = ".";
01589 
01590                 // the included resources are scrambled and put into the current directory as well.
01591                 st_IncludedResourceDir = "./resource/included";
01592                 return;
01593             }
01594         }
01595 #endif // !MACOSX_XCODE
01596 
01597 
01598     }

Here is the call graph for this function:

virtual bool tDirectoriesCommandLineAnalyzer::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 1600 of file tDirectories.cpp.

References GetPrefix(), tCommandLineParser::GetSwitch(), ReadDir(), st_AutoResourceDir, st_ConfigDir, st_DataDir, st_ResourceDir, st_UserConfigDir, st_UserDataDir, and st_VarDir.

01601     {
01602         if( ReadDir( parser, st_DataDir, "--datadir" ) ) return true;
01603         if( ReadDir( parser, st_UserDataDir, "--userdatadir" ) ) return true;
01604         if( ReadDir( parser, st_ConfigDir, "--configdir" ) ) return true;
01605         if( ReadDir( parser, st_UserConfigDir, "--userconfigdir" ) ) return true;
01606         if( ReadDir( parser, st_VarDir, "--vardir" ) ) return true;
01607         if( ReadDir( parser, st_ResourceDir, "--resourcedir" ) ) return true;
01608         if( ReadDir( parser, st_AutoResourceDir, "--autoresourcedir" ) ) return true;
01609 
01610         if ( parser.GetSwitch( "--path-no-absolutecheck" ) )
01611         {
01612             st_checkPathAbsolute = false;
01613             return true;
01614         }
01615 
01616         if ( parser.GetSwitch( "--path-no-relativecheck" ) )
01617         {
01618             st_checkPathRelative = false;
01619             return true;
01620         }
01621 
01622         if ( parser.GetSwitch( "--path-no-hiddencheck" ) )
01623         {
01624             st_checkPathHidden = false;
01625             return true;
01626         }
01627 
01628         if ( parser.GetSwitch( "--prefix" ) )
01629         {
01630             std::cout << GetPrefix() << '\n';
01631             throw 1;
01632             return true;
01633         }
01634 
01635         return false;
01636     }

Here is the call graph for this function:

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

Analyzes the command line option.

Parameters:
s string to write help to

Implements tCommandLineAnalyzer.

Definition at line 1638 of file tDirectories.cpp.

01639     {                                      //
01640         s << "--datadir <Directory>        : read game data (textures, sounds and texts)\n"
01641         <<   "                               from this directory\n";
01642         s << "--userdatadir <Directory>    : read customized game data from this directory\n";
01643         s << "--configdir <Directory>      : read game configuration (.cfg-files)\n"
01644         <<   "                               from this directory\n";
01645         s << "--userconfigdir <Directory>  : read user game configuration from this directory\n";
01646         s << "--vardir <Directory>         : save game logs and highscores in this directory\n\n";
01647         s << "--resourcedir <Directory>    : look for resources in this directory\n\n";
01648         s << "--autoresourcedir <Directory>: download missing resources into this directory\n\n";
01649         s << "--path-no-absolutecheck      : disables security check against absolute paths\n";
01650         s << "--path-no-hiddencheck        : disables security check against hidden paths\n";
01651         s << "--path-no-relativecheck      : disables security check against relative paths.\n"
01652         <<   "                               Not recommended, this check is really important.\n\n";
01653         s << "--prefix                     : prints the prefix the game was installed to\n";
01654     }


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