Inserita TString::compare e TMask::on_dirty
git-svn-id: svn://10.65.10.50/trunk@1049 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7b10e9cfaf
commit
7df394a5f3
@ -19,6 +19,7 @@ HIDDEN const char* const MASK_EXT = "msk";
|
||||
|
||||
HIDDEN bool moving_focus = FALSE;
|
||||
|
||||
bool TMask::on_dirty( TMask_field& c ) {return TRUE;}
|
||||
|
||||
bool TMask::test_focus_change(WINDOW next)
|
||||
{
|
||||
|
@ -394,6 +394,29 @@ TString& TString::trim()
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Certified 50%
|
||||
int TString::compare(const char* s, int max, bool ignorecase) const
|
||||
{
|
||||
int res;
|
||||
if (ignorecase)
|
||||
{
|
||||
if (max < 0)
|
||||
res = stricmp(_str, s);
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
res = toupper(_str[i]) - toupper(s[i]);
|
||||
if (res) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
res = max < 0 ? strcmp(_str, s) : strncmp(_str, s, max);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// Certified 100%
|
||||
TString& TString::fill(char c, int n)
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ public:
|
||||
bool operator >=(const char* s) const { return strcmp(_str, s) >= 0; }
|
||||
bool operator <=(const char* s) const { return strcmp(_str, s) <= 0; }
|
||||
bool match(const char* s) const;
|
||||
bool compare(const char* s, int max = -1, bool ignorecase = FALSE) const;
|
||||
int compare(const char* s, int max = -1, bool ignorecase = FALSE) const;
|
||||
};
|
||||
|
||||
// @C
|
||||
|
Loading…
x
Reference in New Issue
Block a user