Ignore:
Timestamp:
10/04/03 12:47:13 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MArgs.cc

    r2296 r2377  
    2828// MArgs
    2929//
     30// This is a helper class for executables to parse command line arguments
     31//
    3032//////////////////////////////////////////////////////////////////////////////
    3133#include "MArgs.h"
     
    4648}
    4749
     50// --------------------------------------------------------------------------
     51//
     52// Initializes:
     53//  fName: The name of the executable
     54//  fArgv: A TList containing all other command line arguments
     55//
    4856MArgs::MArgs(int argc, const char **argv) : fArgc(argc)
    4957{
     
    6169}
    6270
     71// --------------------------------------------------------------------------
     72//
     73// Deletes fArgv.
     74//
    6375MArgs::~MArgs()
    6476{
     
    6678}
    6779
     80// --------------------------------------------------------------------------
     81//
     82// Print all arguments parsed.
     83//
    6884void MArgs::Print(const Option_t *o) const
    6985{
     
    7288}
    7389
     90// --------------------------------------------------------------------------
     91//
     92// Return the Integer corresponding to the command line argument 'name'
     93//  eg. executable -argument 5
     94//      GetInt("argument") will return 5
     95//
    7496Int_t MArgs::GetInt(const TString name) const
    7597{
     
    7799}
    78100
     101// --------------------------------------------------------------------------
     102//
     103// Return the floating point value corresponding to the command line argument
     104// 'name'
     105//  eg. executable -argument 5.7
     106//      GetFloat("argument") will return 5.7
     107//
    79108Double_t MArgs::GetFloat(const TString name) const
    80109{
     
    82111}
    83112
     113// --------------------------------------------------------------------------
     114//
     115// Return the TString corresponding to the command line argument 'name'
     116//  eg. executable -argument=last
     117//      GetString("-argument=") will return "last"
     118//
    84119TString MArgs::GetString(const TString name) const
    85120{
     
    92127}
    93128
     129// --------------------------------------------------------------------------
     130//
     131// Return the Integer corresponding to the command line argument 'name'
     132//  eg. executable -argument5
     133//      GetIntAndRemove("-argument") will return 5
     134// and removes the argument from the internal list.
     135//
    94136Int_t MArgs::GetIntAndRemove(const TString name)
    95137{
     
    97139}
    98140
     141// --------------------------------------------------------------------------
     142//
     143// Return the floating point value corresponding to the command line argument
     144// 'name'
     145//  eg. executable -argument5.7
     146//      GetFloatAndRemove("-argument") will return 5.7
     147// and removes the argument from the internal list.
     148//
    99149Double_t MArgs::GetFloatAndRemove(const TString name)
    100150{
     
    102152}
    103153
     154// --------------------------------------------------------------------------
     155//
     156// Return the TString corresponding to the command line argument 'name'
     157//  eg. executable -argument=last
     158//      GetStringAndRemove("-argument=") will return "last"
     159// and removes the argument from the internal list.
     160//
    104161TString MArgs::GetStringAndRemove(const TString n)
    105162{
     
    118175}
    119176
     177// --------------------------------------------------------------------------
     178//
     179// Return the Integer corresponding to the i-th argument. This is ment
     180// for enumerations like
     181//  executable 1 7 2
     182//  GetArgumentInt(1) will return 7
     183//
    120184Int_t MArgs::GetArgumentInt(Int_t i) const
    121185{
     
    123187}
    124188
     189// --------------------------------------------------------------------------
     190//
     191// Return the floating point value corresponding to the i-th argument.
     192// This is ment for enumerations like
     193//  executable 1.7 7.5 2.3
     194//  GetArgumentFloat(1) will return 7.5
     195//
    125196Float_t MArgs::GetArgumentFloat(Int_t i) const
    126197{
     
    128199}
    129200
     201// --------------------------------------------------------------------------
     202//
     203// Return the TString corresponding to the i-th argument.
     204// This is ment for enumerations like
     205//  executable file1 file2 file3
     206//  GetArgumentStr(1) will return "file2"
     207// Only arguments without a trailing '-' are considered
     208//
    130209TString MArgs::GetArgumentStr(Int_t i) const
    131210{
     
    146225}
    147226
     227// --------------------------------------------------------------------------
     228//
     229// return the number of arguments without a trainling '-'
     230//
    148231Int_t MArgs::GetNumArguments() const
    149232{
     
    159242}
    160243
     244// --------------------------------------------------------------------------
     245//
     246// Checks whether an argument beginning with 'n' is existing, eg:
     247//  executable -value5
     248//  executable -value
     249//  HasOption("-value") will return true in both cases
     250//
    161251Bool_t MArgs::Has(const TString n) const
    162252{
     
    171261}
    172262
     263// --------------------------------------------------------------------------
     264//
     265// Checks whether an argument beginning with 'n' is exists and a
     266// corresponding option is available, eg.
     267//  executable -value5
     268//  HasOption("-value") will return true
     269// but:
     270//  executable -value
     271//  HasOption("-value") will return false
     272//
    173273Bool_t MArgs::HasOption(const TString n) const
    174274{
  • trunk/MagicSoft/Mars/mbase/MDirIter.cc

    r2180 r2377  
    179179}
    180180
     181// --------------------------------------------------------------------------
     182//
     183//  Returns the concatenation of 'dir' and 'name'
     184//
    181185TString MDirIter::ConcatFileName(const char *dir, const char *name) const
    182186{
Note: See TracChangeset for help on using the changeset viewer.