class FileFinder

Overview

Find a file in a list of directories. More…

#include <file_finder.h>

class FileFinder {
public:
    // methods

    static std::filesystem::path findFile(
        const std::string& fileName,
        const std::vector<std::filesystem::path>& searchDirectories
    );

    std::filesystem::path operator () (
        const std::string& fileName,
        const std::vector<std::filesystem::path>& searchDirectories
    );
};

Detailed Documentation

Find a file in a list of directories.

Methods

static std::filesystem::path findFile(
    const std::string& fileName,
    const std::vector<std::filesystem::path>& searchDirectories
)

Find first instance of file in searchDirectories.

Parameters:

fileName

Filename to find

searchDirectories

Directories under which to search for file

Returns:

Returns Path to fileName. Empty if not found

std::filesystem::path operator () (
    const std::string& fileName,
    const std::vector<std::filesystem::path>& searchDirectories
)

Find first instance of file in searchDirectories.

Parameters:

fileName

Filename to find

searchDirectories

Directories under which to search for file

Returns:

Returns Path to fileName. Empty if not found