19 #ifndef _KCMDLINEARGS_H_ 20 #define _KCMDLINEARGS_H_ 22 #include "kdelibs_export.h" 25 #include <tqptrlist.h> 27 #include <tqvaluelist.h> 29 typedef TQValueList<TQCString> QCStringList;
68 #define KCmdLineLastOption { 0, 0, 0 } 70 class KCmdLineArgsList;
73 class KCmdLineParsedOptions;
74 class KCmdLineParsedArgs;
76 class KCmdLineArgsPrivate;
226 friend class TQPtrList<KCmdLineArgs>;
249 static void init(
int _argc,
char **_argv,
const char *_appname,
250 const char* programName,
const char *_description,
251 const char *_version,
bool noKApp =
false);
258 static void init(
int _argc,
char **_argv,
259 const char *_appname,
const char *_description,
260 const char *_version,
bool noKApp =
false) KDE_DEPRECATED;
275 static void init(
int _argc,
char **_argv,
276 const KAboutData *about,
bool noKApp =
false);
358 const char *name=0,
const char *
id = 0,
359 const char *afterId=0);
370 static KCmdLineArgs *parsedArgs(
const char *
id=0);
381 static TQString cwd();
387 static const char *appName();
396 static void usage(
const char *
id = 0);
402 static void usage(
const TQString &error);
410 static void enable_i18n();
433 TQCString getOption(
const char *option)
const;
451 QCStringList getOptionList(
const char *option)
const;
467 bool isSet(
const char *option)
const;
485 const char *arg(
int n)
const;
500 KURL url(
int n)
const;
508 static KURL makeURL(
const char * urlArg );
516 static void setCwd(
char * cwd ) { mCwd = cwd; }
535 static void loadAppArgs( TQDataStream &);
541 static void addTempFileOption();
549 static bool isTempFileSet();
574 static void findOption(
const char *_opt, TQCString opt,
int &i,
bool enabled,
bool &moreOptions);
582 static void parseAllArgs();
589 static int *qt_argc();
597 static char ***qt_argv();
606 static void removeArgs(
const char *
id);
613 static void saveAppArgs( TQDataStream &);
620 void setOption(
const TQCString &option,
bool enabled);
627 void setOption(
const TQCString &option,
const char *value);
634 void addArgument(
const char *argument);
641 void save( TQDataStream &)
const;
648 void load( TQDataStream &);
665 static void initIgnore(
int _argc,
char **_argv,
const char *_appname);
667 static void printQ(
const TQString &msg);
672 KCmdLineParsedOptions *parsedOptionList;
673 KCmdLineParsedArgs *parsedArgList;
676 static KCmdLineArgsList *argsList;
682 static bool ignoreUnknown;
684 static bool parseArgs;
686 KCmdLineArgsPrivate *d;
Represents and parses a URL.
const char * def
The default value for the option, if it is not specified on the command line.
Controls and provides information to all KDE applications.
const char * description
The text description of the option as should appear in myapp –help.
A class for command-line argument handling.
static void setCwd(char *cwd)
Made public for apps that don't use KCmdLineArgs To be done before makeURL, to set the current workin...
Structure that holds command line options.
This class is used to store information about a program.
Maintains only a single instance of a running application at a time.
const char * name
The name of the argument as it should be called on the command line and appear in myapp –help...