-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parse: move some query.hpp code to parse.hpp + remove some bloat code
- Loading branch information
1 parent
70db66f
commit 4c791ed
Showing
6 changed files
with
51 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <unordered_map> | ||
#include <variant> | ||
#include <string> | ||
#include <memory> | ||
|
||
#include "config.hpp" | ||
|
||
using systemInfo_t = std::unordered_map<std::string, std::unordered_map<std::string, std::variant<std::string, size_t, float>>>; | ||
using variant = std::variant<std::string, size_t, float>; | ||
|
||
// Parse input, in-place, with data from systemInfo. | ||
// Documentation on formatting is in the default config.toml file. | ||
// pureOutput is set to the string, but without the brackets. | ||
std::string parse(const std::string& input, systemInfo_t& systemInfo, std::string &pureOutput, Config& config, colors_t& colors); | ||
std::string parse(const std::string& input, systemInfo_t& systemInfo, Config& config, colors_t& colors); | ||
|
||
// Set module values to a systemInfo_t map. | ||
// If the name of said module matches any module name, it will be added | ||
// else, error out. | ||
void addModuleValues(systemInfo_t& sysInfo, const std::string_view moduleName); | ||
void addValueFromModule(systemInfo_t& sysInfo, const std::string& moduleName, const std::string& moduleValueName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters