Gnash  0.8.11dev
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gnash::Extension Class Reference

#include <extension.h>

Public Member Functions

 Extension ()
 
 Extension (const std::string &dir)
 
 ~Extension ()
 
bool scanDir ()
 Scan a directory for Gnash modules. More...
 
bool scanDir (const std::string &dir)
 Scan the given directory for modules. More...
 
bool scanAndLoad (as_object &where)
 
bool scanAndLoad (const std::string &dir, as_object &where)
 
bool initModuleWithFunc (const std::string &module, const std::string &func, as_object &obj)
 
bool initNewObject (as_object &obj)
 
void dumpModules ()
 

Protected Member Functions

bool initModule (const std::string &module, as_object &obj)
 Initialize the named module within Gnash. More...
 

Protected Attributes

std::vector< std::string > _modules
 A list of modules. More...
 
std::map< std::string, SharedLib * > _plugins
 A map of loaded modules. More...
 
std::string _pluginsdir
 The default directory to search for modules. More...
 

Constructor & Destructor Documentation

§ Extension() [1/2]

gnash::Extension::Extension ( )

References _pluginsdir, and gnash::log_debug().

§ Extension() [2/2]

gnash::Extension::Extension ( const std::string &  dir)

References _pluginsdir.

§ ~Extension()

gnash::Extension::~Extension ( )
inline

Member Function Documentation

§ dumpModules()

void gnash::Extension::dumpModules ( )

References _modules.

§ initModule()

bool gnash::Extension::initModule ( const std::string &  module,
as_object obj 
)
protected

Initialize the named module within Gnash.

Parameters
symbolThe name of the module to find and initialize.
objThe object to attach the module to.

References _, _plugins, _pluginsdir, gnash::SharedLib::getInitEntry(), gnash::log_error(), gnash::log_security(), and gnash::SharedLib::openLib().

Referenced by scanAndLoad().

§ initModuleWithFunc()

bool gnash::Extension::initModuleWithFunc ( const std::string &  module,
const std::string &  func,
as_object obj 
)

§ initNewObject()

bool gnash::Extension::initNewObject ( as_object obj)

§ scanAndLoad() [1/2]

bool gnash::Extension::scanAndLoad ( as_object where)

Scan the plugins directory and attach any found modules to the given object.

Parameters
whereThe as_object to which the modules should be attached (usually the global object)

References _, _modules, _pluginsdir, initModule(), gnash::log_security(), and scanDir().

Referenced by scanAndLoad().

§ scanAndLoad() [2/2]

bool gnash::Extension::scanAndLoad ( const std::string &  dir,
as_object where 
)

Scan the given directory and attach any found modules to the given object.

Parameters
whereThe as_object to which the modules should be attached (usually the global object)
dirA directory to scan.

References _pluginsdir, and scanAndLoad().

§ scanDir() [1/2]

bool gnash::Extension::scanDir ( )

Scan a directory for Gnash modules.

References _pluginsdir.

Referenced by scanAndLoad().

§ scanDir() [2/2]

bool gnash::Extension::scanDir ( const std::string &  dir)

Scan the given directory for modules.

Parameters
dirThe directory to scan.

References _, _modules, dirent, gnash::key::e, gnash::key::i, gnash::log_debug(), gnash::log_error(), name, and gnash::key::t.

Member Data Documentation

§ _modules

std::vector<std::string> gnash::Extension::_modules
protected

A list of modules.

Referenced by dumpModules(), scanAndLoad(), and scanDir().

§ _plugins

std::map<std::string, SharedLib *> gnash::Extension::_plugins
protected

A map of loaded modules.

Referenced by initModule(), and initModuleWithFunc().

§ _pluginsdir

std::string gnash::Extension::_pluginsdir
protected

The default directory to search for modules.

Referenced by Extension(), initModule(), scanAndLoad(), and scanDir().


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