// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once #include #include /// /// Utility class for discovering and loading PowerToy module settings /// class SettingsLoader { public: SettingsLoader(); ~SettingsLoader(); /// /// Load settings for a PowerToy module /// /// Name of the module (e.g., "CursorWrap") /// Full path to the module DLL (for checking local settings.json) /// JSON settings string, or empty string if not found std::wstring LoadSettings(const std::wstring& moduleName, const std::wstring& moduleDllPath); /// /// Get the settings file path for a module /// /// Name of the module /// Full path to the settings.json file std::wstring GetSettingsPath(const std::wstring& moduleName) const; private: /// /// Get the PowerToys root settings directory /// /// Path to %LOCALAPPDATA%\Microsoft\PowerToys std::wstring GetPowerToysSettingsRoot() const; /// /// Read a text file into a string /// /// Path to the file /// File contents as a string std::wstring ReadFileContents(const std::wstring& filePath) const; };