------------------------------------------------------------ revno: 13191 revision-id: kinkie@squid-cache.org-20131218175343-51283f9bmm81ykwx parent: rousskov@measurement-factory.com-20131218171900-dz28iirj5y215tys committer: Francesco Chemolli branch nick: trunk timestamp: Wed 2013-12-18 18:53:43 +0100 message: Rename SBuf::find_first_of and find_first_not_of to camelCase. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: kinkie@squid-cache.org-20131218175343-51283f9bmm81ykwx # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 716408ccade1b62a8c6ed877105c07f0c8897bc6 # timestamp: 2013-12-18 18:54:06 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: rousskov@measurement-factory.com-20131218171900-\ # dz28iirj5y215tys # # Begin patch === modified file 'src/SBuf.cc' --- src/SBuf.cc 2013-12-17 10:19:44 +0000 +++ src/SBuf.cc 2013-12-18 17:53:43 +0000 @@ -689,7 +689,7 @@ } SBuf::size_type -SBuf::find_first_of(const CharacterSet &set, size_type startPos) const +SBuf::findFirstOf(const CharacterSet &set, size_type startPos) const { ++stats.find; @@ -712,7 +712,7 @@ } SBuf::size_type -SBuf::find_first_not_of(const CharacterSet &set, size_type startPos) const +SBuf::findFirstNotOf(const CharacterSet &set, size_type startPos) const { ++stats.find; === modified file 'src/SBuf.h' --- src/SBuf.h 2013-12-17 10:19:44 +0000 +++ src/SBuf.h 2013-12-18 17:53:43 +0000 @@ -517,7 +517,7 @@ * * 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 * @@ -527,7 +527,7 @@ * * 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 * === modified file 'src/tests/SBufFindTest.cc' --- src/tests/SBufFindTest.cc 2013-12-15 12:48:01 +0000 +++ src/tests/SBufFindTest.cc 2013-12-18 17:53:43 +0000 @@ -100,13 +100,13 @@ 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"); } === modified file 'src/tests/testSBuf.cc' --- src/tests/testSBuf.cc 2013-12-17 10:19:44 +0000 +++ src/tests/testSBuf.cc 2013-12-18 17:53:43 +0000 @@ -760,19 +760,19 @@ 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); } @@ -783,19 +783,19 @@ 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); }