Add wxDictionaryStringSortAscending comparison function.

Add "dictionary sort" callbacks and document them and the already existing
wxStringSortAscending() and wxStringSortDescending().

See #16330.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-06-23 12:02:09 +00:00
parent ba1c305343
commit af77028fcf
3 changed files with 83 additions and 0 deletions

View File

@@ -358,6 +358,20 @@ void ArraysTestCase::SortedArray()
a.push_back("b");
a.push_back("a");
CPPUNIT_ASSERT_EQUAL( 0, a.Index("a") );
wxSortedArrayString ar(wxStringSortDescending);
ar.Add("a");
ar.Add("b");
CPPUNIT_ASSERT_EQUAL( "b", ar[0] );
CPPUNIT_ASSERT_EQUAL( "a", ar[1] );
wxSortedArrayString ad(wxDictionaryStringSortAscending);
ad.Add("AB");
ad.Add("a");
ad.Add("Aa");
CPPUNIT_ASSERT_EQUAL( "a", ad[0] );
CPPUNIT_ASSERT_EQUAL( "Aa", ad[1] );
}
void ArraysTestCase::wxStringArraySplitTest()