|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <variant>#include <fcntl.h>#include <unistd.h>#include <dirent.h>#include "swoc/swoc_file.h"#include "swoc/bwf_base.h"
Go to the source code of this file.
Namespaces | |
| namespace | swoc |
| For template deduction guides. | |
Functions | |
| file_status | swoc::file::status (path const &file, std::error_code &ec) |
| int | swoc::file::file_type (const file_status &fs) |
| Return the file type value. | |
| uintmax_t | swoc::file::file_size (const file_status &fs) |
| Size of the file or block device. | |
| bool | swoc::file::exists (const path &p) |
| Check if path exists. | |
| path | swoc::file::absolute (path const &src, std::error_code &ec) |
| file_time_type | swoc::file::last_write_time (file_status const &fs) |
| file_time_type | swoc::file::access_time (file_status const &fs) |
| file_time_type | swoc::file::status_time (file_status const &fs) |
| file_time_type | swoc::file::last_write_time (path const &p, std::error_code &ec) |
| bool | swoc::file::is_readable (const path &s) |
| Check if file is readable. | |
| path | swoc::file::temp_directory_path () |
| Directory location suitable for temporary files. | |
| path | swoc::file::current_path () |
| Current working directory. | |
| path | swoc::file::canonical (const path &p, std::error_code &ec) |
| bool | swoc::file::create_directory (const path &path, std::error_code &ec, mode_t mode) noexcept |
| bool | swoc::file::create_directories (const path &p, std::error_code &ec, mode_t mode) noexcept |
| bool | swoc::file::copy (const path &from, const path &to, std::error_code &ec) |
| uintmax_t | swoc::file::remove_all (const path &p, std::error_code &ec) |
| bool | swoc::file::remove (path const &p, std::error_code &ec) |
| std::string | swoc::file::load (const path &p, std::error_code &ec) |
| BufferWriter & | swoc::bwformat (BufferWriter &w, bwf::Spec const &spec, file::path const &p) |
Minimalist version of std::filesystem.
Definition in file swoc_file.cc.
| path swoc::file::absolute | ( | path const & | src, |
| std::error_code & | ec ) |
Convert to absolute path.
| src | Original path |
| ec | Error code. |
If path is already absolute, a copy of it is returned. Otherwise an absolute path is constructed that refers to the same item in the file system as src. If an error occurs then ec is set to indicate the type of error.
Definition at line 124 of file swoc_file.cc.
| file_time_type swoc::file::access_time | ( | file_status const & | fs | ) |
Definition at line 200 of file swoc_file.cc.
| path swoc::file::canonical | ( | const path & | p, |
| std::error_code & | ec ) |
Definition at line 251 of file swoc_file.cc.
Copy files.
| from | Source file |
| to | Destination file. |
| ec | Error code return. |
true if from was copied, false on error.Definition at line 327 of file swoc_file.cc.
|
noexcept |
Create directories.
| p | Path to directory. |
| ec | Error code return. |
| mode | Permissions for created directories. |
true if p was created, false otherwise.Definition at line 294 of file swoc_file.cc.
|
noexcept |
Create directory.
| p | Path to directory. |
| ec | Error code return. |
| mode | Permissions for created directory. |
true if p was created, false otherwise.Definition at line 272 of file swoc_file.cc.
| path swoc::file::current_path | ( | ) |
Current working directory.
Definition at line 237 of file swoc_file.cc.
| bool swoc::file::exists | ( | const path & | p | ) |
Check if path exists.
Definition at line 117 of file swoc_file.cc.
| uintmax_t swoc::file::file_size | ( | const file_status & | fs | ) |
Size of the file or block device.
Definition at line 112 of file swoc_file.cc.
| int swoc::file::file_type | ( | const file_status & | fs | ) |
Return the file type value.
Definition at line 107 of file swoc_file.cc.
| bool swoc::file::is_readable | ( | const path & | p | ) |
Check if file is readable.
Definition at line 219 of file swoc_file.cc.
| file_time_type swoc::file::last_write_time | ( | file_status const & | fs | ) |
Definition at line 195 of file swoc_file.cc.
| file_time_type swoc::file::last_write_time | ( | path const & | p, |
| std::error_code & | ec ) |
Modification time.
| p | Path to target. |
file_time_type::min() on error. Definition at line 210 of file swoc_file.cc.
| std::string swoc::file::load | ( | const path & | p, |
| std::error_code & | ec ) |
Load the file at p into a std::string.
| p | Path to file |
| ec | Error code result of the file operation. |
Definition at line 454 of file swoc_file.cc.
| bool swoc::file::remove | ( | const path & | path, |
| std::error_code & | ec ) |
Remove a file or empty directory.
| path | Target. |
| ec | Error return. |
true if the operation succeeded, false if ec has an error code. Definition at line 430 of file swoc_file.cc.
| uintmax_t swoc::file::remove_all | ( | const path & | path, |
| std::error_code & | ec ) |
Remove a file or a directory and all nested files.
| path | Target. |
| ec | Error return. |
Definition at line 375 of file swoc_file.cc.
|
noexcept |
Get the status of the file at p.
| file | Path to file. |
| ec | Error code return. |
Definition at line 92 of file swoc_file.cc.
| file_time_type swoc::file::status_time | ( | file_status const & | fs | ) |
Definition at line 205 of file swoc_file.cc.
| path swoc::file::temp_directory_path | ( | ) |
Directory location suitable for temporary files.
Definition at line 224 of file swoc_file.cc.