Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
q
r
s
t
u
v
w
x
y
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
Enumerator
a
c
d
e
f
i
l
m
n
o
r
t
u
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerations
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Variables
_
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Typedefs
b
c
f
h
i
l
p
r
s
t
u
Enumerations
Enumerator
c
d
e
i
o
p
r
s
t
w
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
driver
src
tinyxml
tinystr.cpp
Go to the documentation of this file.
1
/*
2
www.sourceforge.net/projects/tinyxml
3
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any
6
damages arising from the use of this software.
7
8
Permission is granted to anyone to use this software for any
9
purpose, including commercial applications, and to alter it and
10
redistribute it freely, subject to the following restrictions:
11
12
1. The origin of this software must not be misrepresented; you must
13
not claim that you wrote the original software. If you use this
14
software in a product, an acknowledgment in the product documentation
15
would be appreciated but is not required.
16
17
2. Altered source versions must be plainly marked as such, and
18
must not be misrepresented as being the original software.
19
20
3. This notice may not be removed or altered from any source
21
distribution.
22
*/
23
24
25
#ifndef TIXML_USE_STL
26
27
#include "
tinystr.h
"
28
29
// Error value for find primitive
30
const
TiXmlString::size_type
TiXmlString::npos
=
static_cast<
TiXmlString::size_type
>
(-1);
31
32
33
// Null rep.
34
TiXmlString::Rep
TiXmlString::nullrep_
= { 0, 0, {
'\0'
} };
35
36
37
void
TiXmlString::reserve
(
size_type
cap)
38
{
39
if
(cap >
capacity
())
40
{
41
TiXmlString
tmp;
42
tmp.
init
(
length
(), cap);
43
memcpy(tmp.
start
(),
data
(),
length
());
44
swap
(tmp);
45
}
46
}
47
48
49
TiXmlString
&
TiXmlString::assign
(
const
char
* str,
size_type
len)
50
{
51
size_type
cap =
capacity
();
52
if
(len > cap || cap > 3*(len + 8))
53
{
54
TiXmlString
tmp;
55
tmp.
init
(len);
56
memcpy(tmp.
start
(), str, len);
57
swap
(tmp);
58
}
59
else
60
{
61
memmove(
start
(), str, len);
62
set_size
(len);
63
}
64
return
*
this
;
65
}
66
67
68
TiXmlString
&
TiXmlString::append
(
const
char
* str,
size_type
len)
69
{
70
size_type
newsize =
length
() + len;
71
if
(newsize >
capacity
())
72
{
73
reserve
(newsize +
capacity
());
74
}
75
memmove(
finish
(), str, len);
76
set_size
(newsize);
77
return
*
this
;
78
}
79
80
81
TiXmlString
operator +
(
const
TiXmlString
& a,
const
TiXmlString
& b)
82
{
83
TiXmlString
tmp;
84
tmp.
reserve
(a.
length
() + b.
length
());
85
tmp += a;
86
tmp += b;
87
return
tmp;
88
}
89
90
TiXmlString
operator +
(
const
TiXmlString
& a,
const
char
* b)
91
{
92
TiXmlString
tmp;
93
TiXmlString::size_type
b_len =
static_cast<
TiXmlString::size_type
>
( strlen(b) );
94
tmp.
reserve
(a.
length
() + b_len);
95
tmp += a;
96
tmp.
append
(b, b_len);
97
return
tmp;
98
}
99
100
TiXmlString
operator +
(
const
char
* a,
const
TiXmlString
& b)
101
{
102
TiXmlString
tmp;
103
TiXmlString::size_type
a_len =
static_cast<
TiXmlString::size_type
>
( strlen(a) );
104
tmp.
reserve
(a_len + b.
length
());
105
tmp.
append
(a, a_len);
106
tmp += b;
107
return
tmp;
108
}
109
110
111
#endif // TIXML_USE_STL
TiXmlString::swap
void swap(TiXmlString &other)
Definition:
tinystr.h:217
TiXmlString::Rep
Definition:
tinystr.h:238
TiXmlString
Definition:
tinystr.h:67
TiXmlString::capacity
size_type capacity() const
Definition:
tinystr.h:160
operator+
TiXmlString operator+(const TiXmlString &a, const TiXmlString &b)
Definition:
tinystr.cpp:81
TiXmlString::reserve
void reserve(size_type cap)
Definition:
tinystr.cpp:37
tinystr.h
TiXmlString::assign
TiXmlString & assign(const char *str, size_type len)
Definition:
tinystr.cpp:49
TiXmlString::set_size
void set_size(size_type sz)
Definition:
tinystr.h:229
TiXmlString::init
void init(size_type sz)
Definition:
tinystr.h:226
TiXmlString::finish
char * finish() const
Definition:
tinystr.h:235
TiXmlString::append
TiXmlString & append(const char *str, size_type len)
Definition:
tinystr.cpp:68
TiXmlString::start
char * start() const
Definition:
tinystr.h:232
TiXmlString::size_type
size_t size_type
Definition:
tinystr.h:71
TiXmlString::length
size_type length() const
Definition:
tinystr.h:148
TiXmlString::nullrep_
static Rep nullrep_
Definition:
tinystr.h:277
TiXmlString::data
const char * data() const
Definition:
tinystr.h:144
TiXmlString::npos
static const size_type npos
Definition:
tinystr.h:74
sick_scan_xd
Author(s): Michael Lehning
, Jochen Sprickerhof
, Martin Günther
autogenerated on Fri Oct 25 2024 02:47:12