diff options
author | lloyd <[email protected]> | 2014-01-07 11:34:48 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-07 11:34:48 +0000 |
commit | 83f69bcad312352b9d20fbfda183ddba62ed861e (patch) | |
tree | abdbeee5674803d0ef17b8a1d37c8b0e69ae553e /src/tests/kat_bigint.cpp | |
parent | df4c2511fcabb0a669c7a04ea50867a9fe41d863 (diff) |
Cleanups
Diffstat (limited to 'src/tests/kat_bigint.cpp')
-rw-r--r-- | src/tests/kat_bigint.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tests/kat_bigint.cpp b/src/tests/kat_bigint.cpp index c19b6cc23..fe63f8b85 100644 --- a/src/tests/kat_bigint.cpp +++ b/src/tests/kat_bigint.cpp @@ -22,6 +22,32 @@ using namespace Botan; namespace { +void strip_comments(std::string& line) + { + if(line.find('#') != std::string::npos) + line = line.erase(line.find('#'), std::string::npos); + } + +void strip_newlines(std::string& line) + { + while(line.find('\n') != std::string::npos) + line = line.erase(line.find('\n'), 1); + } + +/* Strip comments, whitespace, etc */ +void strip(std::string& line) + { + strip_comments(line); + +#if 0 + while(line.find(' ') != std::string::npos) + line = line.erase(line.find(' '), 1); +#endif + + while(line.find('\t') != std::string::npos) + line = line.erase(line.find('\t'), 1); + } + std::vector<std::string> parse(const std::string& line) { const char DELIMITER = ':'; |