// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "variant.h"
#endif
IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject)
-wxVariant WXDLLEXPORT wxNullVariant;
+wxVariant WXDLLIMPEXP_BASE wxNullVariant;
/*
* wxVariantDataList
*/
-class WXDLLEXPORT wxVariantDataList: public wxVariantData
+class WXDLLIMPEXP_BASE wxVariantDataList: public wxVariantData
{
DECLARE_DYNAMIC_CLASS(wxVariantDataList)
public:
void wxVariantDataList::SetValue(const wxList& value)
{
Clear();
- wxNode* node = value.GetFirst();
+ wxList::compatibility_iterator node = value.GetFirst();
while (node)
{
wxVariant* var = (wxVariant*) node->GetData();
void wxVariantDataList::Clear()
{
- wxNode* node = m_value.GetFirst();
+ wxList::compatibility_iterator node = m_value.GetFirst();
while (node)
{
wxVariant* var = (wxVariant*) node->GetData();
wxVariantDataList& listData = (wxVariantDataList&) data;
listData.Clear();
- wxNode* node = m_value.GetFirst();
+ wxList::compatibility_iterator node = m_value.GetFirst();
while (node)
{
wxVariant* var = (wxVariant*) node->GetData();
wxASSERT_MSG( (data.GetType() == wxT("list")), wxT("wxVariantDataList::Eq: argument mismatch") );
wxVariantDataList& listData = (wxVariantDataList&) data;
- wxNode* node1 = m_value.GetFirst();
- wxNode* node2 = listData.GetValue().GetFirst();
+ wxList::compatibility_iterator node1 = m_value.GetFirst();
+ wxList::compatibility_iterator node2 = listData.GetValue().GetFirst();
while (node1 && node2)
{
wxVariant* var1 = (wxVariant*) node1->GetData();
bool wxVariantDataList::Write(wxString& str) const
{
str = wxT("");
- wxNode* node = m_value.GetFirst();
+ wxList::compatibility_iterator node = m_value.GetFirst();
while (node)
{
wxVariant* var = (wxVariant*) node->GetData();
* wxVariantDataStringList
*/
-class WXDLLEXPORT wxVariantDataStringList: public wxVariantData
+class WXDLLIMPEXP_BASE wxVariantDataStringList: public wxVariantData
{
DECLARE_DYNAMIC_CLASS(wxVariantDataStringList)
public:
wxASSERT_MSG( (data.GetType() == wxT("stringlist")), wxT("wxVariantDataStringList::Eq: argument mismatch") );
wxVariantDataStringList& listData = (wxVariantDataStringList&) data;
- wxStringList::Node *node1 = m_value.GetFirst();
- wxStringList::Node *node2 = listData.GetValue().GetFirst();
+ wxStringList::compatibility_iterator node1 = m_value.GetFirst();
+ wxStringList::compatibility_iterator node2 = listData.GetValue().GetFirst();
while (node1 && node2)
{
wxString str1 ( node1->GetData() );
bool wxVariantDataStringList::Write(wxString& str) const
{
str.Empty();
- wxStringList::Node *node = m_value.GetFirst();
+ wxStringList::compatibility_iterator node = m_value.GetFirst();
while (node)
{
- wxChar* s = node->GetData();
+ const wxChar* s = node->GetData();
if (node != m_value.GetFirst())
str += wxT(" ");
str += s;
* wxVariantDataLong
*/
-class WXDLLEXPORT wxVariantDataLong: public wxVariantData
+class WXDLLIMPEXP_BASE wxVariantDataLong: public wxVariantData
{
DECLARE_DYNAMIC_CLASS(wxVariantDataLong)
public:
* wxVariantDataReal
*/
-class WXDLLEXPORT wxVariantDataReal: public wxVariantData
+class WXDLLIMPEXP_BASE wxVariantDataReal: public wxVariantData
{
DECLARE_DYNAMIC_CLASS(wxVariantDataReal)
public:
* wxVariantDataBool
*/
-class WXDLLEXPORT wxVariantDataBool: public wxVariantData
+class WXDLLIMPEXP_BASE wxVariantDataBool: public wxVariantData
{
DECLARE_DYNAMIC_CLASS(wxVariantDataBool)
public:
* wxVariantDataChar
*/
-class WXDLLEXPORT wxVariantDataChar: public wxVariantData
+class WXDLLIMPEXP_BASE wxVariantDataChar: public wxVariantData
{
DECLARE_DYNAMIC_CLASS(wxVariantDataChar)
public:
* wxVariantDataString
*/
-#if defined(__BORLANDC__) && defined(__WIN16__)
-// Change name because of truncation
-#define wxVariantDataString wxVariantStringData
-#endif
-
-class WXDLLEXPORT wxVariantDataString: public wxVariantData
+class WXDLLIMPEXP_BASE wxVariantDataString: public wxVariantData
{
-#if defined(__BORLANDC__) && defined(__WIN16__)
-DECLARE_DYNAMIC_CLASS(wxVariantStringData)
-#else
DECLARE_DYNAMIC_CLASS(wxVariantDataString)
-#endif
public:
wxVariantDataString() { }
wxVariantDataString(const wxString& value) { m_value = value; }
return TRUE;
}
-#if defined(__BORLANDC__) && defined(__WIN16__)
-IMPLEMENT_DYNAMIC_CLASS(wxVariantStringData, wxVariantData)
-#else
IMPLEMENT_DYNAMIC_CLASS(wxVariantDataString, wxVariantData)
-#endif
/*
* wxVariantDataVoidPtr
bool wxVariantDataWxObjectPtr::Write(wxString& str) const
{
- str.Printf(wxT("%s(%ld)"), GetType().mb_str() ,(long) m_value);
+ str.Printf(wxT("%s(%ld)"), GetType().c_str(), (long) m_value);
return TRUE;
}
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
wxASSERT_MSG( (idx < (size_t) data->GetValue().GetCount()), wxT("Invalid index for array") );
- wxVariant variant( wxString( (wxChar*) (data->GetValue().Item(idx)->GetData()) ));
+ wxVariant variant( wxString( (const wxChar*) (data->GetValue().Item(idx)->GetData()) ));
return variant;
}
return wxNullVariant;
{
wxList& list = GetList();
- wxNode* node = list.GetFirst();
+ wxList::compatibility_iterator node = list.GetFirst();
while (node)
{
wxVariant* other = (wxVariant*) node->GetData();
wxList& list = GetList();
wxASSERT_MSG( (item < (int) list.GetCount()), wxT("Invalid index to Delete") );
- wxNode* node = list.Item(item);
+ wxList::compatibility_iterator node = list.Item(item);
wxVariant* variant = (wxVariant*) node->GetData();
delete variant;
- delete node;
+ list.Erase(node);
return TRUE;
}
{
wxString val(((wxVariantDataString*)GetData())->GetValue());
val.MakeLower();
- if (val == wxT("TRUE") || val == wxT("yes"))
+ if (val == wxT("true") || val == wxT("yes"))
*value = TRUE;
- else if (val == wxT("FALSE") || val == wxT("no"))
+ else if (val == wxT("false") || val == wxT("no"))
*value = FALSE;
else
return FALSE;