From 09f98576e882a5fef68cdefdff939834a8782eaa Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Wed, 11 Sep 2019 23:33:23 -0400 Subject: added env::getFileSecurity() Environment gets stuff on demand --- src/env.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/env.h') diff --git a/src/env.h b/src/env.h index 1f146a08..46095ca3 100644 --- a/src/env.h +++ b/src/env.h @@ -79,6 +79,19 @@ template using COMPtr = std::unique_ptr; +// used by MallocPtr, calls std::free() as the deleter +// +struct MallocFreer +{ + void operator()(void* p) + { + std::free(p); + } +}; + +template +using MallocPtr = std::unique_ptr; + // creates a console in the constructor and destroys it in the destructor, // also redirects standard streams // @@ -133,10 +146,10 @@ public: void dump(const Settings& s) const; private: - std::vector m_modules; - std::unique_ptr m_windows; - std::vector m_security; - std::unique_ptr m_metrics; + mutable std::vector m_modules; + mutable std::unique_ptr m_windows; + mutable std::vector m_security; + mutable std::unique_ptr m_metrics; // dumps all the disks involved in the settings // -- cgit v1.3.1