diff options
Diffstat (limited to 'src/utils/scan_name.cpp')
-rw-r--r-- | src/utils/scan_name.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils/scan_name.cpp b/src/utils/scan_name.cpp index b867a0462..3425425e2 100644 --- a/src/utils/scan_name.cpp +++ b/src/utils/scan_name.cpp @@ -54,11 +54,18 @@ SCAN_Name::SCAN_Name(const std::string& algo_spec) std::string SCAN_Name::arg(u32bit i) const { - if(i > arg_count()) + if(i >= arg_count()) throw std::range_error("SCAN_Name::argument"); return name[i+1]; } +std::string SCAN_Name::arg(u32bit i, const std::string& def_value) const + { + if(i >= arg_count()) + return def_value; + return name[i+1]; + } + u32bit SCAN_Name::arg_as_u32bit(u32bit i, u32bit def_value) const { if(i >= arg_count()) |