diff options
author | lloyd <[email protected]> | 2008-11-11 03:49:23 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-11 03:49:23 +0000 |
commit | 54f82a91844808eb1612080427fb64d44c486aad (patch) | |
tree | 82de46d4ae586f389120a5257576e8354b1e2d3a /src/utils | |
parent | 6d2db29350761e5573c6f7fafefb2b937993fb80 (diff) |
Make SCAN_Name::arg return a new SCAN_Name that has the same providers list,
this allows provider preferences to be passed down to sub-algorithms.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/scan_name.cpp | 10 | ||||
-rw-r--r-- | src/utils/scan_name.h | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/utils/scan_name.cpp b/src/utils/scan_name.cpp index 7855f3ec3..b90211dea 100644 --- a/src/utils/scan_name.cpp +++ b/src/utils/scan_name.cpp @@ -71,7 +71,15 @@ bool SCAN_Name::provider_allowed(const std::string& provider) const return (providers.find(provider) != providers.end()); } -std::string SCAN_Name::arg(u32bit i) const +SCAN_Name SCAN_Name::arg(u32bit i) const + { + if(i > arg_count()) + throw std::range_error("SCAN_Name::argument"); + + return SCAN_Name(name[i+1], orig_providers); + } + +std::string SCAN_Name::arg_as_string(u32bit i) const { if(i > arg_count()) throw std::range_error("SCAN_Name::argument"); diff --git a/src/utils/scan_name.h b/src/utils/scan_name.h index 15fa09f48..22b7aa528 100644 --- a/src/utils/scan_name.h +++ b/src/utils/scan_name.h @@ -53,7 +53,13 @@ class SCAN_Name @param i which argument @return the ith argument */ - std::string arg(u32bit i) const; + std::string arg_as_string(u32bit i) const; + + /** + @param i which argument + @return the ith argument + */ + SCAN_Name arg(u32bit i) const; /** @param i which argument |