Abstract interface class for Platform-agnostic file access.
More...
#include <IFile.hpp>
|
| virtual const std::string | extension (const std::string &file)=0 |
| virtual int32 | size (const std::string &file_path)=0 |
| virtual bool | is_dir (const std::string &file_path)=0 |
|
virtual bool | is_file (const std::string &file_path)=0 |
| virtual bool | exists (const std::string &file_path)=0 |
| | Uses stat(2) to determine if the input file exists.
|
| virtual const std::string | path (const std::string &dir_path)=0 |
| | Extract the directory portion of a pathname.
|
| virtual std::string | currentPath (void)=0 |
| virtual bool | set_path (const std::string &path)=0 |
| virtual const std::string | basename (const std::string &filename)=0 |
| virtual std::vector< std::string > | read_dir (const std::string &dir_path)=0 |
| virtual const std::string | resource_path (const std::string &identifier="\0")=0 |
| virtual const std::string | user_documents_path (void)=0 |
| virtual const std::string | user_app_support_path (void)=0 |
| virtual const std::string | user_home_path (void)=0 |
| virtual const std::string | system_path (void)=0 |
| virtual bool | mkdir (const std::string &path)=0 |
| virtual bool | recursive_mkdir (const std::string &path)=0 |
| virtual bool | rmdir (const std::string &path)=0 |
| virtual bool | mkfile (const std::string &path)=0 |
| virtual std::string | env (const std::string &path)=0 |
| virtual nom::size_type | num_files (const std::string &path)=0 |
| | Get the total number of files in a directory.
|
Abstract interface class for Platform-agnostic file access.
Definition at line 42 of file IFile.hpp.
◆ IFile()
| nom::IFile::IFile |
( |
void | | ) |
|
|
inline |
◆ ~IFile()
| virtual nom::IFile::~IFile |
( |
void | | ) |
|
|
inlinevirtual |
◆ basename()
| virtual const std::string nom::IFile::basename |
( |
const std::string & | filename | ) |
|
|
pure virtual |
Return the base file name
- Parameters
-
| filename | Complete file name (including its suffix/extension) |
- Returns
- File name path with its file extension removed upon success – unmodified input filename on failure.
Implemented in nom::UnixFile, and nom::WinFile.
◆ currentPath()
| virtual std::string nom::IFile::currentPath |
( |
void | | ) |
|
|
pure virtual |
◆ env()
| virtual std::string nom::IFile::env |
( |
const std::string & | path | ) |
|
|
pure virtual |
◆ exists()
| virtual bool nom::IFile::exists |
( |
const std::string & | file_path | ) |
|
|
pure virtual |
◆ extension()
| virtual const std::string nom::IFile::extension |
( |
const std::string & | file | ) |
|
|
pure virtual |
Returns the file extension of the input file path
- Returns
- a null terminated string on err
Implemented in nom::UnixFile, and nom::WinFile.
◆ is_dir()
| virtual bool nom::IFile::is_dir |
( |
const std::string & | file_path | ) |
|
|
pure virtual |
◆ mkdir()
| virtual bool nom::IFile::mkdir |
( |
const std::string & | path | ) |
|
|
pure virtual |
◆ mkfile()
| virtual bool nom::IFile::mkfile |
( |
const std::string & | path | ) |
|
|
pure virtual |
◆ num_files()
| virtual nom::size_type nom::IFile::num_files |
( |
const std::string & | path | ) |
|
|
pure virtual |
Get the total number of files in a directory.
\params An absolute directory path.
Implemented in nom::UnixFile, and nom::WinFile.
◆ path()
| virtual const std::string nom::IFile::path |
( |
const std::string & | dir_path | ) |
|
|
pure virtual |
◆ read_dir()
| virtual std::vector< std::string > nom::IFile::read_dir |
( |
const std::string & | dir_path | ) |
|
|
pure virtual |
◆ recursive_mkdir()
| virtual bool nom::IFile::recursive_mkdir |
( |
const std::string & | path | ) |
|
|
pure virtual |
◆ resource_path()
| virtual const std::string nom::IFile::resource_path |
( |
const std::string & | identifier = "\0" | ) |
|
|
pure virtual |
◆ rmdir()
| virtual bool nom::IFile::rmdir |
( |
const std::string & | path | ) |
|
|
pure virtual |
◆ set_path()
| virtual bool nom::IFile::set_path |
( |
const std::string & | path | ) |
|
|
pure virtual |
◆ size()
| virtual int32 nom::IFile::size |
( |
const std::string & | file_path | ) |
|
|
pure virtual |
◆ system_path()
| virtual const std::string nom::IFile::system_path |
( |
void | | ) |
|
|
pure virtual |
◆ user_app_support_path()
| virtual const std::string nom::IFile::user_app_support_path |
( |
void | | ) |
|
|
pure virtual |
◆ user_documents_path()
| virtual const std::string nom::IFile::user_documents_path |
( |
void | | ) |
|
|
pure virtual |
◆ user_home_path()
| virtual const std::string nom::IFile::user_home_path |
( |
void | | ) |
|
|
pure virtual |
The documentation for this class was generated from the following file:
- /home/jeff/Projects/nomlib.git/include/nomlib/system/IFile.hpp