NoTeX
1.0.0
A modern noteworthy LaTeX template
Toggle main menu visibility
Loading...
Searching...
No Matches
notex
include
notex
environment.hpp
Go to the documentation of this file.
1
6
7
#pragma once
8
9
#include <filesystem>
10
#include <string_view>
11
12
namespace
notex
{
13
16
enum class
InstallationType
{
17
NONE
,
18
LOCAL
,
19
GLOBAL
,
20
};
21
23
std::string_view
to_string
(
InstallationType
type);
24
35
class
Environment
{
36
public
:
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
81
InstallationType
installation_type
() const noexcept {
82
return
installation_type_;
83
}
84
85
private
:
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
notex::Environment::installation_type
InstallationType installation_type() const noexcept
Definition
environment.hpp:81
notex::Environment::local_fonts_dir
const std::filesystem::path & local_fonts_dir() const noexcept
Definition
environment.hpp:74
notex::Environment::Environment
Environment(std::filesystem::path start_dir=std::filesystem::current_path())
Resolves TEXMFHOME and checks start_dir for a local installation.
Definition
environment.cpp:61
notex::Environment::global_fonts_dir
const std::filesystem::path & global_fonts_dir() const noexcept
Definition
environment.hpp:62
notex::Environment::texmf_home
const std::filesystem::path & texmf_home() const noexcept
Definition
environment.hpp:50
notex::Environment::local_latex_dir
const std::filesystem::path & local_latex_dir() const noexcept
Definition
environment.hpp:68
notex::Environment::global_latex_dir
const std::filesystem::path & global_latex_dir() const noexcept
Definition
environment.hpp:56
notex
Definition
assets.hpp:20
notex::InstallationType
InstallationType
Definition
environment.hpp:16
notex::InstallationType::LOCAL
@ LOCAL
A local installation exists (takes precedence over global).
Definition
environment.hpp:18
notex::InstallationType::GLOBAL
@ GLOBAL
Only a global installation exists.
Definition
environment.hpp:19
notex::InstallationType::NONE
@ NONE
Neither a local nor a global installation was found.
Definition
environment.hpp:17
notex::to_string
std::string_view to_string(InstallationType type)
Definition
environment.cpp:18
Generated by
1.17.0