settings_helpers.h
1 #pragma once 2 #include <string> 3 #include <Shlobj.h> 4 5 #include "../utils/json.h" 6 7 namespace PTSettingsHelper 8 { 9 constexpr inline const wchar_t* log_settings_filename = L"log_settings.json"; 10 11 std::wstring get_powertoys_general_save_file_location(); 12 std::wstring get_module_save_file_location(std::wstring_view powertoy_key); 13 std::wstring get_module_save_folder_location(std::wstring_view powertoy_name); 14 std::wstring get_root_save_folder_location(); 15 std::wstring get_local_low_folder_location(); 16 17 void save_module_settings(std::wstring_view powertoy_name, json::JsonObject& settings); 18 json::JsonObject load_module_settings(std::wstring_view powertoy_name); 19 void save_general_settings(const json::JsonObject& settings); 20 json::JsonObject load_general_settings(); 21 std::wstring get_log_settings_file_location(); 22 23 bool get_oobe_opened_state(); 24 void save_oobe_opened_state(); 25 std::wstring get_last_version_run(); 26 void save_last_version_run(const std::wstring& version); 27 28 void save_data_diagnostics(bool enabled); 29 }