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

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.
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) |
QString | categoryName (unsigned int i) const |
bool | setCategoryName (unsigned int i, const QString &s) |
void | dump () const |
Protected Member Functions | |
PilotAppInfoBase () | |
void | init (struct CategoryAppInfo *c, int len) |
Protected Attributes | |
CategoryAppInfo * | fC |
PI_SIZE_T | fLen |
bool | fOwn |
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 57 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
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 62 of file pilotAppInfo.h.
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 82 of file pilotAppInfo.h.
struct CategoryAppInfo* PilotAppInfoBase::categoryInfo | ( | ) | const [inline] |
PI_SIZE_T PilotAppInfoBase::length | ( | ) | const [inline] |
int PilotAppInfoBase::findCategory | ( | const QString & | name, | |
bool | unknownIsUnfiled = false | |||
) | [inline] |
- See also:
- findCategory(const QString &name, bool unknownIsUnfiled, struct CategoryAppInfo *info).
Definition at line 100 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.
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 57 of file pilotAppInfo.cc.
void PilotAppInfoBase::dump | ( | ) | const [inline] |
The documentation for this class was generated from the following files: