FileReadTool Class Reference

Basic implementation of the IFileAccess interface. More...

#include <src/component/FileReadTool.h>

Inheritance diagram for FileReadTool:
Collaboration diagram for FileReadTool:

Public Member Functions

 FileReadTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
 ~FileReadTool () override=default
 
std::unique_ptr< std::istream > open (const std::string &url) override
 
const std::vector< std::string > & protocols () const override
 Protocols supported by the instance. More...
 
- Public Member Functions inherited from extends< BASE, Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Additional Inherited Members

- Public Types inherited from extends< BASE, Interfaces >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 

Detailed Description

Basic implementation of the IFileAccess interface.

This tool simply takes a path to a file as url and return the std::istream interface of std::ifstream.

Author
Marco Clemencic
Date
2008-01-18

Definition at line 16 of file FileReadTool.h.

Constructor & Destructor Documentation

FileReadTool::FileReadTool ( const std::string &  type,
const std::string &  name,
const IInterface parent 
)

Standard constructor.

Definition at line 6 of file FileReadTool.cpp.

8  :
9  base_class(type, name, parent)
10 {
11  //declareInterface<IFileAccess>(this);
12 }
extends base_class
Typedef to this class.
Definition: extends.h:14
string type
Definition: gaudirun.py:151
FileReadTool::~FileReadTool ( )
overridedefault

Member Function Documentation

std::unique_ptr< std::istream > FileReadTool::open ( const std::string &  url)
override

Definition at line 14 of file FileReadTool.cpp.

14  {
15  // remove the optional "file://" from the beginning of the url
16  std::string path;
17  if ( url.compare(0,7,"file://") == 0 ) {
18  path = url.substr(7);
19  } else {
20  path = url;
21  }
22  return std::unique_ptr<std::istream>(new std::ifstream{path});
23 }
list path
Definition: __init__.py:15
const std::vector< std::string > & FileReadTool::protocols ( ) const
override

Protocols supported by the instance.

Vector of supported protocols.

Definition at line 25 of file FileReadTool.cpp.

26 {
28  static const std::vector<std::string> s_protocols = {{"file"}};
29  return s_protocols;
30 }

The documentation for this class was generated from the following files: