delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / nepomuk / strigibackend / tstring.h
blob617c28e092cae05b0e8f7160a6c50009d2270003
1 /*
2 * This file is part of Soprano Project.
4 * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef _W_STRING_H_
23 #define _W_STRING_H_
25 #include <QtCore/QString>
26 #include <QtCore/QSharedDataPointer>
28 #include <CLucene.h>
30 /**
31 * TString is a simple string class which works on wchar_t
32 * data. Its main purpose it to provide conversion from and to
33 * QString.
35 class TString
37 public:
38 /**
39 * Create an empty TString
41 TString();
43 /**
44 * Create a copy of another TString
46 TString( const TString& );
48 /**
49 * Create a new TString instance.
50 * \param data The string data to be used.
51 * \param wrap If false the data will be copied for the new
52 * string instance. If true the new TString will act as a wrapper
53 * around data.
55 TString( const TCHAR* data, bool wrap = false );
57 /**
58 * Create a new TString instance as a copy of a QString
60 TString( const QString& );
62 ~TString();
64 TString& operator=( const TString& );
65 TString& operator=( const TCHAR* );
66 TString& operator=( const QString& );
68 bool isEmpty() const;
69 int length() const;
71 bool operator==( const TString& ) const;
72 bool operator==( const QString& ) const;
73 bool operator!=( const TString& ) const;
74 bool operator!=( const QString& ) const;
76 /**
77 * The raw string data. It remains valid until the
78 * string is modified or deleted.
80 * \return the raw string data or 0 if the string is empty.
82 const TCHAR* data() const;
84 operator QString() const;
86 QString toQString() const;
88 static TString fromUtf8( const char* data );
90 private:
91 class Private;
92 QSharedDataPointer<Private> d;
95 #endif