IncludedFiles.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // STD:
3 // ============================================================================
4 #include <assert.h>
5 // ============================================================================
6 #include "IncludedFiles.h"
7 #include "Position.h"
8 // ============================================================================
9 namespace gp = Gaudi::Parsers;
10 // ============================================================================
11 bool gp::IncludedFiles::IsIncluded(const std::string& filename) const {
12  return container_.find(filename) != container_.end();
13 }
14 // ============================================================================
15 bool gp::IncludedFiles::AddFile(std::string filename,
16  Position from){
17  return container_.emplace( std::move(filename), std::move(from)).second;
18 }
19 // ============================================================================
20 bool gp::IncludedFiles::GetPosition(const std::string& filename,
21  const Position** pos) const {
22  auto iter = container_.find(filename);
23  if (iter == container_.end()) return false;
24  *pos = &iter->second;
25  assert(pos);
26  return true;
27 }
28 // ============================================================================
STL class.
T move(T...args)