Panda3D
Loading...
Searching...
No Matches
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).
 
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.
 
void register_type (LoaderFileType *type)
 Defines a new LoaderFileType in the universe.
 
void unregister_type (LoaderFileType *type)
 Removes a type previously registered using register_type.
 
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.
 

Static Public Member Functions

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

Public Attributes

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

Detailed Description

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

Definition at line 28 of file loaderFileTypeRegistry.h.

Constructor & Destructor Documentation

◆ ~LoaderFileTypeRegistry()

LoaderFileTypeRegistry::~LoaderFileTypeRegistry ( )

Definition at line 38 of file loaderFileTypeRegistry.cxx.

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 172 of file loaderFileTypeRegistry.cxx.

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

Referenced by WindowFramework::load_model().

◆ 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 77 of file loaderFileTypeRegistry.cxx.

References downcase().

Referenced by init_libptloader().

◆ register_type()

void LoaderFileTypeRegistry::register_type ( LoaderFileType * type)

◆ unregister_type()

void LoaderFileTypeRegistry::unregister_type ( LoaderFileType * type)

Removes a type previously registered using register_type.

Definition at line 119 of file loaderFileTypeRegistry.cxx.

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

◆ 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 222 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 48 of file loaderFileTypeRegistry.h.

◆ get_type

LoaderFileType * LoaderFileTypeRegistry::get_type

Returns the nth type registered.

Definition at line 48 of file loaderFileTypeRegistry.h.


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