*
* TODO: rename to camelCase
*/
- size_type find_first_of(const CharacterSet &set, size_type startPos = 0) const;
+ size_type findFirstOf(const CharacterSet &set, size_type startPos = 0) const;
/** Find first occurrence character NOT in character set
*
*
* TODO: rename to camelCase
*/
- size_type find_first_not_of(const CharacterSet &set, size_type startPos = 0) const;
+ size_type findFirstNotOf(const CharacterSet &set, size_type startPos = 0) const;
/** sscanf-alike
*
checkResults("find");
}
-/// tests SBuf::find_first_of(string needle, pos)
+/// tests SBuf::findFirstOf(string needle, pos)
void
SBufFindTest::testFindFirstOf()
{
theFindString = theStringHay.find_first_of(theStringNeedle, thePos);
theBareNeedlePos = theStringHay.find_first_of(theStringNeedle);
- theFindSBuf = theSBufHay.find_first_of(CharacterSet("cs",theSBufNeedle.c_str()), thePos);
+ theFindSBuf = theSBufHay.findFirstOf(CharacterSet("cs",theSBufNeedle.c_str()), thePos);
checkResults("find_first_of");
}
SBuf::size_type idx;
// not found
- idx=haystack.find_first_of(CharacterSet("t1","ADHRWYP"));
+ idx=haystack.findFirstOf(CharacterSet("t1","ADHRWYP"));
CPPUNIT_ASSERT_EQUAL(SBuf::npos,idx);
// found at beginning
- idx=haystack.find_first_of(CharacterSet("t2","THANDF"));
+ idx=haystack.findFirstOf(CharacterSet("t2","THANDF"));
CPPUNIT_ASSERT_EQUAL(0U,idx);
//found at end of haystack
- idx=haystack.find_first_of(CharacterSet("t3","QWERYVg"));
+ idx=haystack.findFirstOf(CharacterSet("t3","QWERYVg"));
CPPUNIT_ASSERT_EQUAL(haystack.length()-1,idx);
//found in the middle of haystack
- idx=haystack.find_first_of(CharacterSet("t4","QWERqYV"));
+ idx=haystack.findFirstOf(CharacterSet("t4","QWERqYV"));
CPPUNIT_ASSERT_EQUAL(4U,idx);
}
SBuf::size_type idx;
// all chars from the set
- idx=haystack.find_first_not_of(CharacterSet("t1",literal.c_str()));
+ idx=haystack.findFirstNotOf(CharacterSet("t1",literal.c_str()));
CPPUNIT_ASSERT_EQUAL(SBuf::npos,idx);
// found at beginning
- idx=haystack.find_first_not_of(CharacterSet("t2","a"));
+ idx=haystack.findFirstNotOf(CharacterSet("t2","a"));
CPPUNIT_ASSERT_EQUAL(0U,idx);
//found at end of haystack
- idx=haystack.find_first_not_of(CharacterSet("t3",literal.substr(0,literal.length()-1).c_str()));
+ idx=haystack.findFirstNotOf(CharacterSet("t3",literal.substr(0,literal.length()-1).c_str()));
CPPUNIT_ASSERT_EQUAL(haystack.length()-1,idx);
//found in the middle of haystack
- idx=haystack.find_first_not_of(CharacterSet("t4","The"));
+ idx=haystack.findFirstNotOf(CharacterSet("t4","The"));
CPPUNIT_ASSERT_EQUAL(3U,idx);
}