![]() |
Rosetta
2021.16
|
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>

Public Member Functions | |
| FileSystemResourceLocator (std::ios_base::openmode open_mode=std::ios_base::in) | |
| FileSystemResourceLocator (FileSystemResourceLocator const &src) | |
| ~FileSystemResourceLocator () override | |
| 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::VirtualBase | |
| VirtualBase ()=default | |
| Default constructor. More... | |
| virtual | ~VirtualBase ()=default |
| The virtual destructor is one of the main reasons for the VirtualBase class. More... | |
| VirtualBase (VirtualBase const &)=default | |
| VirtualBase (VirtualBase &&)=default | |
| VirtualBase & | operator= (VirtualBase const &)=default |
| VirtualBase & | operator= (VirtualBase &&)=default |
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_ |
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.
| 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 | ) |
|
overridedefault |
|
static |
| std::ios_base::openmode basic::resource_manager::locator::FileSystemResourceLocator::get_open_mode | ( | ) | const |
References open_mode_.
|
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_.
|
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().
|
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_.
|
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_.
Referenced by pyrosetta.distributed.viewer.core.Viewer::__call__().
|
overridevirtual |
Return the class name for this ResourceLocator instance. This function allows for better error message delivery.
Implements basic::resource_manager::ResourceLocator.
References classname().
|
private |
Referenced by get_open_mode(), locate_resource_stream(), set_open_mode(), and show().
|
private |
Referenced by FileSystemResourceLocator(), locate_resource_stream(), parse_my_tag(), set_search_paths(), and show().
1.8.7