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 FileReadTool::FileReadTool( const std::string& type,
7  const std::string& name,
8  const IInterface* parent):
9  base_class(type, name, parent)
10 {
11  //declareInterface<IFileAccess>(this);
12 }
13 
15  // remove the optional "file://" from the beginning of the url
17  if ( url.compare(0,7,"file://") == 0 ) {
18  path = url.substr(7);
19  } else {
20  path = url;
21  }
23 }
24 
26 {
28  static const std::vector<std::string> s_protocols = {{"file"}};
29  return s_protocols;
30 }
Basic implementation of the IFileAccess interface.
Definition: FileReadTool.h:16
STL namespace.
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
STL class.
Definition of the basic interface.
Definition: IInterface.h:234
STL class.
const std::vector< std::string > & protocols() const override
Protocols supported by the instance.
T substr(T...args)
std::unique_ptr< std::istream > open(const std::string &url) override
STL class.
T compare(T...args)