The Gaudi Framework  v30r3 (a5ef0a68)
FileReadTool.cpp
Go to the documentation of this file.
1 #include "FileReadTool.h"
2 #include <fstream>
3 
5 
6 std::unique_ptr<std::istream> FileReadTool::open( const std::string& url )
7 {
8  // remove the optional "file://" from the beginning of the url
10  if ( url.compare( 0, 7, "file://" ) == 0 ) {
11  path = url.substr( 7 );
12  } else {
13  path = url;
14  }
15  return std::make_unique<std::ifstream>( path );
16 }
17 
19 {
21  static const std::vector<std::string> s_protocols = {{"file"}};
22  return s_protocols;
23 }
const std::vector< std::string > & protocols() const override
Protocols supported by the instance.
STL namespace.
STL class.
#define DECLARE_COMPONENT(type)
T substr(T...args)
Basic implementation of the IFileAccess interface.
Definition: FileReadTool.h:16