X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/903506828b7d042350eae97b5014a63ffca17ef5..66f8b9ace213e02e184460e0c1a212cacea27edd:/src/common/wxexpr.cpp diff --git a/src/common/wxexpr.cpp b/src/common/wxexpr.cpp index 01784063b2..70fb548e14 100644 --- a/src/common/wxexpr.cpp +++ b/src/common/wxexpr.cpp @@ -5,8 +5,8 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_PROLOGIO + #include #include #include @@ -194,12 +196,12 @@ wxExpr::wxExpr(wxList *the_list) wxExpr *listExpr = new wxExpr(wxExprList); - wxNode *node = the_list->First(); + wxNode *node = the_list->GetFirst(); while (node) { - wxExpr *expr = (wxExpr *)node->Data(); + wxExpr *expr = (wxExpr *)node->GetData(); listExpr->Append(expr); - node = node->Next(); + node = node->GetNext(); } Append(listExpr); @@ -603,13 +605,13 @@ void wxExpr::AddAttributeValueStringList(const wxString& attribute, wxList *stri // First make a list of wxExpr strings wxExpr *listExpr = new wxExpr(wxExprList); - wxNode *node = string_list->First(); + wxNode *node = string_list->GetFirst(); while (node) { - char *string = (char *)node->Data(); + wxChar *string = (wxChar*)node->GetData(); wxExpr *expr = new wxExpr(wxExprString, wxString(string)); listExpr->Append(expr); - node = node->Next(); + node = node->GetNext(); } // Now make an (=, Att, Value) triple @@ -905,7 +907,7 @@ wxExprDatabase::~wxExprDatabase(void) void wxExprDatabase::BeginFind(void) // Initialise a search { - position = First(); + position = GetFirst(); } wxExpr *wxExprDatabase::FindClause(long id) // Find a term based on an integer id attribute @@ -914,15 +916,15 @@ wxExpr *wxExprDatabase::FindClause(long id) // Find a term based on an integer wxExpr *found = NULL; while (position && !found) { - wxExpr *term = (wxExpr *)position->Data(); + wxExpr *term = (wxExpr *)position->GetData(); if (term->Type() == wxExprList) { - wxExpr *value = term->AttributeValue("id"); + wxExpr *value = term->AttributeValue(wxT("id")); if (value->Type() == wxExprInteger && value->IntegerValue() == id) found = term; } - position = position->Next(); + position = position->GetNext(); } return found; } @@ -933,7 +935,7 @@ wxExpr *wxExprDatabase::FindClause(const wxString& word, const wxString& val) wxExpr *found = NULL; while (position && !found) { - wxExpr *term = (wxExpr *)position->Data(); + wxExpr *term = (wxExpr *)position->GetData(); if (term->Type() == wxExprList) { @@ -942,7 +944,7 @@ wxExpr *wxExprDatabase::FindClause(const wxString& word, const wxString& val) (value->Type() == wxExprString && value->StringValue() == val)) found = term; } - position = position->Next(); + position = position->GetNext(); } return found; } @@ -952,7 +954,7 @@ wxExpr *wxExprDatabase::FindClause(const wxString& word, long val) wxExpr *found = NULL; while (position && !found) { - wxExpr *term = (wxExpr *)position->Data(); + wxExpr *term = (wxExpr *)position->GetData(); if (term->Type() == wxExprList) { @@ -960,7 +962,7 @@ wxExpr *wxExprDatabase::FindClause(const wxString& word, long val) if ((value->Type() == wxExprInteger) && (value->IntegerValue() == val)) found = term; } - position = position->Next(); + position = position->GetNext(); } return found; } @@ -970,7 +972,7 @@ wxExpr *wxExprDatabase::FindClause(const wxString& word, double val) wxExpr *found = NULL; while (position && !found) { - wxExpr *term = (wxExpr *)position->Data(); + wxExpr *term = (wxExpr *)position->GetData(); if (term->Type() == wxExprList) { @@ -978,7 +980,7 @@ wxExpr *wxExprDatabase::FindClause(const wxString& word, double val) if ((value->Type() == wxExprReal) && (value->RealValue() == val)) found = term; } - position = position->Next(); + position = position->GetNext(); } return found; } @@ -988,14 +990,14 @@ wxExpr *wxExprDatabase::FindClauseByFunctor(const wxString& functor) wxExpr *found = NULL; while (position && !found) { - wxExpr *term = (wxExpr *)position->Data(); + wxExpr *term = (wxExpr *)position->GetData(); if (term->Type() == wxExprList) { if (term->Functor() == functor) found = term; } - position = position->Next(); + position = position->GetNext(); } return found; } @@ -1046,13 +1048,13 @@ wxExpr *wxExprDatabase::HashFind(const wxString& functor, const wxString& value) void wxExprDatabase::ClearDatabase(void) { noErrors = 0; - wxNode *node = First(); + wxNode *node = GetFirst(); while (node) { - wxExpr *expr = (wxExpr *)node->Data(); + wxExpr *expr = (wxExpr *)node->GetData(); delete expr; delete node; - node = First(); + node = GetFirst(); } if (hash_table) @@ -1108,12 +1110,12 @@ bool wxExprDatabase::Write(const wxString& fileName) bool wxExprDatabase::Write(FILE *stream) { noErrors = 0; - wxNode *node = First(); + wxNode *node = GetFirst(); while (node) { - wxExpr *expr = (wxExpr *)node->Data(); + wxExpr *expr = (wxExpr *)node->GetData(); expr->WriteClause(stream); - node = node->Next(); + node = node->GetNext(); } return (noErrors == 0); } @@ -1194,7 +1196,7 @@ char *wxmake_exp2(char *str1, char *str2, char *str3) char *wxmake_word(char *str) { - wxExpr *x = new wxExpr(wxExprWord, str); + wxExpr *x = new wxExpr(wxExprWord, wxString(str, wxConvLibc).c_str()); return (char *)x; } @@ -1272,3 +1274,5 @@ WXDLLEXPORT char *strdup(const char *s) #endif #endif +#endif + // wxUSE_PROLOGIO