libyui
|
00001 /************************************************************************** 00002 Copyright (C) 2000 - 2010 Novell, Inc. 00003 All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 00019 **************************************************************************/ 00020 00021 /*---------------------------------------------------------------------\ 00022 | | 00023 | __ __ ____ _____ ____ | 00024 | \ \ / /_ _/ ___|_ _|___ \ | 00025 | \ V / _` \___ \ | | __) | | 00026 | | | (_| |___) || | / __/ | 00027 | |_|\__,_|____/ |_| |_____| | 00028 | | 00029 | core system | 00030 | (C) SuSE GmbH | 00031 \----------------------------------------------------------------------/ 00032 00033 File: YCommandLine.h 00034 00035 Author: Stefan Hundhammer <sh@suse.de> 00036 00037 /-*/ 00038 00039 #ifndef YCommandLine_h 00040 #define YCommandLine_h 00041 00042 #include <string> 00043 #include "ImplPtr.h" 00044 00045 using std::string; 00046 class YCommandLinePrivate; 00047 00048 00052 class YCommandLine 00053 { 00054 public: 00058 YCommandLine(); 00059 00063 ~YCommandLine(); 00064 00070 int argc() const; 00071 00078 char ** argv() const; 00079 00083 int size() const { return argc(); } 00084 00090 string arg( int index ) const; 00091 00100 string operator[]( int index ) const 00101 { return arg( index ); } 00102 00106 void add( const string & arg ); 00107 00113 void remove( int index ); 00114 00120 void replace( int index, const string & arg ); 00121 00129 int find( const string & argName ) const; 00130 00131 00132 private: 00133 00134 ImplPtr<YCommandLinePrivate> priv; 00135 }; 00136 00137 00138 #endif // YCommandLine_h