From d13f6bb870cdda71257f665367be8ef9fca86255 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Tue, 17 May 2022 11:47:01 +0200 Subject: Apply clang-format. --- src/env.h | 47 +++++++++++------------------------------------ 1 file changed, 11 insertions(+), 36 deletions(-) (limited to 'src/env.h') diff --git a/src/env.h b/src/env.h index 4379b30b..6324ef55 100644 --- a/src/env.h +++ b/src/env.h @@ -12,7 +12,6 @@ class SecurityProduct; class WindowsInfo; class Metrics; - // used by DesktopDCPtr, calls ReleaseDC(0, dc) as the deleter // struct DesktopDCReleaser @@ -29,7 +28,6 @@ struct DesktopDCReleaser using DesktopDCPtr = std::unique_ptr; - // used by HMenuPtr, calls DestroyMenu() as the deleter // struct HMenuFreer @@ -46,7 +44,6 @@ struct HMenuFreer using HMenuPtr = std::unique_ptr; - // used by LibraryPtr, calls FreeLibrary as the deleter // struct LibraryFreer @@ -63,7 +60,6 @@ struct LibraryFreer using LibraryPtr = std::unique_ptr; - // used by COMPtr, calls Release() as the deleter // struct COMReleaser @@ -79,21 +75,16 @@ struct COMReleaser template using COMPtr = std::unique_ptr; - // used by MallocPtr, calls std::free() as the deleter // struct MallocFreer { - void operator()(void* p) - { - std::free(p); - } + void operator()(void* p) { std::free(p); } }; template using MallocPtr = std::unique_ptr; - // used by LocalPtr, calls LocalFree() as the deleter // template @@ -101,16 +92,12 @@ struct LocalFreer { using pointer = T; - void operator()(T p) - { - ::LocalFree(p); - } + void operator()(T p) { ::LocalFree(p); } }; template using LocalPtr = std::unique_ptr>; - // used by the CoTaskMemPtr, calls CoTaskMemFree() as the deleter // template @@ -118,16 +105,12 @@ struct CoTaskMemFreer { using pointer = T; - void operator()(T p) - { - ::CoTaskMemFree(p); - } + void operator()(T p) { ::CoTaskMemFree(p); } }; template using CoTaskMemPtr = std::unique_ptr>; - // creates a console in the constructor and destroys it in the destructor, // also redirects standard streams // @@ -152,17 +135,16 @@ private: FILE* m_err; }; - class ModuleNotification { public: - ModuleNotification(QObject* o, std::function f); + ModuleNotification(QObject* o, std::function f); ~ModuleNotification(); - ModuleNotification(const ModuleNotification&) = delete; + ModuleNotification(const ModuleNotification&) = delete; ModuleNotification& operator=(const ModuleNotification&) = delete; - ModuleNotification(ModuleNotification&&) = default; + ModuleNotification(ModuleNotification&&) = default; ModuleNotification& operator=(ModuleNotification&&) = default; void setCookie(void* c); @@ -172,10 +154,9 @@ private: void* m_cookie; QObject* m_object; std::set m_loaded; - std::function m_f; + std::function m_f; }; - // represents the process's environment // class Environment @@ -211,8 +192,8 @@ public: // will call `f` on the same thread `o` is running on every time a module // is loaded in the process // - std::unique_ptr onModuleLoaded( - QObject* o, std::function f); + std::unique_ptr onModuleLoaded(QObject* o, + std::function f); // logs the environment // @@ -229,7 +210,6 @@ private: void dumpDisks(const Settings& s) const; }; - // environment variables // QString get(const QString& name); @@ -240,7 +220,6 @@ QString appendToPath(const QString& s); QString prependToPath(const QString& s); void setPath(const QString& s); - class Service { public: @@ -258,7 +237,6 @@ public: Running }; - explicit Service(QString name); Service(QString name, StartType st, Status s); @@ -276,12 +254,10 @@ private: Status m_status; }; - Service getService(const QString& name); QString toString(Service::StartType st); QString toString(Service::Status st); - struct Association { // path to the executable associated with the file @@ -300,7 +276,6 @@ struct Association // Association getAssociation(const QFileInfo& file); - // returns whether the given value exists // bool registryValueExists(const QString& key, const QString& value); @@ -313,6 +288,6 @@ void deleteRegistryKeyIfEmpty(const QString& name); // std::filesystem::path thisProcessPath(); -} // namespace env +} // namespace env -#endif // ENV_ENV_H +#endif // ENV_ENV_H -- cgit v1.3.1