# DCFile

from pandac.PandaModules import DCFile

Class : DCFile
Description : Represents the complete list of Distributed Class descriptions as read from a .dc file.

## Inheritance:

DCFile:

## Methods of DCFile:

allObjectsValid
clear
getClass
getClassByName
getFieldByIndex
getHash
getImportModule
getImportSymbol
getKeyword
getKeywordByName
getNumClasses
getNumImportModules
getNumImportSymbols
getNumKeywords
getNumTypedefs
getSwitchByName
getTypedef
getTypedefByName
read
readAll
write

allObjectsValid bool DCFile::all_objects_valid(void) const; Filename: dcFile.I Created by: drose (10Jan06) PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ . To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net . Description: 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 void DCFile::clear(void); Description: Removes all of the classes defined within the DCFile and prepares it for reading a new file.

getClass DCClass *DCFile::get_class(int n) const; Description: Returns the nth class read from the .dc file(s).

getClassByName DCClass *DCFile::get_class_by_name(string const &name) const; Description: Returns the class that has the indicated name, or NULL if there is no such class.

getFieldByIndex DCField *DCFile::get_field_by_index(int index_number) const; Description: 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.

getHash unsigned long int DCFile::get_hash(void) const; Description: 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.

getImportModule string DCFile::get_import_module(int n) const; Description: Returns the module named by the nth import line read from the .dc file(s).

getImportSymbol string DCFile::get_import_symbol(int n, int i) const; Description: Returns the ith symbol named by the nth import line read from the .dc file(s).

getKeyword DCKeyword const *DCFile::get_keyword(int n) const; Description: Returns the nth keyword read from the .dc file(s).

getKeywordByName DCKeyword const *DCFile::get_keyword_by_name(string const &name) const; Description: Returns the keyword that has the indicated name, or NULL if there is no such keyword name.

getNumClasses int DCFile::get_num_classes(void) const; Description: Returns the number of classes read from the .dc file(s).

getNumImportModules int DCFile::get_num_import_modules(void) const; Description: Returns the number of import lines read from the .dc file(s).

getNumImportSymbols int DCFile::get_num_import_symbols(int n) const; Description: 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 ... ".

getNumKeywords int DCFile::get_num_keywords(void) const; Description: Returns the number of keywords read from the .dc file(s).

getNumTypedefs int DCFile::get_num_typedefs(void) const; Description: Returns the number of typedefs read from the .dc file(s).

getSwitchByName DCSwitch *DCFile::get_switch_by_name(string const &name) const; Description: Returns the switch that has the indicated name, or NULL if there is no such switch.

getTypedef DCTypedef *DCFile::get_typedef(int n) const; Description: Returns the nth typedef read from the .dc file(s).

getTypedefByName DCTypedef *DCFile::get_typedef_by_name(string const &name) const; Description: Returns the typedef that has the indicated name, or NULL if there is no such typedef name.

read bool DCFile::read(Filename filename); WITHIN_PANDA Description: 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). Description: 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.

readAll bool DCFile::read_all(void); Description: This special method reads all of the .dc files named by the "dc-file" config.prc variable, and loads them into the DCFile namespace.

write bool DCFile::write(Filename filename, bool brief) const; Description: 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. Description: Writes a parseable description of all the known distributed classes to the stream.