Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
khtml
khtml
khtml
dom
dom_string.h
1
/*
2
* This file is part of the DOM implementation for KDE.
3
*
4
* (C) 1999 Lars Knoll (knoll@kde.org)
5
*
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.
10
*
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.
15
*
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.
20
*
21
*/
22
#ifndef _DOM_DOMString_h_
23
#define _DOM_DOMString_h_
24
25
#include <kdebug.h>
26
#include <tqstring.h>
27
28
#include <kdelibs_export.h>
29
30
namespace
DOM {
31
32
class
DOMStringImpl;
33
43
class
KHTML_EXPORT
DOMString
44
{
45
friend
class
CharacterDataImpl;
46
friend
KHTML_EXPORT
bool
operator==(
const
DOMString
&a,
const
char
*b );
47
public
:
51
DOMString
() : impl(0) {}
52
53
DOMString
(
const
TQChar *str, uint len);
54
DOMString
(
const
TQString &);
55
DOMString
(
const
char
*str);
56
DOMString
(DOMStringImpl *i);
57
58
virtual
~
DOMString
();
59
60
// assign and copy
61
DOMString
(
const
DOMString
&str);
62
DOMString
&operator =(
const
DOMString
&str);
63
67
DOMString
&operator += (
const
DOMString
&str);
71
DOMString
operator + (
const
DOMString
&str);
72
73
void
insert(
DOMString
str, uint pos);
74
79
const
TQChar &operator [](
unsigned
int
i)
const
;
80
81
int
find(
const
TQChar c,
int
start = 0)
const
;
82
83
uint length()
const
;
84
void
truncate(
unsigned
int
len );
85
void
remove
(
unsigned
int
pos,
int
len=1);
89
DOMString
split(
unsigned
int
pos);
90
94
DOMString
lower()
const
;
98
DOMString
upper()
const
;
99
100
TQChar *unicode()
const
;
101
TQString string()
const
;
102
103
int
toInt()
const
;
104
bool
percentage(
int
&_percentage)
const
;
105
106
DOMString
copy()
const
;
107
108
bool
isNull()
const
{
return
(impl == 0); }
109
bool
isEmpty()
const
;
110
115
DOMStringImpl *implementation()
const
{
return
impl; }
116
117
protected
:
118
DOMStringImpl *impl;
119
};
120
121
#ifndef NDEBUG
122
inline
kdbgstream
&
operator<<
(
kdbgstream
&stream,
const
DOMString &
string
) {
123
return
(stream <<
string
.
string
());
124
}
125
#else
126
inline
kndbgstream
&
operator<<
(
kndbgstream
&stream,
const
DOMString &) {
127
return
stream;
128
}
129
#endif
130
131
KHTML_EXPORT
bool
operator==(
const
DOMString &a,
const
DOMString &b );
132
KHTML_EXPORT
bool
operator==(
const
DOMString &a,
const
TQString &b );
133
KHTML_EXPORT
bool
operator==(
const
DOMString &a,
const
char
*b );
134
inline
bool
operator!=(
const
DOMString &a,
const
DOMString &b ) {
return
!(a==b); }
135
inline
bool
operator!=(
const
DOMString &a,
const
TQString &b ) {
return
!(a==b); }
136
inline
bool
operator!=(
const
DOMString &a,
const
char
*b ) {
return
!(a==b); }
137
inline
bool
strcmp(
const
DOMString &a,
const
DOMString &b ) {
return
a != b; }
138
139
// returns false when equal, true otherwise (ignoring case)
140
KHTML_EXPORT
bool
strcasecmp(
const
DOMString &a,
const
DOMString &b );
141
KHTML_EXPORT
bool
strcasecmp(
const
DOMString& a,
const
char
* b );
142
143
}
144
#endif
khtml
Skip menu "khtml"
Main Page
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
khtml
Skip menu "khtml"
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