Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
kdecore
kdecore
kdecore
ksycocaentry.h
1
/* This file is part of the KDE libraries
2
* Copyright (C) 1999 Waldo Bastian <bastian@kde.org>
3
*
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Library General Public
6
* License version 2 as published by the Free Software Foundation;
7
*
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Library General Public License for more details.
12
*
13
* You should have received a copy of the GNU Library General Public License
14
* along with this library; see the file COPYING.LIB. If not, write to
15
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
* Boston, MA 02110-1301, USA.
17
**/
18
19
#ifndef __ksycocaentry_h__
20
#define __ksycocaentry_h__
21
22
#include "ksycocatype.h"
23
24
#include <tqstringlist.h>
25
#include <ksharedptr.h>
26
class
TQDataStream;
27
37
class
KDECORE_EXPORT
KSycocaEntry
:
public
KShared
38
{
39
40
public
:
41
virtual
bool
isType(
KSycocaType
t)
const
{
return
(t == KST_KSycocaEntry); }
42
virtual
KSycocaType
sycocaType()
const
{
return
KST_KSycocaEntry; }
43
44
public
:
45
typedef
KSharedPtr<KSycocaEntry>
Ptr
;
46
typedef
TQValueList<Ptr> List;
47
public
:
// KDoc seems to barf on those typedefs and generates no docs after them
51
KSycocaEntry
(
const
TQString &path) : mOffset(0), m_bDeleted(false), mPath(path) { }
52
56
static
void
read( TQDataStream &s, TQString &str );
57
static
void
read( TQDataStream &s, TQStringList &list );
58
63
KSycocaEntry
( TQDataStream &_str,
int
offset ) :
64
mOffset( offset ), m_bDeleted(
false
)
65
{
66
read(_str, mPath);
67
}
68
72
virtual
TQString name()
const
= 0;
73
79
TQString
entryPath
()
const
{
return
mPath; }
80
84
virtual
bool
isValid()
const
= 0;
85
89
virtual
bool
isDeleted
()
const
{
return
m_bDeleted; }
90
95
int
offset() {
return
mOffset; }
96
102
virtual
void
save(TQDataStream &s)
103
{
104
mOffset = s.device()->at();
// store position in member variable
105
s << (TQ_INT32) sycocaType() << mPath;
106
}
107
112
virtual
void
load(TQDataStream &) = 0;
113
114
private
:
115
int
mOffset;
116
protected
:
117
bool
m_bDeleted;
118
TQString mPath;
119
protected
:
120
virtual
void
virtual_hook(
int
id
,
void
* data );
121
};
122
123
#endif
KSharedPtr
Can be used to control the lifetime of an object that has derived KShared.
Definition:
ksharedptr.h:100
KSycocaEntry::entryPath
TQString entryPath() const
Definition:
ksycocaentry.h:79
KSycocaEntry::KSycocaType
KSycocaType
Definition:
ksycocatype.h:31
KSycocaEntry
Base class for all Sycoca entries.
Definition:
ksycocaentry.h:37
KSycocaEntry::KSycocaEntry
KSycocaEntry(const TQString &path)
Default constructor.
Definition:
ksycocaentry.h:51
KSycocaEntry::isDeleted
virtual bool isDeleted() const
Definition:
ksycocaentry.h:89
KShared
Reference counting for shared objects.
Definition:
ksharedptr.h:40
kdecore
Skip menu "kdecore"
Main Page
Modules
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
kdecore
Skip menu "kdecore"
arts
dcop
dnssd
interfaces
interface
library
kspeech
ktexteditor
kabc
kate
kcmshell
kdecore
kded
kdefx
kdeprint
kdesu
kdeui
kdoctools
khtml
kimgio
kinit
kio
bookmarks
httpfilter
kfile
kio
kioexec
kpasswdserver
kssl
kioslave
http
kjs
kmdi
kmdi
knewstuff
kparts
krandr
kresources
kspell2
kunittest
kutils
kwallet
libkmid
libkscreensaver