From de5c928779d69e22221d08c21ce3b5455157004e Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 16 May 2021 01:21:58 +0300 Subject: export pdb::file to winapi-common's File --- include/pdb/all.hpp | 1 - include/pdb/repo.hpp | 5 +++-- include/pdb/utils/file.hpp | 52 ---------------------------------------------- 3 files changed, 3 insertions(+), 55 deletions(-) delete mode 100644 include/pdb/utils/file.hpp (limited to 'include') diff --git a/include/pdb/all.hpp b/include/pdb/all.hpp index 0f02c98..3e6c3e8 100644 --- a/include/pdb/all.hpp +++ b/include/pdb/all.hpp @@ -13,4 +13,3 @@ #include "process.hpp" #include "repo.hpp" #include "symbol.hpp" -#include "utils/file.hpp" diff --git a/include/pdb/repo.hpp b/include/pdb/repo.hpp index 571a164..3b194ff 100644 --- a/include/pdb/repo.hpp +++ b/include/pdb/repo.hpp @@ -9,7 +9,8 @@ #include "dbghelp.hpp" #include "module.hpp" #include "symbol.hpp" -#include "utils/file.hpp" + +#include #include #include @@ -49,7 +50,7 @@ private: const DbgHelp dbghelp{DbgHelp::post_mortem()}; - std::unordered_set file_ids; + std::unordered_set file_ids; std::map online_bases; std::map offline_bases; }; diff --git a/include/pdb/utils/file.hpp b/include/pdb/utils/file.hpp deleted file mode 100644 index 44d3d5f..0000000 --- a/include/pdb/utils/file.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2017 Egor Tensin -// This file is part of the "winapi-debug" project. -// For details, see https://github.com/egor-tensin/winapi-debug. -// Distributed under the MIT License. - -#pragma once - -#include - -#include - -#include -#include -#include -#include - -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 file -} // namespace pdb - -namespace std { - -template <> -struct hash { - 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 -- cgit v1.2.3