X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4a11340a1c93bb8466ac097ba15a756275067b6a..8ef9a526cea6ecc3853f327a76da14561b36f82a:/src/common/object.cpp?ds=sidebyside diff --git a/src/common/object.cpp b/src/common/object.cpp index 0289fc2ec6..247c365f66 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -21,6 +21,7 @@ #include "wx/object.h" #include "wx/hash.h" #include "wx/memory.h" + #include "wx/crt.h" #endif #include @@ -187,7 +188,7 @@ wxClassInfo::~wxClassInfo() Unregister(); } -wxClassInfo *wxClassInfo::FindClass(const wxChar *className) +wxClassInfo *wxClassInfo::FindClass(const wxString& className) { if ( sm_classTable ) { @@ -197,7 +198,7 @@ wxClassInfo *wxClassInfo::FindClass(const wxChar *className) { for ( wxClassInfo *info = sm_first; info ; info = info->m_next ) { - if ( wxStrcmp(info->GetClassName(), className) == 0 ) + if ( className == info->GetClassName() ) return info; } @@ -263,7 +264,7 @@ void wxClassInfo::Unregister() } } -wxObject *wxCreateDynamicObject(const wxChar *name) +wxObject *wxCreateDynamicObject(const wxString& name) { #if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT DEBUG_PRINTF(wxObject *wxCreateDynamicObject) @@ -288,6 +289,37 @@ wxObject *wxCreateDynamicObject(const wxChar *name) } } +// iterator interface +wxClassInfo::const_iterator::value_type +wxClassInfo::const_iterator::operator*() const +{ + return (wxClassInfo*)m_node->GetData(); +} + +wxClassInfo::const_iterator& wxClassInfo::const_iterator::operator++() +{ + m_node = m_table->Next(); + return *this; +} + +const wxClassInfo::const_iterator wxClassInfo::const_iterator::operator++(int) +{ + wxClassInfo::const_iterator tmp = *this; + m_node = m_table->Next(); + return tmp; +} + +wxClassInfo::const_iterator wxClassInfo::begin_classinfo() +{ + sm_classTable->BeginFind(); + + return const_iterator(sm_classTable->Next(), sm_classTable); +} + +wxClassInfo::const_iterator wxClassInfo::end_classinfo() +{ + return const_iterator(NULL, NULL); +} // ---------------------------------------------------------------------------- // wxObjectRefData