kpilot/lib
PilotAppInfoBase Class Reference
#include <pilotDatabase.h>
Inheritance diagram for PilotAppInfoBase:

Detailed Description
Base class for all specific kinds of AppInfo.
Definition at line 195 of file pilotDatabase.h.
Public Member Functions | |
PilotAppInfoBase (PilotDatabase *d) | |
virtual | ~PilotAppInfoBase () |
CategoryAppInfo * | categoryInfo () |
CategoryAppInfo * | categoryInfo () const |
PI_SIZE_T | length () const |
int | findCategory (const QString &name, bool unknownIsUnfiled=false) |
void | dump () const |
QString | category (unsigned int i) |
bool | setCategoryName (unsigned int i, const QString &s) |
Static Public Member Functions | |
static int | findCategory (const QString &name, bool unknownIsUnfiled, struct CategoryAppInfo *info) |
static void | dumpCategories (const struct CategoryAppInfo &info) |
Static Public Attributes | |
static const int | MAX_APPINFO_SIZE = 8192 |
Protected Member Functions | |
PilotAppInfoBase () | |
void | init (struct CategoryAppInfo *c, int len) |
Constructor & Destructor Documentation
PilotAppInfoBase::PilotAppInfoBase | ( | ) | [inline, protected] |
Constructor.
This is for use by derived classes (using the template below only, and says that the category info in the base class aliases data in the derived class. Remember to call init()!
Definition at line 202 of file pilotDatabase.h.
PilotAppInfoBase::PilotAppInfoBase | ( | PilotDatabase * | d | ) |
Constructor, intended for untyped access to the AppInfo only.
This throws away everything but the category information. In this variety, the CategoryAppInfo structure is owned by the PilotAppInfoBase object.
Definition at line 114 of file pilotDatabase.cc.
PilotAppInfoBase::~PilotAppInfoBase | ( | ) | [virtual] |
Member Function Documentation
QString PilotAppInfoBase::category | ( | unsigned int | i | ) |
Gets a single category name.
Returns QString::null if there is no such category number i
.
Definition at line 188 of file pilotDatabase.cc.
struct CategoryAppInfo* PilotAppInfoBase::categoryInfo | ( | ) | const [inline] |
struct CategoryAppInfo* PilotAppInfoBase::categoryInfo | ( | ) | [inline] |
Retrieve the most basic part of the AppInfo block -- the category information which is guaranteed to be the first 240-odd bytes of a database.
Definition at line 229 of file pilotDatabase.h.
void PilotAppInfoBase::dump | ( | ) | const |
void PilotAppInfoBase::dumpCategories | ( | const struct CategoryAppInfo & | info | ) | [static] |
For debugging, display category names for the given AppInfo structure.
Called by dump().
Definition at line 164 of file pilotDatabase.cc.
int PilotAppInfoBase::findCategory | ( | const QString & | name, | |
bool | unknownIsUnfiled = false | |||
) | [inline] |
int PilotAppInfoBase::findCategory | ( | const QString & | name, | |
bool | unknownIsUnfiled, | |||
struct CategoryAppInfo * | info | |||
) | [static] |
Search for the given category name
in the list of categories; returns the category number.
If unknownIsUnfiled
is true, then map unknown categories to Unfiled instead of returning an error number.
- Returns:
- >=0 is a specific category based on the text-to- category number mapping defined by the Pilot, where 0 is always the 'unfiled' category.
-1 means unknown category selected when
unknownIsUnfiled
is false.0 == Unfiled means unknown category selected when
unknownIsUnfiled
is true.
Definition at line 130 of file pilotDatabase.cc.
void PilotAppInfoBase::init | ( | struct CategoryAppInfo * | c, | |
int | len | |||
) | [inline, protected] |
Initialize class members after reading header, to alias data elsewhere.
Only for use by the (derived) template classes below.
Definition at line 207 of file pilotDatabase.h.
PI_SIZE_T PilotAppInfoBase::length | ( | ) | const [inline] |
bool PilotAppInfoBase::setCategoryName | ( | unsigned int | i, | |
const QString & | s | |||
) |
Sets a category name.
- Returns:
- true if this succeeded.
false on failure, e.g. the index
i
was out of range or the category name was invalid. Category names that are too long are truncated to 15 characters.
Definition at line 194 of file pilotDatabase.cc.
Member Data Documentation
const int PilotAppInfoBase::MAX_APPINFO_SIZE = 8192 [static] |
Maximum size of an AppInfo block, taken roughly from the pilot-link source.
Definition at line 215 of file pilotDatabase.h.
The documentation for this class was generated from the following files: