All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Position.h
Go to the documentation of this file.
1 #ifndef JOBOPTIONSVC_POSITION_H_
2 #define JOBOPTIONSVC_POSITION_H_
3 // ============================================================================
4 // Includes:
5 // ============================================================================
6 // STD & STL:
7 // ============================================================================
8 #include <string>
9 // ============================================================================
10 namespace Gaudi { namespace Parsers {
11 // ============================================================================
12 class Position final {
13  public:
14  Position() = default;
15  Position(std::string filename, unsigned line, unsigned column)
16  :filename_(std::move(filename)), line_(line), column_(column) {}
17  const std::string& filename() const { return filename_; }
18  unsigned line() const { return line_; }
19  unsigned column() const { return column_; }
21  std::string ToString() const;
22  bool Exists() const { return line_ !=0;}
23  private:
25  unsigned line_ = 0;
26  unsigned column_ = 0;
27 };
28 // ============================================================================
29 } /* Gaudi */ } /* Parsers */
30 // ============================================================================
31 #endif // JOBOPTIONSVC_POSITION_H_
unsigned column() const
Definition: Position.h:19
STL namespace.
void set_filename(std::string filename)
Definition: Position.h:20
STL class.
unsigned line() const
Definition: Position.h:18
Position(std::string filename, unsigned line, unsigned column)
Definition: Position.h:15
T move(T...args)
bool Exists() const
Definition: Position.h:22
std::string ToString() const
Definition: Position.cpp:13
std::string filename_
Definition: Position.h:24
const std::string & filename() const
Definition: Position.h:17
Helper functions to set/get the application return code.
Definition: __init__.py:1