added: to locale: comparing lexicographically two characters/strings
int Compare(wchar_t c1, wchar_t c2);
int Compare(const std::wstring & str1, const std::wstring & str2);
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@800 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -99,12 +99,20 @@ public:
|
||||
wchar_t ToCapital(wchar_t c);
|
||||
void ToCapital(std::wstring & str);
|
||||
|
||||
// comparing two characters/strings
|
||||
// return a value less than zero if c1<c2, zero if c1==c2, value greater than 0 if c1>c2
|
||||
int Compare(wchar_t c1, wchar_t c2);
|
||||
int Compare(const std::wstring & str1, const std::wstring & str2);
|
||||
|
||||
private:
|
||||
|
||||
// struct to used for substitution
|
||||
struct SubstItem
|
||||
{
|
||||
wchar_t from, to;
|
||||
int index;
|
||||
|
||||
SubstItem() { from = to = 0; index = 0; }
|
||||
bool operator<(const SubstItem & arg) const { return from < arg.from; }
|
||||
};
|
||||
|
||||
@@ -114,6 +122,8 @@ private:
|
||||
void ReadSubstTable(const char * dir, const char * dir_def);
|
||||
bool ReadSubstTable(const char * dir);
|
||||
void CreateSubstVector(std::vector<SubstItem> & vect, const std::wstring & tab1, const std::wstring & tab2);
|
||||
void CreateSubstSortVector(std::vector<SubstItem> & vect, std::vector<std::wstring> & tab);
|
||||
size_t SubstFindIndex(const std::vector<SubstItem> & vect, wchar_t val);
|
||||
wchar_t SubstFind(const std::vector<SubstItem> & vect, wchar_t val);
|
||||
|
||||
// locale files
|
||||
@@ -132,6 +142,7 @@ private:
|
||||
std::vector<SubstItem> subst_url;
|
||||
std::vector<SubstItem> subst_smalllet; // changing from small to capital
|
||||
std::vector<SubstItem> subst_capitallet; // changing from capital to small
|
||||
std::vector<SubstItem> subst_sort; // local characters for comparison
|
||||
|
||||
|
||||
PT::Space space;
|
||||
|
||||
Reference in New Issue
Block a user