The Gaudi Framework
v26r0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
FileReadTool.cpp
Go to the documentation of this file.
1
#include "
FileReadTool.h
"
2
#include <fstream>
3
4
#include "
GaudiKernel/ToolFactory.h
"
5
DECLARE_COMPONENT
(
FileReadTool
)
6
7
FileReadTool
::
FileReadTool
( const
std
::
string
&
type
,
8
const
std
::
string
& name,
9
const
IInterface
* parent):
10
base_class
(type, name, parent)
11
{
12
//declareInterface<IFileAccess>(this);
13
m_protocols.push_back(
"file"
);
14
}
15
16
FileReadTool::~FileReadTool
(){}
17
18
std::auto_ptr<std::istream>
FileReadTool::open
(
const
std::string &url) {
19
// remove the optional "file://" from the beginning of the url
20
std::string
path
;
21
if
( url.substr(0,7) ==
"file://"
) {
22
path = url.substr(7);
23
}
else
{
24
path = url;
25
}
26
return
std::auto_ptr<std::istream>(
new
std::ifstream(path.c_str()));
27
}
28
29
const
std::vector<std::string> &
FileReadTool::protocols
()
const
30
{
31
return
m_protocols
;
32
}
FileReadTool
Basic implementation of the IFileAccess interface.
Definition:
FileReadTool.h:17
FileReadTool::m_protocols
std::vector< std::string > m_protocols
Vector of supported protocols.
Definition:
FileReadTool.h:39
FileReadTool::open
virtual std::auto_ptr< std::istream > open(const std::string &url)
Find the URL and returns an auto_ptr to an input stream interface of an object that can be used to re...
Definition:
FileReadTool.cpp:18
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition:
PluginService.h:36
FileReadTool::protocols
virtual const std::vector< std::string > & protocols() const
Protocols supported by the instance.
Definition:
FileReadTool.cpp:29
gaudirun.type
string type
Definition:
gaudirun.py:126
FileReadTool::~FileReadTool
virtual ~FileReadTool()
Definition:
FileReadTool.cpp:16
IInterface
Definition of the basic interface.
Definition:
IInterface.h:160
extends1
Base class used to extend a class implementing other interfaces.
Definition:
extends.h:10
FileReadTool.h
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition:
HistoTableFormat.cpp:185
GaudiPython.GaudiAlgs.std
std
Definition:
GaudiAlgs.py:75
ToolFactory.h
GaudiUtils
src
component
FileReadTool.cpp
Generated on Tue Jan 20 2015 20:27:28 for The Gaudi Framework by
1.8.7