home *** CD-ROM | disk | FTP | other *** search
- #include "sortlist.h"
-
- int sorted_index::find(sortable &arg)
- {
- rewind();
- while (data != NULL && *value() < arg)
- (*this)++;
- return data != NULL;
- }
-
- void sorted_list::put(containable *arg)
- {
- sorted_index i(*this);
-
- i.find(*(sortable *)arg);
- if (i == 0)
- i.to_end();
- else
- i--;
- i.put(arg);
- }
-
- sortable *sorted_list::find(sortable &arg)
- {
- sorted_index i(*this);
- if (i.find(arg))
- return i.value();
- else
- return NULL;
- }
-
-