#include "wx/string.h"
#include "wx/dynarray.h"
#include "wx/datetime.h"
-#include "wx/list.h"
#include "wx/gdicmn.h"
#include "wx/filesys.h"
#include "wx/bitmap.h"
wxXmlResourceDataRecords,
WXDLLIMPEXP_XRC);
+WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxXmlResourceHandler*,
+ wxXmlResourceHandlers,
+ class WXDLLIMPEXP_XRC);
+
enum wxXmlResourceFlags
{
wxXRC_USE_LOCALE = 1,
long m_version;
int m_flags;
- wxList m_handlers;
+ wxXmlResourceHandlers m_handlers;
wxXmlResourceDataRecords m_data;
#if wxUSE_FILESYSTEM
wxFileSystem m_curFileSystem;
void wxXmlResource::AddHandler(wxXmlResourceHandler *handler)
{
- m_handlers.Append(handler);
+ m_handlers.Add(handler);
handler->SetParentResource(this);
}
void wxXmlResource::InsertHandler(wxXmlResourceHandler *handler)
{
- m_handlers.Insert(handler);
+ m_handlers.Insert(handler, 0);
handler->SetParentResource(this);
}
void wxXmlResource::ClearHandlers()
{
- WX_CLEAR_LIST(wxList, m_handlers);
+ WX_CLEAR_ARRAY(m_handlers);
}
return CreateResFromNode(©, parent, instance);
}
- wxXmlResourceHandler *handler;
-
if (handlerToUse)
{
if (handlerToUse->CanHandle(node))
- {
return handlerToUse->CreateResource(node, parent, instance);
- }
}
else if (node->GetName() == wxT("object"))
{
- wxList::compatibility_iterator ND = m_handlers.GetFirst();
- while (ND)
+ for ( wxXmlResourceHandlers::iterator i = m_handlers.begin();
+ i != m_handlers.end(); ++i )
{
- handler = (wxXmlResourceHandler*)ND->GetData();
+ wxXmlResourceHandler *handler = *i;
if (handler->CanHandle(node))
- {
return handler->CreateResource(node, parent, instance);
- }
- ND = ND->GetNext();
}
}