Rosetta  2019.07
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
basic::resource_manager::locator::FileSystemResourceLocator Class Reference

The FileSystemResourceLocator is responsible for opening a file from the file system given its name (as the "locator tag" in the locate_resource_stream method ) and returning a FileStream object that wraps this file. This FileStream can then be used to construct a resource. More...

#include <FileSystemResourceLocator.hh>

Inheritance diagram for basic::resource_manager::locator::FileSystemResourceLocator:
Inheritance graph
[legend]

Public Member Functions

 FileSystemResourceLocator (std::ios_base::openmode open_mode=std::ios_base::in)
 
 FileSystemResourceLocator (FileSystemResourceLocator const &src)
 
virtual ~FileSystemResourceLocator ()
 
void set_search_paths (utility::vector1< std::string > const &search_paths)
 Set the search paths; expects that the paths all end with a trailing "/"; Use "./" to include the present working directory in the search paths. More...
 
void show (std::ostream &out) const override
 Write a description of this ResourceLocator to an out stream. More...
 
std::string type () const override
 Return the class name for this ResourceLocator instance. This function allows for better error message delivery. More...
 
void set_open_mode (std::ios_base::openmode open_mode)
 
std::ios_base::openmode get_open_mode () const
 
ResourceStreamOP locate_resource_stream (std::string const &input_id) const override
 Construct a FileStream object given a file's name (its input_id) More...
 
void parse_my_tag (utility::tag::TagCOP tag) override
 Allows a default base_path to be specified for the locator. More...
 
- Public Member Functions inherited from basic::resource_manager::ResourceLocator
 ResourceLocator ()
 Construct a ResourceLocator and initialize its name (its locator_tag) to the empty string. More...
 
 ResourceLocator (std::string const &locator_tag)
 Construct a ResourceLocator while setting its name to the input locater_tag. More...
 
 ResourceLocator (ResourceLocator const &src)
 Copy construct a ResourceLocator from an example locator. More...
 
 ~ResourceLocator () override
 
virtual void locator_tag (std::string const &locator_tag)
 Set the name for this ResourceLocator. More...
 
virtual std::string locator_tag () const
 Return the name for this ResourceLocator. More...
 
- Public Member Functions inherited from utility::pointer::ReferenceCount
 ReferenceCount ()
 Default constructor. More...
 
virtual ~ReferenceCount ()
 

Static Public Member Functions

static std::string classname ()
 
static void provide_xml_schema (utility::tag::XMLSchemaDefinition &xsd)
 

Private Attributes

std::ios_base::openmode open_mode_
 
utility::vector1< std::string > search_paths_
 

Additional Inherited Members

- Public Types inherited from utility::pointer::ReferenceCount
typedef platform::Size Size
 
typedef platform::Size size_type
 

Detailed Description

The FileSystemResourceLocator is responsible for opening a file from the file system given its name (as the "locator tag" in the locate_resource_stream method ) and returning a FileStream object that wraps this file. This FileStream can then be used to construct a resource.

Constructor & Destructor Documentation

basic::resource_manager::locator::FileSystemResourceLocator::FileSystemResourceLocator ( std::ios_base::openmode  open_mode = std::ios_base::in)
basic::resource_manager::locator::FileSystemResourceLocator::FileSystemResourceLocator ( FileSystemResourceLocator const &  src)
basic::resource_manager::locator::FileSystemResourceLocator::~FileSystemResourceLocator ( )
virtualdefault

Member Function Documentation

std::string basic::resource_manager::locator::FileSystemResourceLocator::classname ( )
static
std::ios_base::openmode basic::resource_manager::locator::FileSystemResourceLocator::get_open_mode ( ) const

References open_mode_.

ResourceStreamOP basic::resource_manager::locator::FileSystemResourceLocator::locate_resource_stream ( std::string const &  input_id) const
overridevirtual

Construct a FileStream object given a file's name (its input_id)

Implements basic::resource_manager::ResourceLocator.

References CREATE_EXCEPTION, open_mode_, test.T008_Serialization::oss, and search_paths_.

void basic::resource_manager::locator::FileSystemResourceLocator::parse_my_tag ( utility::tag::TagCOP  tag)
overridevirtual

Allows a default base_path to be specified for the locator.

Set the value for base_path if specified in the ResourceDefinitionFile.

Implements basic::resource_manager::ResourceLocator.

References basic::options::OptionKeys::in::path::path, search_paths_, and utility::string_split().

void basic::resource_manager::locator::FileSystemResourceLocator::provide_xml_schema ( utility::tag::XMLSchemaDefinition xsd)
static
void basic::resource_manager::locator::FileSystemResourceLocator::set_open_mode ( std::ios_base::openmode  open_mode)

References open_mode_.

void basic::resource_manager::locator::FileSystemResourceLocator::set_search_paths ( utility::vector1< std::string > const &  search_paths)

Set the search paths; expects that the paths all end with a trailing "/"; Use "./" to include the present working directory in the search paths.

References search_paths_.

void basic::resource_manager::locator::FileSystemResourceLocator::show ( std::ostream &  out) const
overridevirtual

Write a description of this ResourceLocator to an out stream.

Implements basic::resource_manager::ResourceLocator.

References basic::options::OptionKeys::in::in, open_mode_, erraser_single_res_analysis::out, and search_paths_.

std::string basic::resource_manager::locator::FileSystemResourceLocator::type ( ) const
overridevirtual

Return the class name for this ResourceLocator instance. This function allows for better error message delivery.

Implements basic::resource_manager::ResourceLocator.

References classname().

Member Data Documentation

std::ios_base::openmode basic::resource_manager::locator::FileSystemResourceLocator::open_mode_
private
utility::vector1< std::string > basic::resource_manager::locator::FileSystemResourceLocator::search_paths_
private

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