diff --git a/Foundation/src/StringTokenizer.cpp b/Foundation/src/StringTokenizer.cpp index 48508693a..4ba56298c 100644 --- a/Foundation/src/StringTokenizer.cpp +++ b/Foundation/src/StringTokenizer.cpp @@ -78,6 +78,12 @@ StringTokenizer::StringTokenizer(const std::string& str, const std::string& sepa } } + +StringTokenizer::~StringTokenizer() +{ +} + + std::size_t StringTokenizer::count(const std::string& token) const { std::size_t result = 0; @@ -120,65 +126,6 @@ std::size_t StringTokenizer::replace(const std::string& oldToken, const std::str return result; } -StringTokenizer::~StringTokenizer() -{ -} - - -bool StringTokenizer::has(const std::string& token) const -{ - Iterator it = begin(); - Iterator stop = end(); - for (; it != stop; ++it) - if (*it == token) - return true; - - return false; -} - - -std::size_t StringTokenizer::find(const std::string& token, std::size_t pos) const -{ - Iterator it = begin(); - Iterator stop = end(); - for (it += pos; it != stop; ++it) - if (*it == token) - return it - begin(); - - throw NotFoundException(token); -} - - -std::size_t StringTokenizer::replace(const std::string& oldToken, const std::string& newToken, std::size_t pos) -{ - std::size_t count = 0; - TokenVec::iterator it = _tokens.begin(); - TokenVec::iterator stop = _tokens.end(); - for (it += pos; it != stop; ++it) - { - if (*it == oldToken) - { - *it = newToken; - ++count; - } - } - - return count; -} - - -std::size_t StringTokenizer::count(const std::string& token) const -{ - std::size_t cnt = 0; - Iterator it = begin(); - Iterator stop = end(); - for (; it != stop; ++it) - if (*it == token) - ++cnt; - - return cnt; -} - } // namespace Poco diff --git a/Foundation/testsuite/src/LRUCacheTest.h b/Foundation/testsuite/src/LRUCacheTest.h index 0ae8b643a..40ac102db 100644 --- a/Foundation/testsuite/src/LRUCacheTest.h +++ b/Foundation/testsuite/src/LRUCacheTest.h @@ -49,24 +49,24 @@ public: void testClear(); void testCacheSize0(); void testCacheSize1(); - void testCacheSize2(); - void testCacheSizeN(); - void testDuplicateAdd(); - void testUpdate(); - - void setUp(); - void tearDown(); - static CppUnit::Test* suite(); + void testCacheSize2(); + void testCacheSizeN(); + void testDuplicateAdd(); + void testUpdate(); + + void setUp(); + void tearDown(); + static CppUnit::Test* suite(); private: - void onUpdate(const void* pSender, const Poco::KeyValueArgs& args); - void onAdd(const void* pSender, const Poco::KeyValueArgs& args); - void onRemove(const void* pSender, const int& args); + void onUpdate(const void* pSender, const Poco::KeyValueArgs& args); + void onAdd(const void* pSender, const Poco::KeyValueArgs& args); + void onRemove(const void* pSender, const int& args); private: - int addCnt; - int updateCnt; - int removeCnt; + int addCnt; + int updateCnt; + int removeCnt; }; diff --git a/Foundation/testsuite/src/StringTokenizerTest.h b/Foundation/testsuite/src/StringTokenizerTest.h index d271aa502..2b541f31d 100644 --- a/Foundation/testsuite/src/StringTokenizerTest.h +++ b/Foundation/testsuite/src/StringTokenizerTest.h @@ -31,32 +31,27 @@ // DEALINGS IN THE SOFTWARE. // - #ifndef StringTokenizerTest_INCLUDED #define StringTokenizerTest_INCLUDED - #include "Poco/Foundation.h" #include "CppUnit/TestCase.h" - class StringTokenizerTest: public CppUnit::TestCase { public: StringTokenizerTest(const std::string& name); - ~StringTokenizerTest(); + ~StringTokenizerTest(); - void testStringTokenizer(); - void testFind(); + void testStringTokenizer(); void testFind(); - void setUp(); - void tearDown(); + void setUp(); + void tearDown(); static CppUnit::Test* suite(); private: }; - #endif // StringTokenizerTest_INCLUDED