diff options
author | Jack Lloyd <[email protected]> | 2020-11-05 03:47:06 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-11-06 11:31:22 -0500 |
commit | a55e4b22b6cbeeb30ca787d4ea4e3933ccccbdf1 (patch) | |
tree | 3d066440f30d30a46179caded3f1273d06a4dd95 /src/lib/utils/parsing.h | |
parent | 7c27982e27b953682554de3c4b22843e0e7461e7 (diff) |
Remove deprecated headers, make more headers internal
Now modules default to internal headers instead of defaulting to public; making
a new public API should be a visible and intentional choice.
Brings the public header count from over 300 to around 150.
Also removes the deprecated tls_blocking interface
Diffstat (limited to 'src/lib/utils/parsing.h')
-rw-r--r-- | src/lib/utils/parsing.h | 79 |
1 files changed, 14 insertions, 65 deletions
diff --git a/src/lib/utils/parsing.h b/src/lib/utils/parsing.h index 216dbc822..01a17bc3a 100644 --- a/src/lib/utils/parsing.h +++ b/src/lib/utils/parsing.h @@ -17,8 +17,6 @@ #include <functional> #include <map> -BOTAN_FUTURE_INTERNAL_HEADER(parsing.h) - namespace Botan { /** @@ -26,7 +24,7 @@ namespace Botan { * @param scan_name the name * @return the name components */ -BOTAN_PUBLIC_API(2,0) std::vector<std::string> +std::vector<std::string> parse_algorithm_name(const std::string& scan_name); /** @@ -35,7 +33,7 @@ parse_algorithm_name(const std::string& scan_name); * @param delim the delimitor * @return string split by delim */ -BOTAN_PUBLIC_API(2,0) std::vector<std::string> split_on( +BOTAN_TEST_API std::vector<std::string> split_on( const std::string& str, char delim); /** @@ -45,68 +43,25 @@ BOTAN_PUBLIC_API(2,0) std::vector<std::string> split_on( * * This function will likely be removed in a future release */ -BOTAN_PUBLIC_API(2,0) std::vector<std::string> +std::vector<std::string> split_on_pred(const std::string& str, std::function<bool (char)> pred); /** -* Erase characters from a string -*/ -BOTAN_PUBLIC_API(2,0) -BOTAN_DEPRECATED("Unused") -std::string erase_chars(const std::string& str, const std::set<char>& chars); - -/** -* Replace a character in a string -* @param str the input string -* @param from_char the character to replace -* @param to_char the character to replace it with -* @return str with all instances of from_char replaced by to_char -*/ -BOTAN_PUBLIC_API(2,0) -BOTAN_DEPRECATED("Unused") -std::string replace_char(const std::string& str, - char from_char, - char to_char); - -/** -* Replace a character in a string -* @param str the input string -* @param from_chars the characters to replace -* @param to_char the character to replace it with -* @return str with all instances of from_chars replaced by to_char -*/ -BOTAN_PUBLIC_API(2,0) -BOTAN_DEPRECATED("Unused") -std::string replace_chars(const std::string& str, - const std::set<char>& from_chars, - char to_char); - -/** * Join a string * @param strs strings to join * @param delim the delimitor * @return string joined by delim */ -BOTAN_PUBLIC_API(2,0) std::string string_join(const std::vector<std::string>& strs, char delim); /** -* Parse an ASN.1 OID -* @param oid the OID in string form -* @return OID components -*/ -BOTAN_PUBLIC_API(2,0) std::vector<uint32_t> -BOTAN_DEPRECATED("Use OID::from_string(oid).get_components()") 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_PUBLIC_API(2,0) bool x500_name_cmp(const std::string& name1, const std::string& name2); @@ -115,38 +70,30 @@ bool x500_name_cmp(const std::string& name1, * @param str the string to convert * @return number value of the string */ -BOTAN_PUBLIC_API(2,0) uint32_t to_u32bit(const std::string& str); +BOTAN_TEST_API uint32_t to_u32bit(const std::string& str); /** * Convert a string to a number * @param str the string to convert * @return number value of the string */ -BOTAN_PUBLIC_API(2,3) uint16_t to_uint16(const std::string& str); - -/** -* Convert a time specification to a number -* @param timespec the time specification -* @return number of seconds represented by timespec -*/ -BOTAN_PUBLIC_API(2,0) uint32_t BOTAN_DEPRECATED("Not used anymore") -timespec_to_u32bit(const std::string& timespec); +uint16_t to_uint16(const std::string& str); /** * Convert a string representation of an IPv4 address to a number * @param ip_str the string representation * @return integer IPv4 address */ -BOTAN_PUBLIC_API(2,0) uint32_t string_to_ipv4(const std::string& ip_str); +uint32_t 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_PUBLIC_API(2,0) std::string ipv4_to_string(uint32_t ip_addr); +std::string ipv4_to_string(uint32_t ip_addr); -std::map<std::string, std::string> BOTAN_PUBLIC_API(2,0) read_cfg(std::istream& is); +std::map<std::string, std::string> read_cfg(std::istream& is); /** * Accepts key value pairs deliminated by commas: @@ -163,15 +110,17 @@ std::map<std::string, std::string> BOTAN_PUBLIC_API(2,0) read_cfg(std::istream& * Within both key and value, comma and equals can be escaped with * backslash. Backslash can also be escaped. */ -std::map<std::string, std::string> BOTAN_PUBLIC_API(2,8) read_kv(const std::string& kv); +BOTAN_TEST_API +std::map<std::string, std::string> read_kv(const std::string& kv); -std::string BOTAN_PUBLIC_API(2,0) clean_ws(const std::string& s); +std::string clean_ws(const std::string& s); /** * Check if the given hostname is a match for the specified wildcard */ -bool BOTAN_PUBLIC_API(2,0) host_wildcard_match(const std::string& wildcard, - const std::string& host); +BOTAN_TEST_API +bool host_wildcard_match(const std::string& wildcard, + const std::string& host); } |