Gaudi Framework, version v25r2
Home
Generated: Wed Jun 4 2014
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
.cern.ch
sw
Gaudi
releases
GAUDI
GAUDI_v25r2
GaudiUtils
src
component
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
}
Generated at Wed Jun 4 2014 14:48:58 for Gaudi Framework, version v25r2 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004