#include <simplecommandlineapp.h>
Public Member Functions | |
| SimpleCommandLineApp (int argc, char **argv, TDECmdLineOptions *options, const char *programName, const char *version, const char *shortDescription=0, int licenseType=TDEAboutData::License_Unknown, const char *copyrightStatement=0, const char *text=0, const char *homePageAddress=0, const char *bugsEmailAddress="submit@bugs.kde.org") | |
| TDEInstance * | instance () const |
| bool | openDatabase (const TQString &databaseName) |
| bool | closeDatabase () |
| KexiDB::ConnectionData * | connectionData () const |
| KexiDB::Connection * | connection () const |
Public Member Functions inherited from KexiDB::Object | |
| bool | error () const |
| const TQString & | errorMsg () const |
| int | errorNum () const |
| int | previousServerResult () const |
| TQString | previousServerResultName () const |
| void | debugError () |
| virtual void | clearError () |
| virtual TQString | serverErrorMsg () |
| virtual int | serverResult () |
| virtual TQString | serverResultName () |
| TQString | msgTitle () const |
| const TQString | recentSQLString () const |
Protected Attributes | |
| Private *const | d |
Protected Attributes inherited from KexiDB::Object | |
| TQString | m_sql |
| TQString | m_errorSql |
| int | m_serverResult |
| TQString | m_serverResultName |
| TQString | m_serverErrorMsg |
| TQString | m_errMsg |
Additional Inherited Members | |
Protected Member Functions inherited from KexiDB::Object | |
| Object (MessageHandler *handler=0) | |
| virtual void | setError (int code=ERR_OTHER, const TQString &msg=TQString()) |
| virtual void | setError (const TQString &msg) |
| virtual void | setError (const TQString &title, const TQString &msg) |
| void | setError (KexiDB::Object *obj, const TQString &prependMessage=TQString()) |
| virtual void | setError (KexiDB::Object *obj, int code, const TQString &prependMessage=TQString()) |
| virtual int | askQuestion (const TQString &message, KMessageBox::DialogType dlgType, KMessageBox::ButtonCode defaultResult, const KGuiItem &buttonYes=KStdGuiItem::yes(), const KGuiItem &buttonNo=KStdGuiItem::no(), const TQString &dontShowAskAgainName=TQString(), int options=KMessageBox::Notify, MessageHandler *msgHandler=0) |
| virtual void | drv_clearServerResult () |
Detailed Description
A skeleton for creating a simple command line database application.
This class creates a TDEInstance object and automatically handles the following command line options:
- –driver <name> (Database driver name) or -drv
- –user <name> (Database user name) or -u
- –password (Prompt for password) or -p
- –host <name> (Server (host) name) or -h
- –port <number> (Server's port number)
- –local-socket <filename> (Server's local socket filename, if needed) or -s
You can use this helper class to create test applications or small tools that open a KexiDB-compatible database using command line arguments, do some data processing and close the database.
Definition at line 46 of file simplecommandlineapp.h.
Constructor & Destructor Documentation
◆ SimpleCommandLineApp()
| SimpleCommandLineApp::SimpleCommandLineApp | ( | int | argc, |
| char ** | argv, | ||
| TDECmdLineOptions * | options, | ||
| const char * | programName, | ||
| const char * | version, | ||
| const char * | shortDescription = 0, |
||
| int | licenseType = TDEAboutData::License_Unknown, |
||
| const char * | copyrightStatement = 0, |
||
| const char * | text = 0, |
||
| const char * | homePageAddress = 0, |
||
| const char * | bugsEmailAddress = "submit@bugs.kde.org" |
||
| ) |
- Todo:
- make use of pty/tty here! (and care about portability)
Definition at line 82 of file simplecommandlineapp.cpp.
◆ ~SimpleCommandLineApp()
| SimpleCommandLineApp::~SimpleCommandLineApp | ( | ) |
Definition at line 151 of file simplecommandlineapp.cpp.
Member Function Documentation
◆ closeDatabase()
| bool SimpleCommandLineApp::closeDatabase | ( | ) |
Closes database connection previously opened using openDatabase()
- Returns
- true on success. This method is called on destruction. Use KexiDB::Object methods to get status of the operation on failure.
Definition at line 204 of file simplecommandlineapp.cpp.
◆ connection()
| KexiDB::Connection * SimpleCommandLineApp::connection | ( | ) | const |
- Returns
- connection object for this application or 0 if there is no properly opened connection.
Definition at line 225 of file simplecommandlineapp.cpp.
◆ connectionData()
| KexiDB::ConnectionData * SimpleCommandLineApp::connectionData | ( | ) | const |
- Returns
- connection data for this application.
Definition at line 220 of file simplecommandlineapp.cpp.
◆ instance()
| TDEInstance * SimpleCommandLineApp::instance | ( | ) | const |
- Returns
- program instance
Definition at line 215 of file simplecommandlineapp.cpp.
◆ openDatabase()
| bool SimpleCommandLineApp::openDatabase | ( | const TQString & | databaseName | ) |
Opens database databaseName for connection data specified via the command line.
- Returns
- true in success. In details: the database driver is loaded, the connection is opened and the database is used. Use KexiDB::Object methods to get status of the operation on failure.
Definition at line 157 of file simplecommandlineapp.cpp.
Member Data Documentation
◆ d
|
protected |
Definition at line 82 of file simplecommandlineapp.h.
The documentation for this class was generated from the following files:

Public Member Functions inherited from