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.
25 #include <QtCore/QString>
26 #include <QtCore/QSharedDataPointer>
31 * TString is a simple string class which works on wchar_t
32 * data. Its main purpose it to provide conversion from and to
39 * Create an empty TString
44 * Create a copy of another TString
46 TString( const TString
& );
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
55 TString( const TCHAR
* data
, bool wrap
= false );
58 * Create a new TString instance as a copy of a QString
60 TString( const QString
& );
64 TString
& operator=( const TString
& );
65 TString
& operator=( const TCHAR
* );
66 TString
& operator=( const QString
& );
71 bool operator==( const TString
& ) const;
72 bool operator==( const QString
& ) const;
73 bool operator!=( const TString
& ) const;
74 bool operator!=( const QString
& ) const;
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
);
92 QSharedDataPointer
<Private
> d
;