Panda3D
|
Represents the complete list of Distributed Class descriptions as read from a .dc file. More...
Public Member Functions | |
__init__ () | |
bool | allObjectsValid () |
Returns true if all of the classes read from the DC file were defined and valid, or false if any of them were undefined ("bogus classes"). If this is true, we might have read a partial file. More... | |
clear () | |
Removes all of the classes defined within the DCFile and prepares it for reading a new file. More... | |
DCClass | getClass (int n) |
Returns the nth class read from the .dc file(s). More... | |
DCClass | getClassByName (str name) |
Returns the class that has the indicated name, or NULL if there is no such class. More... | |
DCField | getFieldByIndex (int index_number) |
Returns a pointer to the one DCField that has the indicated index number, of all the DCFields across all classes in the file. More... | |
unsigned long int | getHash () |
Returns a 32-bit hash index associated with this file. This number is guaranteed to be consistent if the contents of the file have not changed, and it is very likely to be different if the contents of the file do change. More... | |
str | getImportModule (int n) |
Returns the module named by the nth import line read from the .dc file(s). More... | |
str | getImportSymbol (int n, int i) |
Returns the ith symbol named by the nth import line read from the .dc file(s). More... | |
const DCKeyword | getKeyword (int n) |
Returns the nth keyword read from the .dc file(s). More... | |
const DCKeyword | getKeywordByName (str name) |
Returns the keyword that has the indicated name, or NULL if there is no such keyword name. More... | |
int | getNumClasses () |
Returns the number of classes read from the .dc file(s). More... | |
int | getNumImportModules () |
Returns the number of import lines read from the .dc file(s). More... | |
int | getNumImportSymbols (int n) |
Returns the number of symbols explicitly imported by the nth import line. If this is 0, the line is "import modulename"; if it is more than 0, the line is "from modulename import symbol, symbol ... ". More... | |
int | getNumKeywords () |
Returns the number of keywords read from the .dc file(s). More... | |
int | getNumTypedefs () |
Returns the number of typedefs read from the .dc file(s). More... | |
DCSwitch | getSwitchByName (str name) |
Returns the switch that has the indicated name, or NULL if there is no such switch. More... | |
DCTypedef | getTypedef (int n) |
Returns the nth typedef read from the .dc file(s). More... | |
DCTypedef | getTypedefByName (str name) |
Returns the typedef that has the indicated name, or NULL if there is no such typedef name. More... | |
bool | read (Filename filename) |
Opens and reads the indicated .dc file by name. The distributed classes defined in the file will be appended to the set of distributed classes already recorded, if any. More... | |
bool | read (Istream in, str filename) |
Parses the already-opened input stream for distributed class descriptions. The filename parameter is optional and is only used when reporting errors. More... | |
bool | readAll () |
This special method reads all of the .dc files named by the "dc-file" config.prc variable, and loads them into the DCFile namespace. More... | |
bool | write (Filename filename, bool brief) |
Opens the indicated filename for output and writes a parseable description of all the known distributed classes to the file. More... | |
bool | write (Ostream out, bool brief) |
Writes a parseable description of all the known distributed classes to the stream. More... | |
Represents the complete list of Distributed Class descriptions as read from a .dc file.
__init__ | ( | ) |
bool allObjectsValid | ( | ) |
Returns true if all of the classes read from the DC file were defined and valid, or false if any of them were undefined ("bogus classes"). If this is true, we might have read a partial file.
clear | ( | ) |
Removes all of the classes defined within the DCFile and prepares it for reading a new file.
DCClass getClass | ( | int | n | ) |
Returns the nth class read from the .dc file(s).
DCClass getClassByName | ( | str | name | ) |
Returns the class that has the indicated name, or NULL if there is no such class.
DCField getFieldByIndex | ( | int | index_number | ) |
Returns a pointer to the one DCField that has the indicated index number, of all the DCFields across all classes in the file.
This method is only valid if dc-multiple-inheritance is set true in the Config.prc file. Without this setting, different DCFields may share the same index number, so this global lookup is not possible.
unsigned long int getHash | ( | ) |
Returns a 32-bit hash index associated with this file. This number is guaranteed to be consistent if the contents of the file have not changed, and it is very likely to be different if the contents of the file do change.
str getImportModule | ( | int | n | ) |
Returns the module named by the nth import line read from the .dc file(s).
str getImportSymbol | ( | int | n, |
int | i | ||
) |
Returns the ith symbol named by the nth import line read from the .dc file(s).
const DCKeyword getKeyword | ( | int | n | ) |
Returns the nth keyword read from the .dc file(s).
const DCKeyword getKeywordByName | ( | str | name | ) |
Returns the keyword that has the indicated name, or NULL if there is no such keyword name.
int getNumClasses | ( | ) |
Returns the number of classes read from the .dc file(s).
int getNumImportModules | ( | ) |
Returns the number of import lines read from the .dc file(s).
int getNumImportSymbols | ( | int | n | ) |
Returns the number of symbols explicitly imported by the nth import line. If this is 0, the line is "import modulename"; if it is more than 0, the line is "from modulename import symbol, symbol ... ".
int getNumKeywords | ( | ) |
Returns the number of keywords read from the .dc file(s).
int getNumTypedefs | ( | ) |
Returns the number of typedefs read from the .dc file(s).
DCSwitch getSwitchByName | ( | str | name | ) |
Returns the switch that has the indicated name, or NULL if there is no such switch.
DCTypedef getTypedef | ( | int | n | ) |
Returns the nth typedef read from the .dc file(s).
DCTypedef getTypedefByName | ( | str | name | ) |
Returns the typedef that has the indicated name, or NULL if there is no such typedef name.
bool read | ( | Filename | filename | ) |
Opens and reads the indicated .dc file by name. The distributed classes defined in the file will be appended to the set of distributed classes already recorded, if any.
Returns true if the file is successfully read, false if there was an error (in which case the file might have been partially read).
bool read | ( | Istream | in, |
str | filename | ||
) |
Parses the already-opened input stream for distributed class descriptions. The filename parameter is optional and is only used when reporting errors.
The distributed classes defined in the file will be appended to the set of distributed classes already recorded, if any.
Returns true if the file is successfully read, false if there was an error (in which case the file might have been partially read).
bool readAll | ( | ) |
This special method reads all of the .dc files named by the "dc-file" config.prc variable, and loads them into the DCFile namespace.
bool write | ( | Filename | filename, |
bool | brief | ||
) |
Opens the indicated filename for output and writes a parseable description of all the known distributed classes to the file.
Returns true if the description is successfully written, false otherwise.
bool write | ( | Ostream | out, |
bool | brief | ||
) |
Writes a parseable description of all the known distributed classes to the stream.
Returns true if the description is successfully written, false otherwise.