#include <page_magick.h>
Public Member Functions | |
| PluginCollection () | |
| Plugin Collection - loads all shared objects in the specified directory. | |
| ~PluginCollection () | |
| void | Initialise (char *directory) |
| void | RegisterPlugin (char *filename) |
| unsigned int | Count () |
| Plugin * | Get (unsigned int index) |
Private Attributes | |
| vector< Plugin * > | collection |
Definition at line 52 of file page_magick.h.
|
|
Plugin Collection - loads all shared objects in the specified directory.
Definition at line 375 of file page_magick.cc. 00376 {}
|
|
|
Definition at line 378 of file page_magick.cc. References collection. 00379 {
00380 for ( unsigned int index = 0; index < collection.size(); index ++ )
00381 {
00382 collection[ index ] ->Close();
00383 delete collection[ index ];
00384 }
00385 }
|
|
|
Definition at line 431 of file page_magick.cc. References collection. Referenced by PageMagick::PageMagick(). 00432 {
00433 return collection.size();
00434 }
|
|
|
Definition at line 436 of file page_magick.cc. References collection. Referenced by PageMagick::PageMagick(). 00437 {
00438 return collection[ index ];
00439 }
|
|
|
Definition at line 387 of file page_magick.cc. References RegisterPlugin(). Referenced by PageMagick::PageMagick(). 00388 {
00389 char * filename;
00390 char *extension;
00391 DIR *dir;
00392 struct dirent *entry;
00393 struct stat statbuf;
00394
00395 dir = opendir( directory );
00396
00397 if ( dir )
00398 {
00399 while ( ( entry = readdir( dir ) ) != NULL )
00400 {
00401 filename = g_strdup_printf( "%s/%s", directory, entry->d_name );
00402 extension = strrchr( entry->d_name, '.' );
00403 if ( extension != NULL && !stat( filename, &statbuf ) && S_ISREG( statbuf.st_mode ) )
00404 {
00405 if ( !strcmp( extension, ".so" ) )
00406 {
00407 RegisterPlugin( filename );
00408 }
00409 }
00410 g_free( filename );
00411 }
00412 closedir( dir );
00413 }
00414 }
|
|
|
Definition at line 416 of file page_magick.cc. References collection, Plugin::GetError(), and Plugin::Open(). Referenced by Initialise(). 00417 {
00418 Plugin * plugin = new Plugin;
00419 if ( plugin->Open( filename ) )
00420 {
00421 cerr << ">>> Registering plugin " << filename << endl;
00422 collection.push_back( plugin );
00423 }
00424 else
00425 {
00426 cerr << ">>> Rejecting plugin " << filename << " : " << plugin->GetError() << endl;
00427 delete plugin;
00428 }
00429 }
|
|
|
Definition at line 55 of file page_magick.h. Referenced by Count(), Get(), RegisterPlugin(), and ~PluginCollection(). |
1.4.2