Back to index

plt-scheme  4.2.1
Public Member Functions | Public Attributes
wxStringList Class Reference

#include <wx_list.h>

Inheritance diagram for wxStringList:
Inheritance graph
[legend]
Collaboration diagram for wxStringList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxStringList (void)
 ~wxStringList (void)
wxNodeAdd (const char *s)
void Delete (const char *s)
char ** ListToArray (Bool new_copies=FALSE)
Bool Member (const char *s)
int Number (void)
wxNodeAppend (wxObject *object)
wxNodeAppend (long key, wxObject *object)
wxNodeAppend (const char *key, wxObject *object)
wxNodeAppend (void *key, wxObject *object)
wxNodeInsert (wxObject *object)
wxNodeInsert (wxNode *position, wxObject *object)
Bool DeleteNode (wxNode *node)
Bool DeleteObject (wxObject *object)
void Clear (void)
wxNodeFirst (void)
wxNodeLast (void)
wxNodeNth (int i)
wxNodeFind (long key)
wxNodeFind (const char *key)
wxNodeFindPtr (void *key)
wxNodeMember (wxObject *object)
void DeleteContents (int destroy)
void install_cleanup ()
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
voidoperator new (size_t size, void *p)
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
void operator delete (void *obj)
void operator delete (void *, void *)
void operator delete (void *obj)
voidoperator new[] (size_t size)
voidoperator new[] (size_t size, GCPlacement gcp)
voidoperator new[] (size_t size, void *p)
void operator delete[] (void *obj)
void operator delete[] (void *, void *)

Public Attributes

int n
int destroy_data
wxNodefirst_node
wxNodelast_node
unsigned int key_type
WXTYPE __type
void__gc_external

Detailed Description

Definition at line 149 of file wx_list.h.


Constructor & Destructor Documentation

Definition at line 398 of file wb_list.cxx.

                               :
#ifdef wx_mac
 wxList(kNoDestroyData, FALSE)
#else
 wxList ()
#endif
{
  __type = wxTYPE_STRING_LIST;
}

Definition at line 422 of file wb_list.cxx.

{
  wxNode *each, *next;

  each = first_node;
  while (each) {
    next = each->Next();
    DELETE_OBJ each;
    each = next;
  }
}

Here is the call graph for this function:


Member Function Documentation

wxNode * wxStringList::Add ( const char *  s)

Definition at line 434 of file wb_list.cxx.

{
  s = copystring(s);
  return Append ((wxObject *)s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

wxNode * wxList::Append ( wxObject object) [inherited]

Definition at line 269 of file wb_list.cxx.

{
  wxNode *node;
  node = new WXGC_PTRS wxNode(last_node, NULL, object);
  return DoAppend(node);
}

Here is the call graph for this function:

Here is the caller graph for this function:

wxNode * wxList::Append ( long  key,
wxObject object 
) [inherited]

Definition at line 314 of file wb_list.cxx.

{
  wxNode *node;
  node = new WXGC_PTRS wxNode(last_node, NULL, object, key);
  return DoAppend(node);
}

Here is the call graph for this function:

wxNode * wxList::Append ( const char *  key,
wxObject object 
) [inherited]

Definition at line 321 of file wb_list.cxx.

{
  wxNode *node;
  node = new WXGC_PTRS wxNode(last_node, NULL, object, key);
  return DoAppend(node);
}

Here is the call graph for this function:

wxNode * wxList::Append ( void key,
wxObject object 
) [inherited]

Definition at line 328 of file wb_list.cxx.

{
  wxNode *node;
  node = new WXGC_PTRS wxNode(last_node, NULL, object, key);
  return DoAppend(node);
}

Here is the call graph for this function:

void wxList::Clear ( void  ) [inherited]

Definition at line 344 of file wb_list.cxx.

{
  wxNode *current, *next;

  current = first_node;
  while (current) {
    next = current->Next();
    DELETE_OBJ current;
    current = next;
  }
  first_node = NULL;
  last_node = NULL;
  n = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 440 of file wb_list.cxx.

{
  wxNode * node;
  for (node = First (); node; node = node->Next ()) {
    char *string;
    string = (char *) node->Data ();
    if (string == s || strcmp (string, s) == 0) {
      DELETE_OBJ node;
      break;         // Done!
    }
  }
}

Here is the call graph for this function:

void wxList::DeleteContents ( int  destroy) [inline, inherited]

Definition at line 135 of file wx_list.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Bool wxList::DeleteNode ( wxNode node) [inherited]

Definition at line 244 of file wb_list.cxx.

{
  if (node) {
    node->Kill(this);
    DELETE_OBJ node;
    return TRUE;
  }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool wxList::DeleteObject ( wxObject object) [inherited]

Definition at line 254 of file wb_list.cxx.

{
  wxNode * current;
  // Search list for object
  for (current = first_node; current; current = current->Next ()) {
    if (current->Data () == object) {
      current->Kill(this);
      DELETE_OBJ current;
      return TRUE;
    }
  }
  return FALSE;                    // Did not find the object
}

Here is the call graph for this function:

wxNode * wxList::Find ( long  key) [inherited]

Definition at line 188 of file wb_list.cxx.

{
  wxNode *current;
  current = First();
  while (current) {
    if (current->integer_key == key)
      return current;
    current = current->Next();
  }
    
  return NULL;                     // Not found!
}

Here is the call graph for this function:

Here is the caller graph for this function:

wxNode * wxList::Find ( const char *  key) [inherited]

Definition at line 201 of file wb_list.cxx.

{
  wxNode *current;
  current = First();
  while (current) {
    if (!current->string_key) {
      wxFatalError ("wxList: string key not present, probably did not Append correctly!");
      break;
    }
    if (strcmp (current->string_key, key) == 0)
      return current;
    current = current->Next();
  }

  return NULL;                     // Not found!

}

Here is the call graph for this function:

wxNode * wxList::FindPtr ( void key) [inherited]

Definition at line 219 of file wb_list.cxx.

{
  wxNode *current;
  current = First();
  while (current) {
    if ((void *)current->string_key == key)
      return current;
    current = current->Next();
  }
  
  return NULL;                     // Not found!
}

Here is the call graph for this function:

wxNode* wxList::First ( void  ) [inline, inherited]

Definition at line 124 of file wx_list.h.

{ return first_node; }

Here is the caller graph for this function:

wxNode * wxList::Insert ( wxObject object) [inherited]

Definition at line 277 of file wb_list.cxx.

{
  wxNode *node;

  node = First();
  node = new WXGC_PTRS wxNode(NULL, node, object);
  first_node = node;

  if (!(node->Next()))
    last_node = node;

  n++;
  return node;
}

Here is the call graph for this function:

wxNode * wxList::Insert ( wxNode position,
wxObject object 
) [inherited]

Definition at line 294 of file wb_list.cxx.

{
  wxNode *prev = NULL;
  wxNode *node;
  if (position)
    prev = position->Previous ();

  node = new WXGC_PTRS wxNode(prev, position, object);
  if (!first_node) {
      first_node = node;
      last_node = node;
  }
  if (!prev)
    first_node = node;

  n++;
  return node;
}

Here is the call graph for this function:

Definition at line 99 of file wxGC.cxx.

{
  GC_finalization_proc old_fn;
  void *old_data;

# ifdef MZ_PRECISE_GC
#  define ALLOW_NON_BASE 0
#  define CHECK_BASE 0
# else
#  ifdef wx_xt
#   define ALLOW_NON_BASE 0
#   define CHECK_BASE 0
#  else
#   ifdef WIN32
#    define ALLOW_NON_BASE 0
#    define CHECK_BASE 1
#    define CRASH_ON_NONBASE 1
#   else
#    define ALLOW_NON_BASE 1
#    define CHECK_BASE 0
#   endif
#  endif
# endif

# if CHECK_BASE || ALLOW_NON_BASE
  if (GC_base(this) != (void *)this) {
#  if ALLOW_NON_BASE
    return;
#  else
#   ifdef CRASH_ON_NONBASE
    *(long *)0x0 = 1;
#   else
    printf("Clean-up object is not the base object\n");
    abort();
#   endif
#  endif
  }
# endif

  GC_register_finalizer_ignore_self(gcOBJ_TO_PTR(this), 
                                CAST_GCP GC_cleanup, NULL, 
                                CAST_GCPP &old_fn, &old_data);

# if CHECK_BASE
  if (old_fn) {
#  ifdef CRASH_ON_NONBASE
       *(long *)0x0 = 1;
#  else
    printf("Object already has a clean-up\n");
    abort();
#  endif
  }
# endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

wxNode* wxList::Last ( void  ) [inline, inherited]

Definition at line 125 of file wx_list.h.

{ return last_node; }
char ** wxStringList::ListToArray ( Bool  new_copies = FALSE)

Definition at line 454 of file wb_list.cxx.

{
  char **string_array;
  wxNode *node;
  int i, nbr;

  nbr = Number();
  string_array = new WXGC_PTRS char *[nbr];
  node = First ();
  for (i = 0; i < n; i++) {
    char *s;
    s = (char *) node->Data ();
    if (new_copies) {
      char *ss;
      ss = copystring(s);
      string_array[i] = ss;
    } else
      string_array[i] = s;
    node = node->Next();
  }
  return string_array;
}

Here is the call graph for this function:

Here is the caller graph for this function:

wxNode * wxList::Member ( wxObject object) [inherited]

Definition at line 232 of file wb_list.cxx.

{
  wxNode * current;
  for (current = First (); current; current = current->Next ()) {
    wxObject *each;
    each = current->Data ();
    if (each == object)
      return current;
  }
  return NULL;
}

Here is the call graph for this function:

Definition at line 478 of file wb_list.cxx.

{
  wxNode * node;
  for (node = First (); node; node = node->Next ()) {
    const char *s1;
    s1 = (const char *) node->Data ();
    if (s == s1 || strcmp (s, s1) == 0)
      return TRUE;
  }

  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

wxNode * wxList::Nth ( int  i) [inherited]

Definition at line 176 of file wb_list.cxx.

{
  int j = 0;
  wxNode * current;
  for (current = First (); current; current = current->Next ()) {
    if (j++ == i)
      return current;
  }
  return NULL;                     // No such element

}

Here is the call graph for this function:

int wxList::Number ( void  ) [inline, inherited]

Definition at line 97 of file wx_list.h.

{ return n; }

Here is the caller graph for this function:

void gc::operator delete ( void obj) [inline, inherited]
void gc::operator delete ( void obj) [inline, inherited]

Definition at line 287 of file gc_cpp.h.

                                           {
    GC_FREE( obj );}

Here is the caller graph for this function:

void gc::operator delete ( void ,
void  
) [inline, inherited]

Definition at line 291 of file gc_cpp.h.

{}
void gc::operator delete[] ( void obj) [inline, inherited]

Definition at line 305 of file gc_cpp.h.

                                             {
    gc::operator delete( obj );}

Here is the call graph for this function:

void gc::operator delete[] ( void ,
void  
) [inline, inherited]

Definition at line 309 of file gc_cpp.h.

{}
void* gc::operator new ( size_t  size) [inline, inherited]
void* gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]
void * gc::operator new ( size_t  size) [inline, inherited]

Definition at line 273 of file gc_cpp.h.

                                           {
    return GC_MALLOC( size );}

Here is the caller graph for this function:

void * gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 276 of file gc_cpp.h.

                                                            {
    if (gcp == UseGC) 
        return GC_MALLOC( size );
    else if (gcp == PointerFreeGC)
       return GC_MALLOC_ATOMIC( size );
    else
        return GC_MALLOC_UNCOLLECTABLE( size );}
void * gc::operator new ( size_t  size,
void p 
) [inline, inherited]

Definition at line 284 of file gc_cpp.h.

                                                    {
    return p;}
void * gc::operator new[] ( size_t  size) [inline, inherited]

Definition at line 296 of file gc_cpp.h.

                                             {
    return gc::operator new( size );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 299 of file gc_cpp.h.

                                                              {
    return gc::operator new( size, gcp );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
void p 
) [inline, inherited]

Definition at line 302 of file gc_cpp.h.

                                                      {
    return p;}

Member Data Documentation

Definition at line 146 of file wxGC.h.

WXTYPE wxObject::__type [inherited]

Definition at line 77 of file Object.h.

Definition at line 83 of file wx_list.h.

wxNode* wxList::first_node [inherited]

Definition at line 84 of file wx_list.h.

unsigned int wxList::key_type [inherited]

Definition at line 86 of file wx_list.h.

wxNode* wxList::last_node [inherited]

Definition at line 85 of file wx_list.h.

int wxList::n [inherited]

Definition at line 82 of file wx_list.h.


The documentation for this class was generated from the following files: