StringTokenizer::find implementation and tests

This commit is contained in:
Aleksandar Fabijanic
2008-12-31 16:02:46 +00:00
parent 600161cbf3
commit 66dc4abff0
4 changed files with 112 additions and 0 deletions

View File

@@ -83,4 +83,15 @@ StringTokenizer::~StringTokenizer()
}
std::size_t StringTokenizer::find(const std::string& key, std::size_t pos) const
{
Iterator it = begin();
Iterator stop = end();
for (it += pos; it != stop; ++it)
if (*it == key) return it - begin();
throw NotFoundException(key);
}
} // namespace Poco