DCFile
-
class DCFile
Represents the complete list of Distributed Class descriptions as read from a .dc file.
Inheritance diagram
-
DCFile(void)
-
bool all_objects_valid(void) const
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.
-
void clear(void)
Removes all of the classes defined within the
DCFile
and prepares it for reading a new file.
-
DCClass *get_class_by_name(std::string const &name) const
Returns the class that has the indicated name, or NULL if there is no such class.
-
DCField *get_field_by_index(int index_number) const
Returns a pointer to the one
DCField
that has the indicated index number, of all theDCFields
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 get_hash(void) const
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.
-
std::string get_import_module(int n) const
Returns the module named by the nth import line read from the .dc file(s).
-
std::string get_import_symbol(int n, int i) const
Returns the ith symbol named by the nth import line read from the .dc file(s).
-
DCKeyword const *get_keyword_by_name(std::string const &name) const
Returns the keyword that has the indicated name, or NULL if there is no such keyword name.
-
int get_num_classes(void) const
Returns the number of classes read from the .dc file(s).
-
int get_num_import_modules(void) const
Returns the number of import lines read from the .dc file(s).
-
int get_num_import_symbols(int n) const
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 get_num_keywords(void) const
Returns the number of keywords read from the .dc file(s).
-
int get_num_typedefs(void) const
Returns the number of typedefs read from the .dc file(s).
-
DCSwitch *get_switch_by_name(std::string const &name) const
Returns the switch that has the indicated name, or NULL if there is no such switch.
-
DCTypedef *get_typedef_by_name(std::string const &name) const
Returns the typedef that has the indicated name, or NULL if there is no such typedef name.
-
bool read(std::istream &in, std::string const &filename = string())
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).
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 read_all(void)
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(std::ostream &out, bool brief) const
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.
Writes a parseable description of all the known distributed classes to the stream.
Returns true if the description is successfully written, false otherwise.
-
DCFile(void)