The Gaudi Framework  v29r0 (ff2e7097)
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
11 {
12  namespace Parsers
13  {
14  // ============================================================================
15  class Position final
16  {
17  public:
18  Position() = default;
19  Position( std::string filename, unsigned line, unsigned column )
20  : filename_( std::move( filename ) ), line_( line ), column_( column )
21  {
22  }
23  const std::string& filename() const { return filename_; }
24  unsigned line() const { return line_; }
25  unsigned column() const { return column_; }
27  std::string ToString() const;
28  bool Exists() const { return line_ != 0; }
29 
30  private:
32  unsigned line_ = 0;
33  unsigned column_ = 0;
34  };
35  // ============================================================================
36  } /* Gaudi */
37 } /* Parsers */
38 // ============================================================================
39 #endif // JOBOPTIONSVC_POSITION_H_
unsigned column() const
Definition: Position.h:25
STL namespace.
void set_filename(std::string filename)
Definition: Position.h:26
STL class.
unsigned line() const
Definition: Position.h:24
Position(std::string filename, unsigned line, unsigned column)
Definition: Position.h:19
T move(T...args)
bool Exists() const
Definition: Position.h:28
std::string ToString() const
Definition: Position.cpp:13
std::string filename_
Definition: Position.h:31
const std::string & filename() const
Definition: Position.h:23
Helper functions to set/get the application return code.
Definition: __init__.py:1