19 #ifndef _TDECMDLINEARGS_H_
20 #define _TDECMDLINEARGS_H_
22 #include "tdelibs_export.h"
25 #include <tqptrlist.h>
27 #include <tqvaluelist.h>
29 typedef TQValueList<TQCString> QCStringList;
68 #define TDECmdLineLastOption { 0, 0, 0 }
70 class TDECmdLineArgsList;
73 class TDECmdLineParsedOptions;
74 class TDECmdLineParsedArgs;
76 class TDECmdLineArgsPrivate;
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) TDE_DEPRECATED;
275 static void init(
int _argc,
char **_argv,
358 const char *name=0,
const char *
id = 0,
359 const char *afterId=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 *tqt_argc();
597 static char ***tqt_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 TDECmdLineParsedOptions *parsedOptionList;
673 TDECmdLineParsedArgs *parsedArgList;
676 static TDECmdLineArgsList *argsList;
682 static bool ignoreUnknown;
684 static bool parseArgs;
686 TDECmdLineArgsPrivate *d;
Represents and parses a URL.
This class is used to store information about a program.
Controls and provides information to all KDE applications.
A class for command-line argument handling.
static void setCwd(char *cwd)
Made public for apps that don't use TDECmdLineArgs To be done before makeURL, to set the current work...
Maintains only a single instance of a running application at a time.
Structure that holds command line options.
const char * name
The name of the argument as it should be called on the command line and appear in myapp –help.
const char * def
The default value for the option, if it is not specified on the command line.
const char * description
The text description of the option as should appear in myapp –help.