本文整理汇总了C++中wxStrcmp函数的典型用法代码示例。如果您正苦于以下问题:C++ wxStrcmp函数的具体用法?C++ wxStrcmp怎么用?C++ wxStrcmp使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxStrcmp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
bool Envelope::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
{
// Return unless it's the envelope tag.
if (wxStrcmp(tag, wxT("envelope")))
return false;
int numPoints = 0;
long nValue = -1;
while (*attrs) {
const wxChar *attr = *attrs++;
const wxChar *value = *attrs++;
if (!value)
break;
const wxString strValue = value;
if( !wxStrcmp(attr, wxT("numpoints")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
numPoints = nValue;
}
if (numPoints < 0)
return false;
WX_CLEAR_ARRAY(mEnv);
mEnv.Alloc(numPoints);
return true;
}
示例2: while
bool WaveClip::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
{
if (!wxStrcmp(tag, wxT("waveclip")))
{
double dblValue;
while (*attrs)
{
const wxChar *attr = *attrs++;
const wxChar *value = *attrs++;
if (!value)
break;
const wxString strValue = value;
if (!wxStrcmp(attr, wxT("offset")))
{
if (!XMLValueChecker::IsGoodString(strValue) ||
!Internat::CompatibleToDouble(strValue, &dblValue))
return false;
SetOffset(dblValue);
}
}
return true;
}
return false;
}
示例3: while
bool CommandManager::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
{
if (!wxStrcmp(tag, wxT("audacitykeyboard"))) {
mXMLKeysRead = 0;
}
if (!wxStrcmp(tag, wxT("command"))) {
wxString name;
wxString key;
while(*attrs) {
const wxChar *attr = *attrs++;
const wxChar *value = *attrs++;
if (!value)
break;
if (!wxStrcmp(attr, wxT("name")) && XMLValueChecker::IsGoodString(value))
name = value;
if (!wxStrcmp(attr, wxT("key")) && XMLValueChecker::IsGoodString(value))
key = KeyStringNormalize(value);
}
if (mCommandNameHash[name]) {
if (GetDefaultKeyFromName(name) != key) {
mCommandNameHash[name]->key = KeyStringNormalize(key);
mXMLKeysRead++;
}
}
}
return true;
}
示例4: VisitEnter
/// Visit an element.
virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute )
{
if (element.Value()!=0x0 && !wxStrcmp(element.Value(), "tr"))
{
if (!wxStrcmp(element.Attribute("bgcolor"), "#FFFFFF"))
{
// first num
const TiXmlElement *pChild = element.FirstChildElement();
if (pChild)
{
// child
pChild = pChild->NextSiblingElement();
wxString host = wxString(pChild->GetText(), wxConvUTF8);
// port
pChild = pChild->NextSiblingElement();
wxString port = wxString(pChild->GetText(), wxConvUTF8);
if (port.Len()>0 && wxAtoi(port)!=0) {
m_pProxyData = new CProxyData(host, port);
m_pArray->Add(m_pProxyData);
}
}
}
}
return true;
}
示例5: SortFunction
// Sorting function of the flat profile columns
int wxCALLBACK SortFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
{
CBProfilerExecDlg *dialog = (CBProfilerExecDlg*) sortData;
wxListCtrl *listCtrl = dialog->GetoutputFlatProfileArea();
int col = dialog->GetsortColumn();
long itemId1 = listCtrl->FindItem(-1, item1);
long itemId2 = listCtrl->FindItem(-1, item2);
wxListItem listItem1, listItem2;
listItem1.SetId(itemId1);
listItem1.SetColumn(col);
listItem1.SetMask(wxLIST_MASK_TEXT);
listCtrl->GetItem(listItem1);
listItem2.SetId(itemId2);
listItem2.SetColumn(col);
listItem2.SetMask(wxLIST_MASK_TEXT);
listCtrl->GetItem(listItem2);
// All the columns are composed with numbers except the last one
if (col == 6)
{
if (dialog->GetsortAscending())
return wxStrcmp(listItem1.GetText(), listItem2.GetText());
else
return wxStrcmp(listItem2.GetText(), listItem1.GetText());
}
else
{
double num1, num2;
double success = listItem1.GetText().ToDouble(&num1);
if (!success)
{
if (dialog->GetsortAscending()) return -1;
else return 1;
}
success = listItem2.GetText().ToDouble(&num2);
if (!success)
{
if (dialog->GetsortAscending()) return 1;
else return -1;
}
if (dialog->GetsortAscending())
{
if (num1 < num2) return -1;
else if (num1 > num2) return 1;
else return 0;
}
else
{
if (num1 > num2) return -1;
else if (num1 < num2) return 1;
else return 0;
}
}
}
示例6: wxT
bool OyunApp::OnInit()
{
// Play like a nice Linux application
for (int i = 1 ; i < argc ; i++)
{
if (!wxStrcmp(argv[i], wxT("--version")))
{
const wchar_t *version = wxT(STRINGIZE( OYUN_VERSION ));
const wxString verstring =
_("Oyun %ls\n"
"Copyright (C) 2004-2011 Charles Pence\n"
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n");
wxPrintf(verstring, version);
return false;
}
else if (!wxStrcmp(argv[i], wxT("--help")))
{
const wxString helpstring =
_("Usage: oyun [OPTION]...\n"
"Run an evolutionary game theory tournament.\n"
"\n"
" --test run the Oyun testing suite\n"
" --help display this help and exit\n"
" --version output version information and exit\n"
"\n"
"Report bugs to: <[email protected]>.\n"
"Oyun home page: <http://charlespence.net/oyun/>.\n");
wxPrintf(wxT("%s"), helpstring);
return false;
}
else
{
// Invalid command-line parameter
wxPrintf(_("oyun: unrecognized option `%ls'\n"
"Try `oyun --help' for more information.\n"), argv[i]);
return false;
}
}
// Seed the RNG
Random::Seed(time(NULL));
#ifdef __WXMAC__
// Create the common OS X menu bar if we need it
CreateMacMenuBar();
#endif
// Make the first wizard
CreateWizard();
return true;
}
示例7: while
bool Tags::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
{
if (wxStrcmp(tag, wxT("tags")) != 0)
return false;
// loop through attrs, which is a null-terminated list of
// attribute-value pairs
while(*attrs) {
const wxChar *attr = *attrs++;
const wxChar *value = *attrs++;
if (!value)
break;
if (!wxStrcmp(attr, wxT("title")))
mTitle = value;
else if (!wxStrcmp(attr, wxT("artist")))
mArtist = value;
else if (!wxStrcmp(attr, wxT("album")))
mAlbum = value;
else if (!wxStrcmp(attr, wxT("track")))
mTrackNum = wxAtoi(value);
else if (!wxStrcmp(attr, wxT("year")))
mYear = value;
else if (!wxStrcmp(attr, wxT("genre")))
mGenre = wxAtoi(value);
else if (!wxStrcmp(attr, wxT("comments")))
mComments = value;
else if (!wxStrcmp(attr, wxT("id3v2")))
mID3V2 = wxAtoi(value)?true:false;
} // while
return true;
}
示例8: if
XMLTagHandler *FFmpegPresets::HandleXMLChild(const wxChar *tag)
{
if (!wxStrcmp(tag, wxT("preset")))
{
return this;
}
else if (!wxStrcmp(tag, wxT("setctrlstate")))
{
return this;
}
return NULL;
}
示例9:
XMLTagHandler *Tags::HandleXMLChild(const wxChar *tag)
{
if (wxStrcmp(tag, wxT("tags")) == 0) {
return this;
}
if (wxStrcmp(tag, wxT("tag")) == 0) {
return this;
}
return NULL;
}
示例10: while
bool NoteTrack::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
{
if (!wxStrcmp(tag, wxT("notetrack"))) {
while (*attrs) {
const wxChar *attr = *attrs++;
const wxChar *value = *attrs++;
if (!value)
break;
const wxString strValue = value;
long nValue;
double dblValue;
if (!wxStrcmp(attr, wxT("name")) && XMLValueChecker::IsGoodString(strValue))
mName = strValue;
else if (!wxStrcmp(attr, wxT("offset")) &&
XMLValueChecker::IsGoodString(strValue) &&
Internat::CompatibleToDouble(strValue, &dblValue))
SetOffset(dblValue);
else if (!wxStrcmp(attr, wxT("visiblechannels"))) {
if (!XMLValueChecker::IsGoodInt(strValue) ||
!strValue.ToLong(&nValue) ||
!XMLValueChecker::IsValidVisibleChannels(nValue))
return false;
mVisibleChannels = nValue;
}
else if (!wxStrcmp(attr, wxT("height")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
mHeight = nValue;
else if (!wxStrcmp(attr, wxT("minimized")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
mMinimized = (nValue != 0);
else if (!wxStrcmp(attr, wxT("isSelected")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
this->SetSelected(nValue != 0);
#ifdef EXPERIMENTAL_MIDI_OUT
else if (!wxStrcmp(attr, wxT("velocity")) &&
XMLValueChecker::IsGoodString(strValue) &&
Internat::CompatibleToDouble(strValue, &dblValue))
mGain = (float) dblValue;
#endif
else if (!wxStrcmp(attr, wxT("bottomnote")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
SetBottomNote(nValue);
else if (!wxStrcmp(attr, wxT("data"))) {
std::string s(strValue.mb_str(wxConvUTF8));
std::istringstream data(s);
mSeq = new Alg_seq(data, false);
}
} // while
return true;
}
return false;
}
示例11:
XMLTagHandler *TimeTrack::HandleXMLChild(const wxChar *tag)
{
if (!wxStrcmp(tag, wxT("envelope")))
return mEnvelope;
return NULL;
}
示例12: wxASSERT
void* wxHashTableBase::DoDelete( const wxChar* key, long hash )
{
wxASSERT( m_keyType == wxKEY_STRING );
size_t bucket = size_t(hash) % m_size;
if( m_table[bucket] == NULL )
return NULL;
Node *first = m_table[bucket]->GetNext(),
*curr = first,
*prev = m_table[bucket];
do
{
if( wxStrcmp( curr->m_key.string, key ) == 0 )
{
void* retval = curr->m_value;
curr->m_value = NULL;
DoUnlinkNode( bucket, curr, prev );
delete curr;
return retval;
}
prev = curr;
curr = curr->GetNext();
}
while( curr != first );
return NULL;
}
示例13: AddPointAtEnd
XMLTagHandler *Envelope::HandleXMLChild(const wxChar *tag)
{
if (wxStrcmp(tag, wxT("controlpoint")))
return NULL;
return AddPointAtEnd(0,0);
}
示例14: while
// use binary search because the array is sorted
ConfigEntry *
ConfigGroup::FindEntry(const wxChar *szName) const
{
size_t i,
lo = 0,
hi = m_aEntries.Count();
int res;
ConfigEntry *pEntry;
while ( lo < hi ) {
i = (lo + hi)/2;
pEntry = m_aEntries[i];
#if wxCONFIG_CASE_SENSITIVE
res = wxStrcmp(pEntry->Name(), szName);
#else
res = wxStricmp(pEntry->Name(), szName);
#endif
if ( res > 0 )
hi = i;
else if ( res < 0 )
lo = i + 1;
else
return pEntry;
}
return NULL;
}
示例15: XmOptionButtonGadget
int wxChoice::GetSelection() const
{
XmString text;
Widget label = XmOptionButtonGadget ((Widget) m_buttonWidget);
XtVaGetValues (label,
XmNlabelString, &text,
NULL);
wxXmString freeMe(text);
wxString s = wxXmStringToString( text );
if (!s.empty())
{
int i = 0;
for (wxStringList::compatibility_iterator node = m_stringList.GetFirst ();
node; node = node->GetNext ())
{
if (wxStrcmp(node->GetData(), s.c_str()) == 0)
{
return i;
}
else
i++;
} // for()
return -1;
}
return -1;
}