SourceForge.net Logo
LocationInfo.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001, 2008,
3  * DecisionSoft Limited. All rights reserved.
4  * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef _LOCATIONINFO_HPP
21 #define _LOCATIONINFO_HPP
22 
23 
24 #include <xqilla/framework/XQillaExport.hpp>
25 
26 #include <xercesc/util/XercesDefs.hpp>
27 
29 class XQILLA_API LocationInfo
30 {
31 public:
34  : file_(0), line_(0), column_(0) {}
36  LocationInfo(const XMLCh *file, unsigned int line, unsigned int column)
37  : file_(file), line_(line), column_(column) {}
38 
40  const XMLCh *getFile() const { return file_; }
42  unsigned int getLine() const { return line_; }
44  unsigned int getColumn() const { return column_; }
45 
47  void setLocationInfo(const XMLCh *file, unsigned int line, unsigned int column)
48  {
49  file_ = file;
50  line_ = line;
51  column_ = column;
52  }
55  {
56  if(o != 0) {
57  file_ = o->file_;
58  line_ = o->line_;
59  column_ = o->column_;
60  }
61  }
62 
63 private:
64  const XMLCh *file_;
65  unsigned int line_, column_;
66 };
67 
68 #endif
void setLocationInfo(const XMLCh *file, unsigned int line, unsigned int column)
Sets the location to the given information.
Definition: LocationInfo.hpp:47
unsigned int getLine() const
The line in the query.
Definition: LocationInfo.hpp:42
void setLocationInfo(const LocationInfo *o)
Sets the location with the information in the given LocationInfo object.
Definition: LocationInfo.hpp:54
unsigned int getColumn() const
The column in the query.
Definition: LocationInfo.hpp:44
LocationInfo()
Constructor that sets the information to 0.
Definition: LocationInfo.hpp:33
A class that gives records a location in the query.
Definition: LocationInfo.hpp:29
const XMLCh * getFile() const
The file that the query was parsed from.
Definition: LocationInfo.hpp:40
LocationInfo(const XMLCh *file, unsigned int line, unsigned int column)
Constructor that takes the initial information.
Definition: LocationInfo.hpp:36