NoTeX 1.0.0
A modern noteworthy LaTeX template
Loading...
Searching...
No Matches
environment.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
9#include <filesystem>
10#include <string_view>
11
12namespace notex {
13
21
23std::string_view to_string(InstallationType type);
24
36public:
46 explicit Environment(
47 std::filesystem::path start_dir = std::filesystem::current_path());
48
50 const std::filesystem::path& texmf_home() const noexcept {
51 return texmf_home_;
52 }
53
56 const std::filesystem::path& global_latex_dir() const noexcept {
57 return global_latex_dir_;
58 }
59
62 const std::filesystem::path& global_fonts_dir() const noexcept {
63 return global_fonts_dir_;
64 }
65
68 const std::filesystem::path& local_latex_dir() const noexcept {
69 return local_latex_dir_;
70 }
71
74 const std::filesystem::path& local_fonts_dir() const noexcept {
75 return local_fonts_dir_;
76 }
77
82 return installation_type_;
83 }
84
85private:
88 static std::filesystem::path resolve_texmf_home();
89
90 std::filesystem::path texmf_home_;
91 std::filesystem::path global_latex_dir_;
92 std::filesystem::path global_fonts_dir_;
93 std::filesystem::path local_latex_dir_;
94 std::filesystem::path local_fonts_dir_;
95 InstallationType installation_type_;
96};
97
98} // namespace notex
InstallationType installation_type() const noexcept
const std::filesystem::path & local_fonts_dir() const noexcept
Environment(std::filesystem::path start_dir=std::filesystem::current_path())
Resolves TEXMFHOME and checks start_dir for a local installation.
const std::filesystem::path & global_fonts_dir() const noexcept
const std::filesystem::path & texmf_home() const noexcept
const std::filesystem::path & local_latex_dir() const noexcept
const std::filesystem::path & global_latex_dir() const noexcept
@ LOCAL
A local installation exists (takes precedence over global).
@ GLOBAL
Only a global installation exists.
@ NONE
Neither a local nor a global installation was found.
std::string_view to_string(InstallationType type)