Panda3D
Public Member Functions | Static Public Member Functions | List of all members
LoaderFileTypeRegistry Class Reference

This class maintains the set of all known LoaderFileTypes in the universe. More...

#include "loaderFileTypeRegistry.h"

Public Member Functions

int get_num_types () const
 Returns the total number of types registered. More...
 
LoaderFileTypeget_type (int n) const
 Returns the nth type registered. More...
 
LoaderFileTypeget_type_from_extension (const string &extension)
 Determines the type of the file based on the indicated extension (without a leading dot). More...
 
 MAKE_SEQ (get_types, get_num_types, get_type)
 
void register_deferred_type (const string &extension, const string &library)
 Records a type associated with a particular extension to be loaded in the future. More...
 
void register_type (LoaderFileType *type)
 Defines a new LoaderFileType in the universe. More...
 
void write (ostream &out, int indent_level=0) const
 Writes a list of supported file types to the indicated output stream, one per line. More...
 

Static Public Member Functions

static LoaderFileTypeRegistryget_global_ptr ()
 Returns a pointer to the global LoaderFileTypeRegistry object. More...
 

Detailed Description

This class maintains the set of all known LoaderFileTypes in the universe.

Definition at line 31 of file loaderFileTypeRegistry.h.

Member Function Documentation

◆ get_global_ptr()

LoaderFileTypeRegistry * LoaderFileTypeRegistry::get_global_ptr ( )
static

Returns a pointer to the global LoaderFileTypeRegistry object.

Definition at line 257 of file loaderFileTypeRegistry.cxx.

Referenced by WindowFramework::load_model(), and write().

◆ get_num_types()

int LoaderFileTypeRegistry::get_num_types ( ) const

Returns the total number of types registered.

Definition at line 131 of file loaderFileTypeRegistry.cxx.

References get_type().

Referenced by register_deferred_type().

◆ get_type()

LoaderFileType * LoaderFileTypeRegistry::get_type ( int  n) const

Returns the nth type registered.

Definition at line 141 of file loaderFileTypeRegistry.cxx.

References get_type_from_extension().

Referenced by get_num_types().

◆ get_type_from_extension()

LoaderFileType * LoaderFileTypeRegistry::get_type_from_extension ( const string &  extension)

Determines the type of the file based on the indicated extension (without a leading dot).

Returns NULL if the extension matches no known file types.

Definition at line 154 of file loaderFileTypeRegistry.cxx.

References Filename::to_os_specific(), and write().

Referenced by get_type(), and WindowFramework::load_model().

◆ register_deferred_type()

void LoaderFileTypeRegistry::register_deferred_type ( const string &  extension,
const string &  library 
)

Records a type associated with a particular extension to be loaded in the future.

The named library will be dynamically loaded the first time files of this extension are loaded; presumably this library will call register_type() when it initializes, thus making the extension loadable.

Definition at line 87 of file loaderFileTypeRegistry.cxx.

References get_num_types().

Referenced by register_type().

◆ register_type()

void LoaderFileTypeRegistry::register_type ( LoaderFileType type)

Defines a new LoaderFileType in the universe.

Definition at line 51 of file loaderFileTypeRegistry.cxx.

References LoaderFileType::get_additional_extensions(), and register_deferred_type().

◆ write()

void LoaderFileTypeRegistry::write ( ostream &  out,
int  indent_level = 0 
) const

Writes a list of supported file types to the indicated output stream, one per line.

Definition at line 207 of file loaderFileTypeRegistry.cxx.

References LoaderFileType::get_additional_extensions(), and get_global_ptr().

Referenced by get_type_from_extension().


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