Zorba
The XQuery Processor
Documentation
Live Demo
Modules
Download
Tools
Blog
Code
Main Page
Related Pages
Classes
Files
Examples
File List
swig
TypeIdentifier.h
Go to the documentation of this file.
1
/*
2
* Copyright 2006-2008 The FLWOR Foundation.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef API_TYPE_IDENTIFIER_H
18
#define API_TYPE_IDENTIFIER_H
19
20
class
IdentTypes
{
21
public
:
22
typedef
enum
{
23
NAMED_TYPE
,
24
ELEMENT_TYPE
,
25
ATTRIBUTE_TYPE
,
26
DOCUMENT_TYPE
,
27
PI_TYPE
,
28
TEXT_TYPE
,
29
COMMENT_TYPE
,
30
ANY_NODE_TYPE
,
31
ITEM_TYPE
,
32
EMPTY_TYPE
,
33
INVALID_TYPE
,
34
}
Kind
;
35
36
typedef
enum
{
37
QUANT_ONE
,
38
QUANT_QUESTION
,
39
QUANT_PLUS
,
40
QUANT_STAR
,
41
}
Quantifier
;
42
};
43
44
/** \brief Type identifiers
45
*
46
* The type identifiers provides a way to identify the type of an Item.
47
*
48
*/
49
class
TypeIdentifier
50
{
51
friend
class
StaticContext
;
52
private
:
53
zorba::TypeIdentifier_t theTypeIdentifier;
54
static
zorba::IdentTypes::quantifier_t convertQuantifier(
IdentTypes::Quantifier
quantifier);
55
56
public
:
57
TypeIdentifier
(
const
TypeIdentifier
& aTypeIdentifier) : theTypeIdentifier(aTypeIdentifier.theTypeIdentifier) {}
58
TypeIdentifier
(
const
zorba::TypeIdentifier_t& aZTypeIdentifier) : theTypeIdentifier(aZTypeIdentifier) {}
59
60
TypeIdentifier
getContentType
();
61
IdentTypes::Kind
getKind
();
62
const
std::string
getLocalName
();
63
IdentTypes::Quantifier
getQuantifier
();
64
long
getRefCount
();
65
const
std::string
getUri
();
66
bool
isLocalNameWildcard
();
67
bool
isUriWildcard
();
68
69
static
TypeIdentifier
70
createAnyNodeType
(
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
71
72
static
TypeIdentifier
73
createAttributeType
(
const
std::string &uri,
bool
uriWildcard,
const
std::string &localNameName,
bool
localNameWildcard,
TypeIdentifier
contentType,
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
74
75
static
TypeIdentifier
76
createCommentType
(
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
77
78
static
TypeIdentifier
79
createDocumentType
(
TypeIdentifier
contentType,
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
80
81
static
TypeIdentifier
82
createElementType
(
const
std::string &uri,
bool
uriWildcard,
const
std::string &localName,
bool
localNameWildcard,
TypeIdentifier
contentType,
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
83
84
static
TypeIdentifier
85
createEmptyType
();
86
87
static
TypeIdentifier
88
createItemType
(
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
89
90
static
TypeIdentifier
91
createNamedType
(
const
std::string &uri,
const
std::string &localName,
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
92
93
static
TypeIdentifier
94
createPIType
(
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
95
96
static
TypeIdentifier
97
createTextType
(
IdentTypes::Quantifier
quantifier=
IdentTypes::QUANT_ONE
);
98
99
};
// class TypeIdentifier
100
101
102
#endif
Please enable JavaScript to view the
comments powered by Disqus.
blog comments powered by
Disqus