aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/utils/pdb_descr.hpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-05-20 03:37:57 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-05-20 03:37:57 +0300
commitbd2e96ea837beb5e54f50dd4fedbb247e5ccd1a1 (patch)
treeedc9cc8756f13c07f58d4d1a2bf08c9b9985d070 /utils/pdb_descr.hpp
parenti have no idea how this compiled (diff)
downloadwinapi-debug-bd2e96ea837beb5e54f50dd4fedbb247e5ccd1a1.tar.gz
winapi-debug-bd2e96ea837beb5e54f50dd4fedbb247e5ccd1a1.zip
code style
Diffstat (limited to 'utils/pdb_descr.hpp')
-rw-r--r--utils/pdb_descr.hpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/utils/pdb_descr.hpp b/utils/pdb_descr.hpp
index c57a0e9..c8a6112 100644
--- a/utils/pdb_descr.hpp
+++ b/utils/pdb_descr.hpp
@@ -17,38 +17,28 @@ namespace
{
struct PDB
{
- PDB(pdb::Address online_base, const std::string& path)
- : online_base{online_base}
- , path{path}
- { }
-
pdb::Address online_base;
std::string path;
static PDB parse(std::string src)
{
static constexpr auto sep = ',';
+
const auto sep_pos = src.find(sep);
if (sep_pos == std::string::npos)
boost::throw_exception(boost::program_options::invalid_option_value{src});
+
pdb::Address online_base;
- if (!parse_address(online_base, src.substr(0, sep_pos)))
+ if (!pdb::parse_address(online_base, src.substr(0, sep_pos)))
boost::throw_exception(boost::program_options::invalid_option_value{src});
- return {online_base, src.substr(sep_pos + 1)};
- }
- static bool parse_address(pdb::Address& dest, const std::string& src)
- {
- std::istringstream iss{src};
- iss >> std::hex;
- char c;
- return iss >> dest && !iss.get(c);
+ return {online_base, src.substr(sep_pos + 1)};
}
static pdb::Address parse_address(const std::string& src)
{
pdb::Address dest;
- if (!parse_address(dest, src))
+ if (!pdb::parse_address(dest, src))
boost::throw_exception(boost::program_options::invalid_option_value{src});
return dest;
}