diff options
author | stoffu <stoffu@protonmail.ch> | 2018-06-21 17:19:16 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-06-28 09:40:31 +0900 |
commit | 59de6f8d99f07888c199b466dff9ff020e60dab6 (patch) | |
tree | 15e136f2cbeadda054ca14e6514bd0d8ccb5cd4e /src/common/util.h | |
parent | epee.string_tools: add conversion between UTF-8 and UTF-16 (diff) | |
download | monero-59de6f8d99f07888c199b466dff9ff020e60dab6.tar.xz |
util: add file_locker class
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index dc426830b..a57a85fee 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -91,6 +91,20 @@ namespace tools const std::string& filename() const noexcept { return m_filename; } }; + class file_locker + { + public: + file_locker(const std::string &filename); + ~file_locker(); + bool locked() const; + private: +#ifdef WIN32 + HANDLE m_fd; +#else + int m_fd; +#endif + }; + /*! \brief Returns the default data directory. * * \details Windows < Vista: C:\\Documents and Settings\\Username\\Application Data\\CRYPTONOTE_NAME |