Changeset 2377 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 10/04/03 12:47:13 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MArgs.cc
r2296 r2377 28 28 // MArgs 29 29 // 30 // This is a helper class for executables to parse command line arguments 31 // 30 32 ////////////////////////////////////////////////////////////////////////////// 31 33 #include "MArgs.h" … … 46 48 } 47 49 50 // -------------------------------------------------------------------------- 51 // 52 // Initializes: 53 // fName: The name of the executable 54 // fArgv: A TList containing all other command line arguments 55 // 48 56 MArgs::MArgs(int argc, const char **argv) : fArgc(argc) 49 57 { … … 61 69 } 62 70 71 // -------------------------------------------------------------------------- 72 // 73 // Deletes fArgv. 74 // 63 75 MArgs::~MArgs() 64 76 { … … 66 78 } 67 79 80 // -------------------------------------------------------------------------- 81 // 82 // Print all arguments parsed. 83 // 68 84 void MArgs::Print(const Option_t *o) const 69 85 { … … 72 88 } 73 89 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 // 74 96 Int_t MArgs::GetInt(const TString name) const 75 97 { … … 77 99 } 78 100 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 // 79 108 Double_t MArgs::GetFloat(const TString name) const 80 109 { … … 82 111 } 83 112 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 // 84 119 TString MArgs::GetString(const TString name) const 85 120 { … … 92 127 } 93 128 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 // 94 136 Int_t MArgs::GetIntAndRemove(const TString name) 95 137 { … … 97 139 } 98 140 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 // 99 149 Double_t MArgs::GetFloatAndRemove(const TString name) 100 150 { … … 102 152 } 103 153 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 // 104 161 TString MArgs::GetStringAndRemove(const TString n) 105 162 { … … 118 175 } 119 176 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 // 120 184 Int_t MArgs::GetArgumentInt(Int_t i) const 121 185 { … … 123 187 } 124 188 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 // 125 196 Float_t MArgs::GetArgumentFloat(Int_t i) const 126 197 { … … 128 199 } 129 200 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 // 130 209 TString MArgs::GetArgumentStr(Int_t i) const 131 210 { … … 146 225 } 147 226 227 // -------------------------------------------------------------------------- 228 // 229 // return the number of arguments without a trainling '-' 230 // 148 231 Int_t MArgs::GetNumArguments() const 149 232 { … … 159 242 } 160 243 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 // 161 251 Bool_t MArgs::Has(const TString n) const 162 252 { … … 171 261 } 172 262 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 // 173 273 Bool_t MArgs::HasOption(const TString n) const 174 274 { -
trunk/MagicSoft/Mars/mbase/MDirIter.cc
r2180 r2377 179 179 } 180 180 181 // -------------------------------------------------------------------------- 182 // 183 // Returns the concatenation of 'dir' and 'name' 184 // 181 185 TString MDirIter::ConcatFileName(const char *dir, const char *name) const 182 186 {
Note:
See TracChangeset
for help on using the changeset viewer.