KDE PIM / Developers / API Docs / kpilot

PilotAppInfoBase Class Reference

Base class for all specific kinds of AppInfo. More...

#include <pilotDatabase.h>

Inherited by PilotAppInfo< appinfo, unpack, pack >.

List of all members.

Public Member Functions

Static Public Member Functions

Static Public Attributes

Protected Member Functions


Detailed Description

Base class for all specific kinds of AppInfo.


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()!

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.

PilotAppInfoBase::~PilotAppInfoBase  )  [virtual]
 

Destructor.


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.

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.

const struct CategoryAppInfo* PilotAppInfoBase::categoryInfo  )  const [inline]
 

Const version of the above function.

PI_SIZE_T PilotAppInfoBase::length  )  const [inline]
 

Returns the length of the (whole) AppInfo block.

int PilotAppInfoBase::findCategory const QString &  name,
bool  unknownIsUnfiled,
struct CategoryAppInfo *  info
[static]
 

Search for the given category.

Parameters:
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 -> category number mapping defined by the Pilot,

-1 means unknown category selected when

Parameters:
unknownIsUnfiled is true.
Returns:
0 == Unfiled means unknown category selected when
Parameters:
unknownIsUnfiled is false.

int PilotAppInfoBase::findCategory const QString &  name,
bool  unknownIsUnfiled = false
[inline]
 

Alternative to the above inconvenience function.

void PilotAppInfoBase::dump  )  const
 

For debugging, display all the category names.

QString PilotAppInfoBase::category unsigned int  i  ) 
 

Gets a single category name.

Returns QString::null if there is no such category number i .

bool PilotAppInfoBase::setCategory 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.


Member Data Documentation

const int PilotAppInfoBase::MAX_APPINFO_SIZE = 8192 [static]
 

Maximum size of an AppInfo block, taken roughly from the pilot-link source.


The documentation for this class was generated from the following files: