• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

KCmdLineOptions Class Reference

Class that holds command line options. More...

#include <kcmdlineargs.h>

List of all members.

Public Member Functions

KCmdLineOptions & add (const KCmdLineOptions &options)
KCmdLineOptions & add (const QByteArray &name, const KLocalizedString &description=KLocalizedString(), const QByteArray &defaultValue=QByteArray())
 KCmdLineOptions (const KCmdLineOptions &options)
 KCmdLineOptions ()
KCmdLineOptions & operator= (const KCmdLineOptions &options)
 ~KCmdLineOptions ()

Detailed Description

Class that holds command line options.

This class is intended to be used with the KCmdLineArgs class, which provides convenient and powerful command line argument parsing and handling functionality.

See also:
KCmdLineArgs for additional usage information

Definition at line 48 of file kcmdlineargs.h.


Constructor & Destructor Documentation

KCmdLineOptions::KCmdLineOptions (  ) 

Constructor.

Definition at line 123 of file kcmdlineargs.cpp.

KCmdLineOptions::KCmdLineOptions ( const KCmdLineOptions &  options  ) 

Copy constructor.

Definition at line 132 of file kcmdlineargs.cpp.

KCmdLineOptions::~KCmdLineOptions (  ) 

Destructor.

Definition at line 127 of file kcmdlineargs.cpp.


Member Function Documentation

KCmdLineOptions & KCmdLineOptions::add ( const KCmdLineOptions &  options  ) 

Add all options from another KCmdLineOptions object.

Parameters:
options options to add

Definition at line 155 of file kcmdlineargs.cpp.

KCmdLineOptions & KCmdLineOptions::add ( const QByteArray &  name,
const KLocalizedString &  description = KLocalizedString(),
const QByteArray &  defaultValue = QByteArray() 
)

Add command line option, by providing its name, description, and possibly a default value.

These will print out when myapp --help is called on the command line.

Note that if the option name begins with "no" that you will need to test for the name without the "no" and the result will be the inverse of what is specified. i.e. if "nofoo" is the name of the option and myapp --nofoo is called:

 KCmdLineArgs::parsedArgs()->isSet("foo"); // false
Parameters:
name option name
description option description, made available for translation; can be left off
defaultValue default option value, when the value is not specified on the command line; can be left off

Definition at line 145 of file kcmdlineargs.cpp.

KCmdLineOptions & KCmdLineOptions::operator= ( const KCmdLineOptions &  options  ) 

Assignment operator.

Definition at line 137 of file kcmdlineargs.cpp.


The documentation for this class was generated from the following files:
  • kcmdlineargs.h
  • kcmdlineargs.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal