Zorba
The XQuery Processor
Documentation
Live Demo
Modules
Download
Tools
Blog
Code
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
include
zorba
xquery_stack_trace.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 ZORBA_XQUERY_STACK_TRACE_API_H
18
#define ZORBA_XQUERY_STACK_TRACE_API_H
19
20
#include <string>
21
#include <vector>
22
23
#include <
zorba/internal/qname.h
>
24
25
namespace
zorba {
26
27
class
XQueryStackTrace;
28
29
namespace
serialization {
30
class
Archiver;
31
void
operator&
( Archiver&, XQueryStackTrace& );
32
}
33
34
///////////////////////////////////////////////////////////////////////////////
35
36
class
XQueryStackTrace
{
37
public
:
38
typedef
internal::VariableQName<std::string>
fn_name_type
;
39
typedef
unsigned
short
fn_arity_type
;
40
typedef
unsigned
line_type
;
41
typedef
unsigned
short
column_type
;
42
43
class
Entry
{
44
public
:
45
Entry
(
fn_name_type
const
&fn_name,
fn_arity_type
fn_arity,
46
char
const
*file_name,
line_type
line,
column_type
column,
47
line_type
line_end,
column_type
column_end);
48
49
fn_name_type
const
&
getFnName
()
const
{
50
return
fn_name_;
51
}
52
53
fn_arity_type
const
&
getFnArity
()
const
{
54
return
fn_arity_;
55
}
56
57
std::string
const
&
getFileName
()
const
{
58
return
filename_;
59
}
60
61
line_type
getLine
()
const
{
62
return
line_;
63
}
64
65
column_type
getColumn
()
const
{
66
return
col_;
67
}
68
69
line_type
getLineEnd
()
const
{
70
return
line_end_;
71
}
72
73
column_type
getColumnEnd
()
const
{
74
return
col_end_;
75
}
76
77
fn_name_type
&
getFnNameRef
() {
78
return
fn_name_;
79
}
80
81
fn_arity_type
&
getFnArityRef
() {
82
return
fn_arity_;
83
}
84
85
std::string&
getFileNameRef
() {
86
return
filename_;
87
}
88
89
line_type
&
getLineRef
() {
90
return
line_;
91
}
92
93
column_type
&
getColumnRef
() {
94
return
col_;
95
}
96
97
line_type
&
getLineEndRef
() {
98
return
line_end_;
99
}
100
101
column_type
&
getColumnEndRef
() {
102
return
col_end_;
103
}
104
105
private
:
106
fn_name_type
fn_name_;
107
fn_arity_type
fn_arity_;
108
std::string filename_;
109
line_type
line_;
110
column_type
col_;
111
line_type
line_end_;
112
column_type
col_end_;
113
public
:
114
// for plan serialization
115
Entry
();
116
};
117
118
typedef
std::vector<Entry>
trace_t
;
119
typedef
trace_t::size_type
size_type
;
120
typedef
trace_t::const_iterator
const_iterator
;
121
typedef
trace_t::const_reverse_iterator
const_reverse_iterator
;
122
123
bool
empty
()
const
{
124
return
trace_.empty();
125
}
126
127
const_iterator
begin
()
const
{
128
return
trace_.begin();
129
}
130
131
const_iterator
end
()
const
{
132
return
trace_.end();
133
}
134
135
const_reverse_iterator
rbegin
()
const
{
136
return
trace_.rbegin();
137
}
138
139
const_reverse_iterator
rend
()
const
{
140
return
trace_.rend();
141
}
142
143
void
push
( Entry
const
&entry );
144
145
size_type
size
()
const
{
146
return
trace_.size();
147
}
148
149
private
:
150
trace_t
trace_;
151
152
friend
void
serialization::operator&
( serialization::Archiver&,
153
XQueryStackTrace
& );
154
};
155
156
///////////////////////////////////////////////////////////////////////////////
157
158
}
// namespace zorba
159
160
#endif
/* ZORBA_XQUERY_STACK_TRACE_API_H */
161
/*
162
* Local variables:
163
* mode: c++
164
* End:
165
*/
166
/* vim:set et sw=2 ts=2: */
Please enable JavaScript to view the
comments powered by Disqus.
blog comments powered by
Disqus