Go to the documentation of this file.00001
00002
00003
00004
00005 #include <assert.h>
00006
00007
00008
00009 #include <boost/foreach.hpp>
00010
00011 #include "IncludedFiles.h"
00012 #include "Position.h"
00013
00014 namespace gp = Gaudi::Parsers;
00015
00016 bool gp::IncludedFiles::IsIncluded(const std::string& filename) const {
00017 return container_.find(filename) != container_.end();
00018 }
00019
00020 bool gp::IncludedFiles::AddFile(const std::string& filename,
00021 const Position& from){
00022 if (!IsIncluded(filename)) {
00023 container_.insert(Container::value_type(filename, from));
00024 return true;
00025 }
00026 return false;
00027 }
00028
00029 bool gp::IncludedFiles::GetPosition(const std::string& filename,
00030 const Position** pos) const {
00031 Container::const_iterator iter = container_.find(filename);
00032 if (iter != container_.end()) {
00033 *pos = &iter->second;
00034 assert(pos != NULL);
00035 return true;
00036 }
00037 return false;
00038 }
00039