aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/scan_name.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-11 18:17:36 +0000
committerlloyd <[email protected]>2008-11-11 18:17:36 +0000
commit237258e42f4b1b8c01d91518270c4a9c59a0dc47 (patch)
tree4fbea59fc932e0b08c5e0e73b906be913811c216 /src/utils/scan_name.h
parent6a1e19928007c0047518e8e15b92bba116bf7a58 (diff)
Remove support for multiple providers in SCAN_Name, mostly because I
couldn't really figure out how the semantics should work.
Diffstat (limited to 'src/utils/scan_name.h')
-rw-r--r--src/utils/scan_name.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/utils/scan_name.h b/src/utils/scan_name.h
index 22b7aa528..b01411c94 100644
--- a/src/utils/scan_name.h
+++ b/src/utils/scan_name.h
@@ -22,12 +22,22 @@ class SCAN_Name
public:
/**
@param algo_spec A SCAN name
- @param providers An optional list of providers (like "sse2,openssl,x86-64,core")
+ @param providers An optional provider name
*/
SCAN_Name(const std::string& algo_spec,
const std::string& providers = "");
/**
+ @return the original input string
+ */
+ std::string as_string() const { return orig_algo_spec; }
+
+ /**
+ @return the provider name (or empty)
+ */
+ std::string provider() const { return m_provider; }
+
+ /**
@return the algorithm name
*/
std::string algo_name() const { return name[0]; }
@@ -41,7 +51,10 @@ class SCAN_Name
@param provider a provider name
@returns if this provider was allowed by the request
*/
- bool provider_allowed(const std::string& provider) const;
+ bool provider_allowed(const std::string& provider) const
+ {
+ return (m_provider == "" || m_provider == provider);
+ }
/**
@return if the number of arguments is between lower and upper
@@ -66,13 +79,9 @@ class SCAN_Name
@return the ith argument as a u32bit, or a default value
*/
u32bit arg_as_u32bit(u32bit i, u32bit def_value) const;
-
- std::string as_string() const { return orig_algo_spec; }
- std::string providers_string() const { return orig_providers; }
private:
- std::string orig_algo_spec, orig_providers;
+ std::string orig_algo_spec, m_provider;
std::vector<std::string> name;
- std::set<std::string> providers;
};
}