Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
StringSource Class Reference
Inheritance diagram for StringSource:
Collaboration diagram for StringSource:

Public Member Functions

 StringSource (string str, string sep)
 ATTRIB (StringSource, StringSource_sep, string)
 ATTRIB (StringSource, StringSource_str, string)
virtual void destroy ()
 cleanup on shutdown.
virtual void getEntry ()
 get entry i passing name and icon through returns if it is not null returns DataSource_false if out of bounds otherwise returns an entity or DataSource_true
virtual void indexOf ()
 return the index of the first match for find.
virtual void reload ()
 reload all entries matching filter returning how many matches were found

Static Public Attributes

static entity false = NULL
static entity true = NEW(Object)

Detailed Description

Definition at line 21 of file datasource.qh.

Constructor & Destructor Documentation

◆ StringSource()

StringSource::StringSource ( string str,
string sep )

Definition at line 3 of file datasource.qc.

4 {
6 this.StringSource_str = str;
7 this.StringSource_sep = sep;
8 }
StringSource(string str, string sep)
Definition datasource.qc:3
#define CONSTRUCT(cname,...)
Definition oo.qh:123

References StringSource(), and CONSTRUCT.

Referenced by StringSource(), ATTRIB(), ATTRIB(), getEntry(), and reload().

Member Function Documentation

◆ ATTRIB() [1/2]

StringSource::ATTRIB ( StringSource ,
StringSource_sep ,
string  )

◆ ATTRIB() [2/2]

StringSource::ATTRIB ( StringSource ,
StringSource_str ,
string  )

References StringSource(), and ATTRIB().

Referenced by ATTRIB(), and ATTRIB().

◆ destroy()

virtual void DataSource::destroy ( )
inlinevirtualinherited

cleanup on shutdown.

optional

Definition at line 17 of file datasource.qh.

17{ }

References destroy(), and entity().

Referenced by destroy().

◆ getEntry()

void StringSource::getEntry ( )
virtual

get entry i passing name and icon through returns if it is not null returns DataSource_false if out of bounds otherwise returns an entity or DataSource_true

Reimplemented from DataSource.

Reimplemented in CvarStringSource.

Definition at line 9 of file datasource.qc.

10 {
11 int n = tokenizebyseparator(this.StringSource_str, this.StringSource_sep);
12 if (i < 0 || i >= n) return DataSource_false;
13 string s = argv(i);
14 if (returns) returns(s, string_null);
15 return DataSource_true;
16 }
#define tokenizebyseparator
string argv(float n)
string string_null
Definition nil.qh:9

References StringSource(), argv(), entity(), getEntry(), name, string_null, and tokenizebyseparator.

Referenced by ATTRIB(), and getEntry().

◆ indexOf()

virtual void DataSource::indexOf ( )
inlinevirtualinherited

return the index of the first match for find.

optional

Definition at line 13 of file datasource.qh.

13{ return -1; }

References entity(), find(), and indexOf().

Referenced by indexOf().

◆ reload()

void StringSource::reload ( )
virtual

reload all entries matching filter returning how many matches were found

Reimplemented from DataSource.

Reimplemented in CvarStringSource.

Definition at line 17 of file datasource.qc.

18 {
19 return tokenizebyseparator(this.StringSource_str, this.StringSource_sep);
20 }

References StringSource(), entity(), reload(), and tokenizebyseparator.

Referenced by ATTRIB(), and reload().

Member Data Documentation

◆ false

entity DataSource::false = NULL
staticinherited

Definition at line 5 of file datasource.qh.

◆ true

entity DataSource::true = NEW(Object)
staticinherited

Definition at line 4 of file datasource.qh.


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