diff options
author | lloyd <[email protected]> | 2014-01-06 15:24:01 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-06 15:24:01 +0000 |
commit | 1f73f5f5270f16c9c6cc739d7bfcd7c9002cd340 (patch) | |
tree | e71d84fbb3c28ee996924521b9efa0c02bc6b9f3 | |
parent | ca29b89bce2c555b033825e0cd304e7ce24e8ab2 (diff) |
Move previously common function to only remaining caller's source
-rw-r--r-- | src/common.h | 2 | ||||
-rw-r--r-- | src/main.cpp | 18 | ||||
-rw-r--r-- | src/tests/test_bigint.cpp | 18 |
3 files changed, 18 insertions, 20 deletions
diff --git a/src/common.h b/src/common.h index 75bd41abe..8d4652a3c 100644 --- a/src/common.h +++ b/src/common.h @@ -13,6 +13,4 @@ void strip(std::string& line); inline std::string strip(const std::string& line) { std::string s = line; strip(s); return s; } -std::vector<std::string> parse(const std::string& line); - #endif diff --git a/src/main.cpp b/src/main.cpp index 8bbad670d..0d71c4ebd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,24 +58,6 @@ void strip(std::string& line) line = line.erase(line.find('\t'), 1); } -std::vector<std::string> parse(const std::string& line) - { - const char DELIMITER = ':'; - std::vector<std::string> substr; - std::string::size_type start = 0, end = line.find(DELIMITER); - while(end != std::string::npos) - { - substr.push_back(line.substr(start, end-start)); - start = end+1; - end = line.find(DELIMITER, start); - } - if(line.size() > start) - substr.push_back(line.substr(start)); - while(substr.size() <= 4) // at least 5 substr, some possibly empty - substr.push_back(""); - return substr; - } - namespace { int help(int , char* argv[]) diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp index 2c1b257b9..c19b6cc23 100644 --- a/src/tests/test_bigint.cpp +++ b/src/tests/test_bigint.cpp @@ -22,6 +22,24 @@ using namespace Botan; namespace { +std::vector<std::string> parse(const std::string& line) + { + const char DELIMITER = ':'; + std::vector<std::string> substr; + std::string::size_type start = 0, end = line.find(DELIMITER); + while(end != std::string::npos) + { + substr.push_back(line.substr(start, end-start)); + start = end+1; + end = line.find(DELIMITER, start); + } + if(line.size() > start) + substr.push_back(line.substr(start)); + while(substr.size() <= 4) // at least 5 substr, some possibly empty + substr.push_back(""); + return substr; + } + size_t test_make_prime() { AutoSeeded_RNG rng; |