kpilot Library API Documentation

pilotRecord.h

00001 #ifndef _KPILOT_PILOTRECORD_H
00002 #define _KPILOT_PILOTRECORD_H
00003 /* pilotRecord.h            KPilot
00004 **
00005 ** Copyright (C) 1998-2001 by Dan Pilone
00006 **
00007 ** See the .cc file for an explanation of what this file is for.
00008 */
00009 
00010 /*
00011 ** This program is free software; you can redistribute it and/or modify
00012 ** it under the terms of the GNU Lesser General Public License as published by
00013 ** the Free Software Foundation; either version 2.1 of the License, or
00014 ** (at your option) any later version.
00015 **
00016 ** This program is distributed in the hope that it will be useful,
00017 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 ** GNU Lesser General Public License for more details.
00020 **
00021 ** You should have received a copy of the GNU Lesser General Public License
00022 ** along with this program in a file called COPYING; if not, write to
00023 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00024 ** MA 02111-1307, USA.
00025 */
00026 
00027 /*
00028 ** Bug reports and questions can be sent to kde-pim@kde.org
00029 */
00030 
00031 #include <time.h>
00032 
00033 #include <pi-file.h>
00034 
00035 class PilotRecord
00036 {
00037 public:
00038     PilotRecord(void* data, int len, int attrib, int cat, pi_uid_t uid);
00039     PilotRecord(PilotRecord* orig);
00040     ~PilotRecord() { delete [] fData; fDeleted++; }
00041 
00042     PilotRecord& operator=(PilotRecord& orig);
00043 
00044     char* getData() const { return fData; }
00045     int   getLen() const { return fLen; }
00046     void setData(const char* data, int len);
00047     inline int   getAttrib() const { return fAttrib; }
00048     inline void  setAttrib(int attrib) { fAttrib = attrib; }
00049 
00050     int   getCat() const { return fCat; }
00051     void  setCat(int cat) { fCat = cat; }
00052 
00053     recordid_t getID() const { return fID; }
00054     void setID(recordid_t id) { fID = id; }
00055 
00056 private:
00057     char* fData;
00058     int   fLen;
00059     int   fAttrib;
00060     int   fCat;
00061     recordid_t fID;
00062 
00063 public:
00064     inline bool isDeleted() const { return fAttrib & dlpRecAttrDeleted; };
00065     inline bool isSecret() const { return fAttrib & dlpRecAttrSecret; } ;
00066     inline bool isArchived() const { return fAttrib & dlpRecAttrArchived; } ;
00067     inline void makeDeleted() { fAttrib |= dlpRecAttrDeleted; } ;
00068     inline void makeSecret() { fAttrib |= dlpRecAttrSecret; } ;
00069 
00075 public:
00076     static void allocationInfo();
00077 private:
00078     static int fAllocated,fDeleted;
00079 };
00080 
00081 #endif
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:49 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003