From b00525a10746de26040d201fa2ca7fb075d1f83b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 12 Jun 2026 23:49:48 +0200 Subject: utils/ -> src/utils/ --- utils/pdb_descr.hpp | 61 ----------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 utils/pdb_descr.hpp (limited to 'utils/pdb_descr.hpp') diff --git a/utils/pdb_descr.hpp b/utils/pdb_descr.hpp deleted file mode 100644 index c2e720a..0000000 --- a/utils/pdb_descr.hpp +++ /dev/null @@ -1,61 +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 - -struct PDB { - winapi::Address online_base; - std::string path; - - static PDB parse(const std::string& src) { - static constexpr auto sep = ','; - - const auto sep_pos = src.find(sep); - if (sep_pos == std::string::npos) - throw boost::program_options::invalid_option_value{src}; - - winapi::Address online_base; - if (!winapi::address::parse(online_base, src.substr(0, sep_pos))) - throw boost::program_options::invalid_option_value{src}; - - return {online_base, src.substr(sep_pos + 1)}; - } - - static winapi::Address parse_address(const std::string& src) { - winapi::Address dest; - if (!winapi::address::parse(dest, src)) - throw boost::program_options::invalid_option_value{src}; - return dest; - } -}; - -template -void validate(boost::any& dest, - const std::vector>& src_tokens, - PDB*, - int) { - namespace po = boost::program_options; - po::validators::check_first_occurrence(dest); - const auto& src_token = po::validators::get_single_string(src_tokens); - dest = boost::any{PDB::parse(src_token)}; -} - -template -void validate(boost::any& dest, - const std::vector>& src_tokens, - winapi::Address*, - int) { - namespace po = boost::program_options; - po::validators::check_first_occurrence(dest); - const auto& src_token = po::validators::get_single_string(src_tokens); - dest = boost::any{PDB::parse_address(src_token)}; -} -- cgit v1.3