WaSH Docs
Functions
sources.hpp File Reference

Contains methods to operating with the filesystem. More...

#include "common.hpp"

Go to the source code of this file.

Functions

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...
 

Detailed Description

Contains methods to operating with the filesystem.

Author
james
Version
0.1
Date
2024-01-25

Function Documentation

◆ 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
optsWash program options
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_pathDirectory 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_dirSource to copy from
    destination_dirDestination 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_dirDirectory to base the random string on
Returns
Random directory to place source files in