StormByte C++ Library: System module 1.0.1.9999
StormByte-System is the C++26 process and environment module of the StormByte suite.
Loading...
Searching...
No Matches
variable.hxx
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-System.
5 *
6 * StormByte-System is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License version 3
8 * or later, as published by the Free Software Foundation.
9 *
10 * StormByte-System is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with StormByte-System. If not, see
17 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
18 */
19
20#pragma once
21
22#include <StormByte/system/visibility.h>
23
24#include <filesystem>
25#include <string>
26
30namespace StormByte::System {
37 class STORMBYTE_SYSTEM_PUBLIC Variable {
38 public:
44 static std::string Expand(const std::string& str);
45
46 #ifdef WINDOWS
52 static std::string Expand(const std::wstring& str);
53 #endif
54
55 private:
61 static std::string ExpandEnvironmentVariable(const std::string& str);
62
63 #ifdef WINDOWS
69 static std::string ExpandEnvironmentVariable(const std::wstring& str);
70 #else
75 static std::filesystem::path HomePath();
76 #endif
77 };
78}
Environment variable expansion helpers.
Definition variable.hxx:37
static std::string Expand(const std::string &str)
Expand environment variables in str.
System module of the StormByte suite.
Definition exception.hxx:30