MCPcopy Create free account
hub / github.com/cinder/Cinder / CompareStringPrefix

Class CompareStringPrefix

samples/_timeline/VisualDictionary/src/Dictionary.cpp:31–39  ·  view source on GitHub ↗

Functor used to determine whether the prefix of length 'compareLength' of two words are the same

Source from the content-addressed store, hash-verified

29
30// Functor used to determine whether the prefix of length 'compareLength' of two words are the same
31struct CompareStringPrefix {
32 CompareStringPrefix( int compareLength ) : mCompareLength( compareLength ){}
33
34 bool operator()( string test1, string test2 ) const {
35 return strncmp( test1.c_str(), test2.c_str(), mCompareLength ) < 0;
36 }
37
38 int mCompareLength;
39};
40
41vector<string> Dictionary::getDescendants( const string &word ) const
42{

Callers 1

getDescendantsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected