Contains methods to operating with the filesystem.
More...
#include "common.hpp"
Go to the source code of this file.
|
| std::string | ws2st::files::generateAppDirectoryName (const std::string &source_dir) |
| | Creates a random 8-character directory name from the input source directory (loosely based on fs::hash) More...
|
| |
| bool | ws2st::files::cleanDirectory (const fs::path &directory_path) |
| | Cleans a directory by removing all files within it. More...
|
| |
| std::optional< std::vector< std::string > > | ws2st::files::copyDirectoryFiles (const fs::path &source_dir, const fs::path &destination_dir) |
| | Copies a directories files to another directory Is recursive in the filesystem and will rename any colliding files. More...
|
| |
| std::vector< std::string > | ws2st::files::assembleSourceWithBackend (WashOptions &opts) |
| | Performs the necessary steps to prepare for the refactoring tool Creates temporary directory & copies all the necessary files there. More...
|
| |
Contains methods to operating with the filesystem.
- Author
- james
- Version
- 0.1
- Date
- 2024-01-25
- Copyright
- Copyright (c) 2024
◆ assembleSourceWithBackend()
| std::vector< std::string > ws2st::files::assembleSourceWithBackend |
( |
WashOptions & |
opts | ) |
|
Performs the necessary steps to prepare for the refactoring tool Creates temporary directory & copies all the necessary files there.
- Parameters
-
- Returns
- List of files created
◆ cleanDirectory()
| bool ws2st::files::cleanDirectory |
( |
const fs::path & |
directory_path | ) |
|
Cleans a directory by removing all files within it.
- Parameters
-
| directory_path | Directory to clean |
- Returns
- boolean indicating success/failure
◆ copyDirectoryFiles()
| std::optional< std::vector< std::string > > ws2st::files::copyDirectoryFiles |
( |
const fs::path & |
source_dir, |
|
|
const fs::path & |
destination_dir |
|
) |
| |
Copies a directories files to another directory Is recursive in the filesystem and will rename any colliding files.
- This will cause include errors if there are collisions in header files but I can't see a way to resolve this anyway
- Parameters
-
| source_dir | Source to copy from |
| destination_dir | Destination to copy to |
- Returns
- Either nullopt on fail, or on success a vector of all processed files
◆ generateAppDirectoryName()
| std::string ws2st::files::generateAppDirectoryName |
( |
const std::string & |
source_dir | ) |
|
Creates a random 8-character directory name from the input source directory (loosely based on fs::hash)
- Parameters
-
| souce_dir | Directory to base the random string on |
- Returns
- Random directory to place source files in