PolyFEM
Loading...
Searching...
No Matches
polyfem::io::FileSystemIO Class Referencefinal

#include <ResourceIO.hpp>

Inheritance diagram for polyfem::io::FileSystemIO:
[legend]
Collaboration diagram for polyfem::io::FileSystemIO:
[legend]

Public Member Functions

 FileSystemIO (const std::filesystem::path &root, const std::filesystem::path &host_directory={})
 
std::unique_ptr< const ResourceIO > with_root (const std::string &root) const override
 
std::string canonical_path (const std::string &path) const override
 Absolute resource identity, independent of the active reader root.
 
bool exists (const std::string &path) const override
 
bool is_group (const std::string &path) const override
 
std::vector< std::string > list (const std::string &path) const override
 
std::unique_ptr< std::istream > open (const std::string &path, bool binary) const override
 
Eigen::MatrixXd read_matrix (const std::string &path) const override
 
Eigen::MatrixXi read_int_matrix (const std::string &path) const override
 
std::vector< double > read_double_vector (const std::string &path) const override
 
std::vector< int > read_int_vector (const std::string &path) const override
 
std::vector< long > read_long_vector (const std::string &path) const override
 
bool has_attribute (const std::string &path, const std::string &name) const override
 
long read_integer_attribute (const std::string &path, const std::string &name) const override
 
std::string read_string_attribute (const std::string &path, const std::string &name) const override
 
std::array< long, 2 > read_shape_attribute (const std::string &path, const std::string &name) const override
 
std::filesystem::path materialize (const std::string &path) const override
 
const std::filesystem::path & host_directory () const override
 Host directory used only as the base for ordinary filesystem outputs.
 
std::string describe (const std::string &path) const override
 
std::filesystem::path resolve (const std::string &path) const
 
- Public Member Functions inherited from polyfem::io::ResourceIO
virtual ~ResourceIO ()=default
 
std::vector< std::string > glob (const std::string &pattern) const
 Glob normalized logical paths using POSIX '*' and '?' wildcards.
 
virtual std::string read_string (const std::string &path) const
 
std::vector< std::string > accessed_resources () const
 A snapshot of canonical paths consumed so far, including solver setup.
 

Private Attributes

std::filesystem::path root_
 
std::filesystem::path host_directory_
 

Additional Inherited Members

- Protected Member Functions inherited from polyfem::io::ResourceIO
 ResourceIO ()
 
void record_access (const std::string &path) const
 
- Protected Attributes inherited from polyfem::io::ResourceIO
std::shared_ptr< AccessTracker > access_tracker_
 

Detailed Description

Definition at line 63 of file ResourceIO.hpp.

Constructor & Destructor Documentation

◆ FileSystemIO()

polyfem::io::FileSystemIO::FileSystemIO ( const std::filesystem::path &  root,
const std::filesystem::path &  host_directory = {} 
)
explicit

Definition at line 266 of file ResourceIO.cpp.

References host_directory(), host_directory_, and root_.

Here is the call graph for this function:

Member Function Documentation

◆ canonical_path()

std::string polyfem::io::FileSystemIO::canonical_path ( const std::string &  path) const
inlineoverridevirtual

Absolute resource identity, independent of the active reader root.

Implements polyfem::io::ResourceIO.

Definition at line 71 of file ResourceIO.hpp.

References resolve().

Here is the call graph for this function:

◆ describe()

std::string polyfem::io::FileSystemIO::describe ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 355 of file ResourceIO.cpp.

References resolve().

Referenced by open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exists()

bool polyfem::io::FileSystemIO::exists ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 291 of file ResourceIO.cpp.

References resolve().

Here is the call graph for this function:

◆ has_attribute()

bool polyfem::io::FileSystemIO::has_attribute ( const std::string &  path,
const std::string &  name 
) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 336 of file ResourceIO.cpp.

◆ host_directory()

const std::filesystem::path & polyfem::io::FileSystemIO::host_directory ( ) const
inlineoverridevirtual

Host directory used only as the base for ordinary filesystem outputs.

Implements polyfem::io::ResourceIO.

Definition at line 87 of file ResourceIO.hpp.

References host_directory_.

Referenced by FileSystemIO().

Here is the caller graph for this function:

◆ is_group()

bool polyfem::io::FileSystemIO::is_group ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 292 of file ResourceIO.cpp.

References resolve().

Here is the call graph for this function:

◆ list()

std::vector< std::string > polyfem::io::FileSystemIO::list ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 294 of file ResourceIO.cpp.

References resolve(), and root_.

Here is the call graph for this function:

◆ materialize()

fs::path polyfem::io::FileSystemIO::materialize ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 350 of file ResourceIO.cpp.

References polyfem::io::ResourceIO::record_access(), and resolve().

Here is the call graph for this function:

◆ open()

std::unique_ptr< std::istream > polyfem::io::FileSystemIO::open ( const std::string &  path,
bool  binary 
) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 307 of file ResourceIO.cpp.

References describe(), polyfem::log_and_throw_error(), polyfem::io::ResourceIO::record_access(), and resolve().

Here is the call graph for this function:

◆ read_double_vector()

std::vector< double > polyfem::io::FileSystemIO::read_double_vector ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 328 of file ResourceIO.cpp.

References read_matrix().

Here is the call graph for this function:

◆ read_int_matrix()

Eigen::MatrixXi polyfem::io::FileSystemIO::read_int_matrix ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 322 of file ResourceIO.cpp.

References polyfem::io::ResourceIO::record_access(), and resolve().

Referenced by read_int_vector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_int_vector()

std::vector< int > polyfem::io::FileSystemIO::read_int_vector ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 329 of file ResourceIO.cpp.

References read_int_matrix().

Here is the call graph for this function:

◆ read_integer_attribute()

long polyfem::io::FileSystemIO::read_integer_attribute ( const std::string &  path,
const std::string &  name 
) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 337 of file ResourceIO.cpp.

References polyfem::log_and_throw_error().

Here is the call graph for this function:

◆ read_long_vector()

std::vector< long > polyfem::io::FileSystemIO::read_long_vector ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 330 of file ResourceIO.cpp.

References polyfem::io::ResourceIO::record_access(), and resolve().

Here is the call graph for this function:

◆ read_matrix()

Eigen::MatrixXd polyfem::io::FileSystemIO::read_matrix ( const std::string &  path) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 316 of file ResourceIO.cpp.

References polyfem::io::ResourceIO::record_access(), and resolve().

Referenced by read_double_vector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_shape_attribute()

std::array< long, 2 > polyfem::io::FileSystemIO::read_shape_attribute ( const std::string &  path,
const std::string &  name 
) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 345 of file ResourceIO.cpp.

References polyfem::log_and_throw_error().

Here is the call graph for this function:

◆ read_string_attribute()

std::string polyfem::io::FileSystemIO::read_string_attribute ( const std::string &  path,
const std::string &  name 
) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 341 of file ResourceIO.cpp.

References polyfem::log_and_throw_error().

Here is the call graph for this function:

◆ resolve()

fs::path polyfem::io::FileSystemIO::resolve ( const std::string &  path) const

Definition at line 283 of file ResourceIO.cpp.

References root_.

Referenced by canonical_path(), describe(), exists(), is_group(), list(), materialize(), open(), read_int_matrix(), read_long_vector(), read_matrix(), and with_root().

Here is the caller graph for this function:

◆ with_root()

std::unique_ptr< const ResourceIO > polyfem::io::FileSystemIO::with_root ( const std::string &  root) const
overridevirtual

Implements polyfem::io::ResourceIO.

Definition at line 276 of file ResourceIO.cpp.

References polyfem::io::ResourceIO::access_tracker_, host_directory_, and resolve().

Here is the call graph for this function:

Member Data Documentation

◆ host_directory_

std::filesystem::path polyfem::io::FileSystemIO::host_directory_
private

Definition at line 94 of file ResourceIO.hpp.

Referenced by FileSystemIO(), host_directory(), and with_root().

◆ root_

std::filesystem::path polyfem::io::FileSystemIO::root_
private

Definition at line 93 of file ResourceIO.hpp.

Referenced by FileSystemIO(), list(), and resolve().


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