CPGen
C++ project generator
Loading...
Searching...
No Matches
Namespaces | Functions
PathResolver.hpp File Reference

Shared utilities for locating CPGen's template directories. More...

#include <filesystem>
#include <vector>
Include dependency graph for PathResolver.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  PathResolver
 

Functions

std::filesystem::path PathResolver::executablePath ()
 Resolve the absolute path of the running executable.
 
std::vector< std::filesystem::path > PathResolver::resolveTemplatePaths ()
 Build the ordered list of template search directories.
 
std::filesystem::path PathResolver::findTemplatesRoot ()
 Return the first existing template root directory.
 

Detailed Description

Shared utilities for locating CPGen's template directories.

Author
Darleanow

Centralises the template search-path logic that was previously duplicated between ModuleResolver and main.cpp.

Search order

  1. ~/.config/cpgen/templates (user-local)
  2. /usr/local/share/cpgen/templates (system-wide, local install)
  3. /usr/share/cpgen/templates (system-wide, package manager)
  4. <executable_dir>/templates (development in-tree build)