From 24ea524731843f605f06f1928b190558baf1a697 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 19 Jul 2013 22:47:17 +0000 Subject: [PATCH] is_hex should not be exported --- examples/client_test.cpp | 12 ++++++++++++ include/libtorrent/escape_string.hpp | 2 +- include/libtorrent/string_util.hpp | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 22eb53fa5..c2dd6f78f 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -253,6 +253,18 @@ int load_file(std::string const& filename, std::vector& v, libtorrent::err return 0; } +bool is_hex(char const *in, int len) +{ + for (char const* end = in + len; in < end; ++in) + { + if (in >= '0' && in <= '9') continue; + if (in >= 'A' && in <= 'F') continue; + if (in >= 'a' && in <= 'f') continue; + return false; + } + return true; +} + enum { torrents_all, torrents_downloading, diff --git a/include/libtorrent/escape_string.hpp b/include/libtorrent/escape_string.hpp index 2c7175878..1253c56e8 100644 --- a/include/libtorrent/escape_string.hpp +++ b/include/libtorrent/escape_string.hpp @@ -71,7 +71,7 @@ namespace libtorrent TORRENT_EXTRA_EXPORT int hex_to_int(char in); TORRENT_EXPORT std::string to_hex(std::string const& s); - TORRENT_EXPORT bool is_hex(char const *in, int len); + TORRENT_EXTRA_EXPORT bool is_hex(char const *in, int len); TORRENT_EXPORT void to_hex(char const *in, int len, char* out); TORRENT_EXPORT bool from_hex(char const *in, int len, char* out); diff --git a/include/libtorrent/string_util.hpp b/include/libtorrent/string_util.hpp index 3ed17ff5d..916cc159e 100644 --- a/include/libtorrent/string_util.hpp +++ b/include/libtorrent/string_util.hpp @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { TORRENT_EXTRA_EXPORT bool is_alpha(char c); - TORRENT_EXPORT bool is_digit(char c); + TORRENT_EXTRA_EXPORT bool is_digit(char c); TORRENT_EXTRA_EXPORT bool is_print(char c); TORRENT_EXTRA_EXPORT bool is_space(char c); TORRENT_EXTRA_EXPORT char to_lower(char c);