3 CLASS(DataSource, Object)
4 entity DataSource_true;
5 entity DataSource_false;
6 INIT_STATIC(DataSource) {
7 DataSource_true = NEW(Object);
8 DataSource_false = NULL;
11 * get entry `i` passing `name` and `icon` through `returns` if it is not null
12 * returns `DataSource_false` if out of bounds
13 * otherwise returns an entity or `DataSource_true`
15 METHOD(DataSource, getEntry, entity(int i, void(string name, string icon) returns)) { return DataSource_false; }
16 /** return the index of the first match for `find`. optional */
17 METHOD(DataSource, indexOf, int(string find)) { return -1; }
18 /** reload all entries matching `filter` returning how many matches were found */
19 METHOD(DataSource, reload, int(string filter)) { return 0; }
20 /** cleanup on shutdown. optional */
21 METHOD(DataSource, destroy, void(entity)) { }