ksycocaentry.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __ksycocaentry_h__
00020 #define __ksycocaentry_h__ "$Id: ksycocaentry.h,v 1.11 2002/09/21 15:07:27 tjansen Exp $"
00021
00022 #include "ksycocatype.h"
00023
00024 #include <qstringlist.h>
00025 #include <ksharedptr.h>
00026 class QDataStream;
00027
00037 class KSycocaEntry : public KShared
00038 {
00039
00040 public:
00041 virtual bool isType(KSycocaType t) const { return (t == KST_KSycocaEntry); }
00042 virtual KSycocaType sycocaType() const { return KST_KSycocaEntry; }
00043
00044 public:
00045 typedef KSharedPtr<KSycocaEntry> Ptr;
00046 typedef QValueList<Ptr> List;
00047 public:
00051 KSycocaEntry(const QString &path) : mOffset(0), m_bDeleted(false), mPath(path) { }
00052
00056 static void read( QDataStream &s, QString &str );
00057 static void read( QDataStream &s, QStringList &list );
00058
00063 KSycocaEntry( QDataStream &_str, int offset ) :
00064 mOffset( offset ), m_bDeleted(false)
00065 {
00066 read(_str, mPath);
00067 }
00068
00072 virtual QString name() const = 0;
00073
00079 QString entryPath() const { return mPath; }
00080
00084 virtual bool isValid() const = 0;
00085
00089 virtual bool isDeleted() const { return m_bDeleted; }
00090
00095 int offset() { return mOffset; }
00096
00102 virtual void save(QDataStream &s)
00103 {
00104 mOffset = s.device()->at();
00105 s << (Q_INT32) sycocaType() << mPath;
00106 }
00107
00112 virtual void load(QDataStream &) = 0;
00113
00114 private:
00115 int mOffset;
00116 protected:
00117 bool m_bDeleted;
00118 QString mPath;
00119 protected:
00120 virtual void virtual_hook( int id, void* data );
00121 };
00122
00123 #endif
This file is part of the documentation for kdelibs Version 3.1.0.