libsaria: Give Lists a size()
Return the "count" variable and hope we don't have more than MAX_UNSIGNED_INT objects in the list... Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
bf0e340a53
commit
311e404af9
|
@ -35,6 +35,7 @@ namespace libsaria
|
|||
|
||||
ListItem<T> *push_back(T);
|
||||
void erase(ListItem<T> *);
|
||||
unsigned int size();
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@ static void do_save_path(ofstream &stream, void *data)
|
|||
stream << 2 << "\n"; /* Save file version: 2 */
|
||||
stream << path->path << "\n";
|
||||
stream << path->id << " " << path->visible << " ";
|
||||
stream << path->next_track << " " << path->tracks.size() << "\n";
|
||||
stream << path->next_track << " " << path->_tracks.size() << "\n";
|
||||
|
||||
for (it = path->tracks.begin(); it != path->tracks.end(); it++)
|
||||
(*it).save(stream);
|
||||
|
|
|
@ -63,6 +63,12 @@ namespace libsaria
|
|||
delete node;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
unsigned int List<T>::size()
|
||||
{
|
||||
return count;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif /* LIBSARIA_LIST_CPP */
|
||||
|
|
Loading…
Reference in New Issue