本文整理汇总了C++中wxString::CmpNoCase方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::CmpNoCase方法的具体用法?C++ wxString::CmpNoCase怎么用?C++ wxString::CmpNoCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::CmpNoCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CompareAccelString
// return true if the 2 strings refer to the same accel
//
// as accels can be either translated or not, check for both possibilities and
// also compare case-insensitively as the key names case doesn't count
static inline bool CompareAccelString(const wxString& str, const char *accel)
{
return str.CmpNoCase(accel) == 0
#if wxUSE_INTL
|| str.CmpNoCase(wxGetTranslation(accel)) == 0
#endif
;
}
示例2: GetSpecialUrlType
SPECIALURLTYPE GetSpecialUrlType(const wxString&Url)
{
const wxString l4 = Url.Left(4);
if (0 == l4.CmpNoCase(wxT("BIN:"))) return SUT_BIN;
if (0 == l4.CmpNoCase(wxT("DOC:"))) return SUT_DOC;
if (0 == l4.CmpNoCase(wxT("WEB:"))) return SUT_WEB;
return SUT_UNKNOWN;
}
示例3: GetBoolInfo
// Getter
bool Model_Infotable::GetBoolInfo(const wxString& key, bool default_value)
{
const wxString value = this->GetStringInfo(key, "");
if (value == "1" || value.CmpNoCase("TRUE") == 0)
return true;
else if (value == "0" || value.CmpNoCase("FALSE") == 0)
return false;
else
return default_value;
}
示例4: StringToBool
static bool StringToBool(const wxString str)
{
if(
!str.CmpNoCase("enable") ||
!str.CmpNoCase("e") ||
!str.CmpNoCase("1") ||
!str.CmpNoCase("true") ||
!str.CmpNoCase("t") )
{
return true;
}
return false;
}
示例5: CmpPaths
bool DiffPanel::CmpPaths(const wxString& path1, const wxString& path2) const {
#ifdef __WXMSW__
// paths on windows are case-insensitive
if (path1.CmpNoCase(m_leftEditor->GetPath()) == 0 &&
path2.CmpNoCase(m_rightEditor->GetPath()) == 0) return true;
if (path2.CmpNoCase(m_leftEditor->GetPath()) == 0 &&
path1.CmpNoCase(m_rightEditor->GetPath()) == 0) return true;
#else
if (path1 == m_leftEditor->GetPath() &&
path2 == m_rightEditor->GetPath()) return true;
if (path2 == m_leftEditor->GetPath() &&
path1 == m_rightEditor->GetPath()) return true;
#endif
return false;
}
示例6: GetNodeAfterAlphabetically
//==========================================================================
// Class: XMLConversionFactors
// Function: GetNodeAfterAlphabetically
//
// Description: Finds the node following the node to be added in order to
// maintain alphabetical entry of nodes.
//
// Input Arguments:
// name = const wxString&
// parent = wxXmlNode*
//
// Output Arguments:
// nodeAfterChild = wxXmlNode*&
//
// Return Value:
// bool, true if a following node was found OR the child will be the first
// child for the parent (in the case of this node being the first child,
// nodeAfterChild will be NULL), false if no following node was found
// (indicating that the new node should be appended to the end of the
// parent's children)
//
//==========================================================================
bool XMLConversionFactors::GetNodeAfterAlphabetically(const wxString &name,
wxXmlNode *parent, wxXmlNode *&nodeAfterChild) const
{
bool hasChildren = false;
wxXmlNode *child = parent->GetChildren();
while (child)
{
hasChildren = true;
if (name.CmpNoCase(child->GetAttribute(nameAttr, wxEmptyString)) < 0)
{
nodeAfterChild = child;
return true;
}
child = child->GetNext();
}
if (!hasChildren)
{
nodeAfterChild = NULL;
return true;
}
return false;
}
示例7: CompareFiles
int CComparisonManager::CompareFiles(const int dirSortMode, const wxString& local, const wxString& remote, bool localDir, bool remoteDir)
{
switch (dirSortMode)
{
default:
if (localDir)
{
if (!remoteDir)
return -1;
}
else if (remoteDir)
return 1;
break;
case 2:
// Inline
break;
}
#ifdef __WXMSW__
return local.CmpNoCase(remote);
#else
return local.Cmp(remote);
#endif
return 0;
}
示例8: FindChannelAt
int FindChannelAt(int x, int y, const wxString& model)
{
//get list of models:
wxString buf;
for (auto it = xLightsFrame::PreviewModels.begin(); it != xLightsFrame::PreviewModels.end(); ++it)
{
if (!model.IsEmpty() && model.CmpNoCase((*it)->name)) continue; //don't check this model
// debug(1, "checking model '%s' ...", (const char*)(*it)->name.c_str());
// buf = xLightsFrame::PreviewModels[0]->ChannelLayoutHtml();
// if (buf.size() > 500) buf.resize(500);
// debug(1, "first 500 char of layout html = %s", (const char*)buf);
// wxString buf = (*it)->ChannelLayoutHtml();
// for (size_t n = (*it)->GetNodeCount(); n > 0; --n)
// {
// Nodes[nodenum]->Coords.size()
// }
// size_t CoordCount=GetCoordCount(n);
// for(size_t c=0; c < CoordCount; c++)
// {
// Nodes[n]->Coords[c].screenX = Nodes[n]->Coords[c].bufX - xoffset;
// Nodes[n]->Coords[c].screenY = Nodes[n]->Coords[c].bufY;
// }
int ch = (*it)->FindChannelAt(x, y);
if (ch != -1) return ch;
}
return -1; //pixel not found
}
示例9: wxT
void t4p::RunBrowserFeatureClass::ExternalBrowser(const wxString& browserName, const wxURI& url) {
wxFileName webBrowserPath;
bool found = App.PhpModule.Environment.FindBrowserByName(browserName, webBrowserPath);
if (!found || !webBrowserPath.IsOk()) {
t4p::EditorLogWarning(t4p::ERR_BAD_WEB_BROWSER_EXECUTABLE, webBrowserPath.GetFullPath());
return;
}
wxString cmd = wxT("\"") + webBrowserPath.GetFullPath() + wxT("\"");
wxPlatformInfo info;
if (info.GetOperatingSystemId() == wxOS_MAC_OSX_DARWIN && browserName.CmpNoCase(wxT("Safari")) == 0) {
// safari on Mac does not handle command line URL arguments
// need to use the "open" program
// see http://superuser.com/questions/459268/run-safari-from-command-line-with-url-parameter
cmd = wxT("open -a safari ");
}
cmd += wxT(" \"");
cmd += url.BuildURI();
cmd += wxT("\"");
// dont track this PID, let the browser stay open if the editor is closed.
// if we dont do pass the make group leader flag the browser thinks it crashed and will tell the user
// that the browser crashed.
long pid = wxExecute(cmd, wxEXEC_ASYNC | wxEXEC_MAKE_GROUP_LEADER);
if (pid <= 0) {
t4p::EditorLogWarning(t4p::ERR_BAD_WEB_BROWSER_EXECUTABLE, cmd);
}
}
示例10: equals
bool Identifier::equals(const wxString& rhs) const
{
if (needsQuoting(textM))
return (0 == rhs.Cmp(textM));
else
return (0 == rhs.CmpNoCase(textM));
}
示例11: Append
int wxVListBoxComboPopup::Append(const wxString& item)
{
int pos = (int)m_strings.GetCount();
if ( m_combo->GetWindowStyle() & wxCB_SORT )
{
// Find position
// TODO: Could be optimized with binary search
wxArrayString strings = m_strings;
unsigned int i;
for ( i=0; i<strings.GetCount(); i++ )
{
if ( item.CmpNoCase(strings.Item(i)) <= 0 )
{
pos = (int)i;
break;
}
}
}
Insert(item,pos);
return pos;
}
示例12: sortfunc
static bool sortfunc(const wxString& a, const wxString& b)
{
#ifdef __WXMSW__
return b.CmpNoCase(a) > 0;
#else
return b.Cmp(a) > 0;
#endif
}
示例13: FbCompare
int FbCompare(const wxString& text1, const wxString& text2)
{
#ifdef wxHAVE_TCHAR_SUPPORT
return wxStrcoll(text1, text2);
#else
return text1.CmpNoCase(text2);
#endif
}
示例14: VerifyChecksum
bool CUpdater::VerifyChecksum( wxString const& file, wxULongLong size, wxString const& checksum )
{
if( file.empty() || checksum.empty() ) {
return false;
}
wxLongLong filesize = CLocalFileSystem::GetSize(file);
if( filesize < 0 || static_cast<unsigned long long>(filesize.GetValue()) != size ) {
return false;
}
SHA512_State state;
SHA512_Init(&state);
{
wxLogNull null;
wxFile f;
if (!f.Open(file)) {
return false;
}
char buffer[65536];
ssize_t read;
while ((read = f.Read(buffer, sizeof(buffer))) > 0) {
SHA512_Bytes(&state, buffer, read);
}
if (read < 0) {
return false;
}
}
unsigned char raw_digest[64];
SHA512_Final(&state, raw_digest);
wxString digest;
for( unsigned int i = 0; i < sizeof(raw_digest); i++ ) {
unsigned char l = raw_digest[i] >> 4;
unsigned char r = raw_digest[i] & 0x0F;
if (l > 9)
digest += 'a' + l - 10;
else
digest += '0' + l;
if (r > 9)
digest += 'a' + r - 10;
else
digest += '0' + r;
}
if (checksum.CmpNoCase(digest)) {
log_ += wxString::Format(_("Checksum mismatch on file %s\n"), file.c_str());
return false;
}
log_ += wxString::Format(_("Checksum match on file %s\n"), file.c_str());
return true;
}
示例15: GetSideIndex
int NoGuiSinglePlayerBattle::GetSideIndex( const wxString& name )
{
wxArrayString sides = usync().GetSides( m_host_mod.name );
for ( int i = 0; i < (int)sides.Count(); ++i ) {
if ( name.CmpNoCase( sides[i] ) == 0 )
return i;
}
return -1;
}