OpenKarto
source
OpenKarto
Identifier.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2006-2011, SRI International (R)
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#ifndef __OpenKarto_Name_h__
21
#define __OpenKarto_Name_h__
22
23
#include <
OpenKarto/String.h
>
24
25
namespace
karto
26
{
27
29
30
40
class
KARTO_EXPORT
Identifier
41
{
42
public
:
46
Identifier
();
47
52
Identifier
(
const
char
* pString);
53
58
Identifier
(
const
String
& rString);
59
63
Identifier
(
const
Identifier
& rOther);
64
68
virtual
~
Identifier
();
69
70
public
:
75
const
String
& GetName()
const
;
76
81
void
SetName(
const
String
& pName);
82
87
const
String
& GetScope()
const
;
88
93
void
SetScope(
const
String
& rScope);
94
99
kt_size_t
Size()
const
;
100
104
void
Clear();
105
110
const
String
& ToString()
const
;
111
112
public
:
116
Identifier
& operator=(
const
Identifier
& rOther);
117
121
kt_bool
operator==
(
const
Identifier
& rOther)
const
;
122
126
kt_bool
operator!=
(
const
Identifier
& rOther)
const
127
{
128
return
!(*
this
== rOther);
129
}
130
135
kt_bool
operator<
(
const
Identifier
& rOther)
const
;
136
140
friend
KARTO_FORCEINLINE
std::ostream& operator << (std::ostream& rStream,
const
Identifier
& rIdentifier)
141
{
142
rStream << rIdentifier.
ToString
();
143
return
rStream;
144
}
145
146
private
:
151
void
Parse(
const
String
& rString);
152
157
void
Validate(
const
String
& rString);
158
162
void
Update();
163
169
inline
kt_bool
IsValidFirst
(
char
c)
170
{
171
return
(isalpha(c) || c ==
'/'
);
172
}
173
179
inline
kt_bool
IsValid
(
char
c)
180
{
181
return
(isalnum(c) || c ==
'/'
|| c ==
'_'
|| c ==
'-'
);
182
}
183
184
private
:
185
String
m_Name
;
186
String
m_Scope
;
187
String
m_FullName
;
188
};
189
191
192
}
193
194
#endif // __OpenKarto_Name_h__
karto::Identifier::ToString
const String & ToString() const
Definition:
Identifier.cpp:93
kt_size_t
std::size_t kt_size_t
Definition:
Types.h:138
karto::Identifier::IsValidFirst
kt_bool IsValidFirst(char c)
Definition:
Identifier.h:169
operator<
bool operator<(const CellData &a, const CellData &b)
karto::Identifier::m_Name
String m_Name
Definition:
Identifier.h:185
karto::String
Definition:
String.h:52
KARTO_EXPORT
#define KARTO_EXPORT
Definition:
Macros.h:78
karto::Identifier::m_Scope
String m_Scope
Definition:
Identifier.h:186
operator==
TFSIMD_FORCE_INLINE bool operator==(const Matrix3x3 &m1, const Matrix3x3 &m2)
kt_bool
bool kt_bool
Definition:
Types.h:145
karto::Identifier::operator!=
kt_bool operator!=(const Identifier &rOther) const
Definition:
Identifier.h:126
karto::Identifier::m_FullName
String m_FullName
Definition:
Identifier.h:187
KARTO_FORCEINLINE
#define KARTO_FORCEINLINE
Definition:
Macros.h:56
karto::Identifier::IsValid
kt_bool IsValid(char c)
Definition:
Identifier.h:179
karto::Identifier
Definition:
Identifier.h:40
String.h
karto
Definition:
Any.cpp:20
nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Wed Mar 2 2022 00:37:22