📄 pluginmgr_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>pluginmgr.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>pluginmgr.h</h1><a href="pluginmgr_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * pluginmgr.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Plugin Manager Class Declarations</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Contributor(s): Snark at GnomeMeeting</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * $Log: pluginmgr.h,v $</span>00011 <span class="comment"> * Revision 1.16 2004/08/05 03:45:35 csoutheren</span>00012 <span class="comment"> * Fixed problems with plugin suffix not being propagated to sudirectories</span>00013 <span class="comment"> *</span>00014 <span class="comment"> * Revision 1.15 2004/06/24 23:10:27 csoutheren</span>00015 <span class="comment"> * Require plugins to have _pwplugin suffix</span>00016 <span class="comment"> *</span>00017 <span class="comment"> * Revision 1.14 2004/06/01 05:44:57 csoutheren</span>00018 <span class="comment"> * Added OnShutdown to allow cleanup on exit</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * Revision 1.13 2004/05/19 06:54:11 csoutheren</span>00021 <span class="comment"> * Removed unused code</span>00022 <span class="comment"> *</span>00023 <span class="comment"> * Revision 1.12 2004/05/18 06:01:06 csoutheren</span>00024 <span class="comment"> * Deferred plugin loading until after main has executed by using abstract factory classes</span>00025 <span class="comment"> *</span>00026 <span class="comment"> * Revision 1.11 2004/05/17 06:05:20 csoutheren</span>00027 <span class="comment"> * Changed "make docs" to use doxygen</span>00028 <span class="comment"> * Added new config file and main page</span>00029 <span class="comment"> *</span>00030 <span class="comment"> * Revision 1.10 2004/04/22 11:43:47 csoutheren</span>00031 <span class="comment"> * Factored out functions useful for loading dynamic libraries</span>00032 <span class="comment"> *</span>00033 <span class="comment"> * Revision 1.9 2004/04/22 07:55:30 csoutheren</span>00034 <span class="comment"> * Fix problem with generic plugin manager having pure virtual. Thanks to Ben Lear</span>00035 <span class="comment"> *</span>00036 <span class="comment"> * Revision 1.8 2004/04/14 11:14:10 csoutheren</span>00037 <span class="comment"> * Final fix for generic plugin manager</span>00038 <span class="comment"> *</span>00039 <span class="comment"> * Revision 1.7 2004/04/14 10:57:38 csoutheren</span>00040 <span class="comment"> * Removed multiple definition of statc function in generic plugin functions</span>00041 <span class="comment"> *</span>00042 <span class="comment"> * Revision 1.6 2004/04/14 10:01:54 csoutheren</span>00043 <span class="comment"> * Fixed compile problem on Windows</span>00044 <span class="comment"> *</span>00045 <span class="comment"> * Revision 1.5 2004/04/14 08:12:02 csoutheren</span>00046 <span class="comment"> * Added support for generic plugin managers</span>00047 <span class="comment"> *</span>00048 <span class="comment"> * Revision 1.4 2004/03/23 04:43:42 csoutheren</span>00049 <span class="comment"> * Modified plugin manager to allow code modules to be notified when plugins</span>00050 <span class="comment"> * are loaded or unloaded</span>00051 <span class="comment"> *</span>00052 <span class="comment"> * Revision 1.3 2003/11/12 10:24:35 csoutheren</span>00053 <span class="comment"> * Changes to allow operation of static plugins under Windows</span>00054 <span class="comment"> *</span>00055 <span class="comment"> * Revision 1.2 2003/11/12 03:26:17 csoutheren</span>00056 <span class="comment"> * Initial version of plugin code from Snark of GnomeMeeting with changes</span>00057 <span class="comment"> * by Craig Southeren os Post Increment</span>00058 <span class="comment"> *</span>00059 <span class="comment"> *</span>00060 <span class="comment"> */</span>00061 00062 <span class="preprocessor">#ifndef _PLUGINMGR_H</span>00063 <span class="preprocessor"></span><span class="preprocessor">#define _PLUGINMGR_H</span>00064 <span class="preprocessor"></span><a name="l00065"></a><a class="code" href="pluginmgr_8h.html#a0">00065</a> <span class="preprocessor">#define DEFAULT_PLUGINDIR "/usr/lib/pwlib"</span>00066 <span class="preprocessor"></span>00067 <span class="preprocessor">#include <<a class="code" href="plugin_8h.html">ptlib/plugin.h</a>></span>00068 00069 <span class="keyword">template</span> <<span class="keyword">class</span> C><a name="l00070"></a><a class="code" href="pluginmgr_8h.html#a1">00070</a> <span class="keywordtype">void</span> <a class="code" href="pluginmgr_8h.html#a1">PLoadPluginDirectory</a>(C & obj, <span class="keyword">const</span> <a class="code" href="classPDirectory.html">PDirectory</a> & directory, <span class="keyword">const</span> <span class="keywordtype">char</span> * suffix = NULL)00071 {00072 <a class="code" href="classPDirectory.html">PDirectory</a> dir = directory;00073 <span class="keywordflow">if</span> (!dir.<a class="code" href="classPDirectory.html#z211_0">Open</a>()) {00074 <a class="code" href="object_8h.html#a16">PTRACE</a>(4, <span class="stringliteral">"Cannot open plugin directory "</span> << dir);00075 <span class="keywordflow">return</span>;00076 }00077 <a class="code" href="object_8h.html#a16">PTRACE</a>(4, <span class="stringliteral">"Enumerating plugin directory "</span> << dir);00078 <span class="keywordflow">do</span> {00079 <a class="code" href="classPString.html">PString</a> entry = dir + dir.<a class="code" href="classPDirectory.html#z211_4">GetEntryName</a>();00080 <span class="keywordflow">if</span> (dir.<a class="code" href="classPDirectory.html#z211_5">IsSubDir</a>())00081 PLoadPluginDirectory<C>(obj, entry, suffix);00082 <span class="keywordflow">else</span> {00083 <a class="code" href="classPFilePath.html">PFilePath</a> fn(entry);00084 <span class="keywordflow">if</span> (00085 (fn.<a class="code" href="classPFilePath.html#z139_3">GetType</a>() *= <a class="code" href="classPDynaLink.html#z109_4">PDynaLink::GetExtension</a>()) &&00086 (00087 (suffix == NULL) || (fn.<a class="code" href="classPFilePath.html#z139_2">GetTitle</a>().<a class="code" href="classPString.html#z245_2">Right</a>(strlen(suffix)) *= suffix)00088 )00089 )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -