MCPcopy Create free account
hub / github.com/amule-project/amule / FuzzyStrCmp

Function FuzzyStrCmp

src/libs/common/StringFunctions.cpp:202–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201
202int FuzzyStrCmp(const wxString& a, const wxString& b)
203{
204 size_t aCookie = 0, bCookie = 0;
205 wxString aField, bField;
206
207 do {
208 aField = GetNextField(a, aCookie);
209 bField = GetNextField(b, bCookie);
210
211 if (aField.IsNumber() && bField.IsNumber()) {
212 unsigned long aInteger = StrToULong(aField);
213 unsigned long bInteger = StrToULong(bField);
214
215 if (aInteger < bInteger) {
216 return -1;
217 } else if (aInteger > bInteger) {
218 return 1;
219 }
220 } else if (aField < bField) {
221 return -1;
222 } else if (aField > bField) {
223 return 1;
224 }
225 } while (!aField.IsEmpty() && !bField.IsEmpty());
226
227 return 0;
228}
229
230
231int FuzzyStrCaseCmp(const wxString& a, const wxString& b)

Callers 3

SortProcMethod · 0.85
FuzzyStrCaseCmpFunction · 0.85
TESTFunction · 0.85

Calls 3

GetNextFieldFunction · 0.85
StrToULongFunction · 0.85
IsEmptyMethod · 0.45

Tested by 1

TESTFunction · 0.68