Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | 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
 
LoaderFileTypeget_type (int n) const
 
LoaderFileTypeget_type_from_extension (const std::string &extension)
 Determines the type of the file based on the indicated extension (without a leading dot). More...
 
void register_deferred_type (const std::string &extension, const std::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 (std::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...
 

Public Attributes

 get_num_types
 Returns the total number of types registered. More...
 
 get_type
 Returns the nth type registered. More...
 

Detailed Description

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

Definition at line 28 of file loaderFileTypeRegistry.h.

Member Function Documentation

◆ get_global_ptr()

LoaderFileTypeRegistry * LoaderFileTypeRegistry::get_global_ptr ( )
static

◆ get_type_from_extension()

LoaderFileType * LoaderFileTypeRegistry::get_type_from_extension ( const std::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 138 of file loaderFileTypeRegistry.cxx.

References downcase().

◆ register_deferred_type()

void LoaderFileTypeRegistry::register_deferred_type ( const std::string &  extension,
const std::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 78 of file loaderFileTypeRegistry.cxx.

References downcase().

Referenced by init_libptloader().

◆ register_type()

void LoaderFileTypeRegistry::register_type ( LoaderFileType type)

◆ write()

void LoaderFileTypeRegistry::write ( std::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 188 of file loaderFileTypeRegistry.cxx.

References extract_words(), LoaderFileType::get_additional_extensions(), and indent().

Member Data Documentation

◆ get_num_types

int LoaderFileTypeRegistry::get_num_types

Returns the total number of types registered.

Definition at line 41 of file loaderFileTypeRegistry.h.

◆ get_type

LoaderFileType * LoaderFileTypeRegistry::get_type

Returns the nth type registered.

Definition at line 41 of file loaderFileTypeRegistry.h.


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