diff options
author | lloyd <[email protected]> | 2010-10-01 01:57:12 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-01 01:57:12 +0000 |
commit | df61bbc26af9d82a07bfee963a2e43eb66b9f597 (patch) | |
tree | 5024e8db816ccb7bea8ca2a5e3883fda04da4088 /src/utils | |
parent | 9375b29257bb190f196a93349919e119aed085aa (diff) |
Doxygen
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/parsing.h | 75 |
1 files changed, 61 insertions, 14 deletions
diff --git a/src/utils/parsing.h b/src/utils/parsing.h index 2c29d5b4d..cafdd146b 100644 --- a/src/utils/parsing.h +++ b/src/utils/parsing.h @@ -14,27 +14,74 @@ namespace Botan { -/* -* String Parsing Functions +/** +* Parse a SCAN-style algorithm name +* @param scan_name the name +* @return the name components */ -BOTAN_DLL std::vector<std::string> parse_algorithm_name(const std::string&); -BOTAN_DLL std::vector<std::string> split_on(const std::string&, char); -BOTAN_DLL std::vector<u32bit> parse_asn1_oid(const std::string&); -BOTAN_DLL bool x500_name_cmp(const std::string&, const std::string&); +BOTAN_DLL std::vector<std::string> +parse_algorithm_name(const std::string& scan_name); -/* -* String/Integer Conversions +/** +* Split a string +* @param str the input string +* @param delim the delimitor +* @return string split by delim +*/ +BOTAN_DLL std::vector<std::string> split_on( + const std::string& str, char delim); + +/** +* Parse an ASN.1 OID +* @param oid the OID in string form +* @return OID components +*/ +BOTAN_DLL std::vector<u32bit> parse_asn1_oid(const std::string& oid); + +/** +* Compare two names using the X.509 comparison algorithm +* @param name1 the first name +* @param name2 the second name +* @return true if name1 is the same as name2 by the X.509 comparison rules +*/ +BOTAN_DLL bool x500_name_cmp(const std::string& name1, + const std::string& name2); + +/** +* Convert a number to a string +* @param n the integer to convert to a string +* @param min_len the min length of the output string +* @return n convert to a string +*/ +BOTAN_DLL std::string to_string(u64bit n, u32bit min_len= 0); + +/** +* Convert a string to a number +* @param str the string to convert +* @return number value of the string */ -BOTAN_DLL std::string to_string(u64bit, u32bit = 0); -BOTAN_DLL u32bit to_u32bit(const std::string&); +BOTAN_DLL u32bit to_u32bit(const std::string& str); +/** +* Convert a time specification to a number +* @param timespec the time specification +* @return number of seconds represented by timespec +*/ BOTAN_DLL u32bit timespec_to_u32bit(const std::string& timespec); -/* -* String/Network Address Conversions +/** +* Convert a string representation of an IPv4 address to a number +* @param ip_str the string representation +* @return integer IPv4 address +*/ +BOTAN_DLL u32bit string_to_ipv4(const std::string& ip_str); + +/** +* Convert an IPv4 address to a string +* @param ip_addr the IPv4 address to convert +* @return string representation of the IPv4 address */ -BOTAN_DLL u32bit string_to_ipv4(const std::string&); -BOTAN_DLL std::string ipv4_to_string(u32bit); +BOTAN_DLL std::string ipv4_to_string(u32bit ip_addr); } |