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-2008
5  * Oracle. All rights reserved.
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  * $Id$
20  */
21 
22 #ifndef _LOCATIONINFO_HPP
23 #define _LOCATIONINFO_HPP
24 
25 
26 #include <xqilla/framework/XQillaExport.hpp>
27 
28 #include <xercesc/util/XercesDefs.hpp>
29 
31 class XQILLA_API LocationInfo
32 {
33 public:
36  : file_(0), line_(0), column_(0) {}
38  LocationInfo(const XMLCh *file, unsigned int line, unsigned int column)
39  : file_(file), line_(line), column_(column) {}
40 
42  const XMLCh *getFile() const { return file_; }
44  unsigned int getLine() const { return line_; }
46  unsigned int getColumn() const { return column_; }
47 
49  void setLocationInfo(const XMLCh *file, unsigned int line, unsigned int column)
50  {
51  file_ = file;
52  line_ = line;
53  column_ = column;
54  }
56  void setLocationInfo(const LocationInfo *o)
57  {
58  if(o != 0) {
59  file_ = o->file_;
60  line_ = o->line_;
61  column_ = o->column_;
62  }
63  }
64 
65 private:
66  const XMLCh *file_;
67  unsigned int line_, column_;
68 };
69 
70 #endif