Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  // remove the optional "file://" from the beginning of the url
9  if ( url.compare( 0, 7, "file://" ) == 0 ) {
10  path = url.substr( 7 );
11  } else {
12  path = url;
13  }
14  return std::make_unique<std::ifstream>( path );
15 }
16 
19  static const std::vector<std::string> s_protocols = {{"file"}};
20  return s_protocols;
21 }
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