The Gaudi Framework  v33r0 (d5ea422b)
Position.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef JOBOPTIONSVC_POSITION_H_
12 #define JOBOPTIONSVC_POSITION_H_
13 // ============================================================================
14 // Includes:
15 // ============================================================================
16 // STD & STL:
17 // ============================================================================
18 #include <string>
19 // ============================================================================
20 namespace Gaudi {
21  namespace Parsers {
22  // ============================================================================
23  class Position final {
24  public:
25  Position() = default;
26  Position( std::string filename, unsigned line, unsigned column )
27  : filename_( std::move( filename ) ), line_( line ), column_( column ) {}
28  const std::string& filename() const { return filename_; }
29  unsigned line() const { return line_; }
30  unsigned column() const { return column_; }
32  std::string ToString() const;
33  bool Exists() const { return line_ != 0; }
34 
35  private:
37  unsigned line_ = 0;
38  unsigned column_ = 0;
39  };
40  // ============================================================================
41  } // namespace Parsers
42 } // namespace Gaudi
43 // ============================================================================
44 #endif // JOBOPTIONSVC_POSITION_H_
STL namespace.
void set_filename(std::string filename)
Definition: Position.h:31
const std::string & filename() const
Definition: Position.h:28
unsigned column() const
Definition: Position.h:30
STL class.
bool Exists() const
Definition: Position.h:33
Position(std::string filename, unsigned line, unsigned column)
Definition: Position.h:26
T move(T... args)
std::string ToString() const
Definition: Position.cpp:23
unsigned line() const
Definition: Position.h:29
std::string filename_
Definition: Position.h:36
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1