diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-14 19:36:53 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-14 20:07:47 +0300 |
commit | 0bff1d2776e0da589dd98eca69e7f04fb07dfd02 (patch) | |
tree | f7f8b905a34133d80e93d20770bdb092c04e247d /include/pdb/utils/file.hpp | |
parent | clang-format: don't BinPackArguments (diff) | |
download | winapi-debug-0bff1d2776e0da589dd98eca69e7f04fb07dfd02.tar.gz winapi-debug-0bff1d2776e0da589dd98eca69e7f04fb07dfd02.zip |
clang-format all the code
Diffstat (limited to 'include/pdb/utils/file.hpp')
-rw-r--r-- | include/pdb/utils/file.hpp | 77 |
1 files changed, 36 insertions, 41 deletions
diff --git a/include/pdb/utils/file.hpp b/include/pdb/utils/file.hpp index bf97115..acb5cfc 100644 --- a/include/pdb/utils/file.hpp +++ b/include/pdb/utils/file.hpp @@ -5,55 +5,50 @@ #pragma once -#include <Windows.h> - #pragma warning(push, 0) #include <boost/functional/hash.hpp> #pragma warning(pop) +#include <Windows.h> + #include <cstddef> #include <cstring> - #include <functional> #include <string> -namespace pdb -{ - namespace file - { - std::size_t get_size(const std::string&); - - inline bool operator==(const FILE_ID_128& a, const FILE_ID_128& b) - { - return 0 == std::memcmp(a.Identifier, b.Identifier, sizeof(a.Identifier)); - } - - struct ID - { - const FILE_ID_INFO raw; - - bool operator==(const ID& other) const - { - return raw.VolumeSerialNumber == other.raw.VolumeSerialNumber - && raw.FileId == other.raw.FileId; - } - }; - - ID query_id(const std::string&); - } -} +namespace pdb { +namespace file { -namespace std -{ - template <> - struct hash<pdb::file::ID> - { - std::size_t operator()(const pdb::file::ID& id) const - { - std::size_t seed = 0; - boost::hash_combine(seed, id.raw.VolumeSerialNumber); - boost::hash_combine(seed, id.raw.FileId.Identifier); - return seed; - } - }; +std::size_t get_size(const std::string&); + +inline bool operator==(const FILE_ID_128& a, const FILE_ID_128& b) { + return 0 == std::memcmp(a.Identifier, b.Identifier, sizeof(a.Identifier)); } + +struct ID { + const FILE_ID_INFO raw; + + bool operator==(const ID& other) const { + return raw.VolumeSerialNumber == other.raw.VolumeSerialNumber && + raw.FileId == other.raw.FileId; + } +}; + +ID query_id(const std::string&); + +} // namespace file +} // namespace pdb + +namespace std { + +template <> +struct hash<pdb::file::ID> { + std::size_t operator()(const pdb::file::ID& id) const { + std::size_t seed = 0; + boost::hash_combine(seed, id.raw.VolumeSerialNumber); + boost::hash_combine(seed, id.raw.FileId.Identifier); + return seed; + } +}; + +} // namespace std |