kpilot
PilotAppInfoBase Class Reference
A database on the handheld has an "AppInfo" block at the beginning with some database-specific information and a common part. More...
#include <pilotAppInfo.h>
Public Member Functions | |
struct CategoryAppInfo * | categoryInfo () const |
struct CategoryAppInfo * | categoryInfo () |
QString | categoryName (unsigned int i) const |
void | dump () const |
int | findCategory (const QString &name, bool unknownIsUnfiled=false) const |
PI_SIZE_T | length () const |
PilotAppInfoBase (PilotDatabase *d) | |
PilotAppInfoBase () | |
bool | setCategoryName (unsigned int i, const QString &s) |
virtual | ~PilotAppInfoBase () |
Protected Member Functions | |
void | init (struct CategoryAppInfo *c, int len) |
Protected Attributes | |
struct CategoryAppInfo * | fC |
PI_SIZE_T | fLen |
bool | fOwn |
Detailed Description
A database on the handheld has an "AppInfo" block at the beginning with some database-specific information and a common part.This base class deals with the common part, the categories.
Most data in the handheld is stored in categories ; every record in every database, for instance, has a category assigned to it (perhaps "Unfiled", but that's just another category).
Every database has a category table assigning labels to the categories that exist. There are CATEGORY_COUNT (16) categories available for each database; labels may vary per database.
This class encapsulates the basic category table manipulations.
Definition at line 50 of file pilotAppInfo.h.
Constructor & Destructor Documentation
PilotAppInfoBase::PilotAppInfoBase | ( | ) | [inline] |
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 67 of file pilotAppInfo.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 35 of file pilotAppInfo.cc.
PilotAppInfoBase::~PilotAppInfoBase | ( | ) | [virtual] |
Member Function Documentation
struct CategoryAppInfo* PilotAppInfoBase::categoryInfo | ( | ) | const [inline, read] |
struct CategoryAppInfo* PilotAppInfoBase::categoryInfo | ( | ) | [inline, read] |
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 82 of file pilotAppInfo.h.
QString PilotAppInfoBase::categoryName | ( | unsigned int | i | ) | const [inline] |
Gets a single category name.
Returns QString::null if there is no such category number i
.
Definition at line 107 of file pilotAppInfo.h.
void PilotAppInfoBase::dump | ( | ) | const [inline] |
int PilotAppInfoBase::findCategory | ( | const QString & | name, | |
bool | unknownIsUnfiled = false | |||
) | const [inline] |
- See also:
- findCategory(const QString &name, bool unknownIsUnfiled, struct CategoryAppInfo *info).
Definition at line 100 of file pilotAppInfo.h.
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 56 of file pilotAppInfo.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 65 of file pilotAppInfo.cc.
Member Data Documentation
struct CategoryAppInfo* PilotAppInfoBase::fC [read, protected] |
Definition at line 125 of file pilotAppInfo.h.
PI_SIZE_T PilotAppInfoBase::fLen [protected] |
Definition at line 126 of file pilotAppInfo.h.
bool PilotAppInfoBase::fOwn [protected] |
Definition at line 128 of file pilotAppInfo.h.
The documentation for this class was generated from the following files: