⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pldap_8h-source.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
00269     );00270 00273     BOOL Modify(00274       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; dn,00275       <span class="keyword">const</span> PList&lt;ModAttrib&gt; &amp; attributes00276     );00277 00280     BOOL Modify(00281       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; dn,00282       <span class="keyword">const</span> <a class="code" href="classPStringToString.html">PStringToString</a> &amp; attributes00283     );00284 00288     BOOL Modify(00289       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; dn,00290       <span class="keyword">const</span> <a class="code" href="classPStringArray.html">PStringArray</a> &amp; attributes00291     );00292 00296     BOOL Modify(00297       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; dn,00298       <span class="keyword">const</span> PLDAPStructBase &amp; data00299     );00300 00303     BOOL Delete(00304       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; dn00305     );00306 00307 00308     <span class="keyword">enum</span> SearchScope {00309       ScopeBaseOnly,00310       ScopeSingleLevel,00311       ScopeSubTree,00312       NumSearchScope00313     };00314 00315     <span class="keyword">class </span>SearchContext {00316       <span class="keyword">public</span>:00317         SearchContext();00318         ~SearchContext();00319 00320         BOOL IsCompleted()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> completed; }00321 00322       <span class="keyword">private</span>:00323         <span class="keywordtype">int</span>              msgid;00324         <span class="keyword">struct </span>ldapmsg * result;00325         <span class="keyword">struct </span>ldapmsg * message;00326         BOOL             found;00327         BOOL             completed;00328 00329       <span class="keyword">friend</span> <span class="keyword">class </span>PLDAPSession;00330     };00331 00334     BOOL Search(00335       SearchContext &amp; context,00336       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; filter,00337       <span class="keyword">const</span> <a class="code" href="classPStringArray.html">PStringArray</a> &amp; attributes = <a class="code" href="classPStringList.html">PStringList</a>(),00338       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; base = <a class="code" href="classPString.html#z231_33">PString::Empty</a>(),00339       SearchScope scope = ScopeSubTree00340     );00341 00344     BOOL GetSearchResult(00345       SearchContext &amp; context,00346       <a class="code" href="classPStringToString.html">PStringToString</a> &amp; data00347     );00348 00351     BOOL GetSearchResult(00352       SearchContext &amp; context,00353       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; attribute,00354       <a class="code" href="classPString.html">PString</a> &amp; data00355     );00356 00359     BOOL GetSearchResult(00360       SearchContext &amp; context,00361       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; attribute,00362       <a class="code" href="classPStringArray.html">PStringArray</a> &amp; data00363     );00364 00367     BOOL GetSearchResult(00368       SearchContext &amp; context,00369       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; attribute,00370       PArray&lt;PBYTEArray&gt; &amp; data00371     );00372 00375     BOOL GetSearchResult(00376       SearchContext &amp; context,00377       PLDAPStructBase &amp; data00378     );00379 00382     <a class="code" href="classPString.html">PString</a> GetSearchResultDN(00383       SearchContext &amp; context00384     );00385 00388     BOOL GetNextSearchResult(00389       SearchContext &amp; context00390     );00391 00396     PList&lt;PStringToString&gt; Search(00397       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; filter,00398       <span class="keyword">const</span> <a class="code" href="classPStringArray.html">PStringArray</a> &amp; attributes = <a class="code" href="classPStringList.html">PStringList</a>(),00399       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; base = <a class="code" href="classPString.html#z231_33">PString::Empty</a>(),00400       SearchScope scope = ScopeSubTree00401     );00402 00403 00406     <span class="keywordtype">void</span> SetBaseDN(00407       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; dn00408     ) { defaultBaseDN = dn; }00409 00412     <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; GetBaseDN()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> defaultBaseDN; }00413 00416     <span class="keywordtype">int</span> GetErrorNumber()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> errorNumber; }00417 00420     <a class="code" href="classPString.html">PString</a> GetErrorText() <span class="keyword">const</span>;00421 00424     <span class="keyword">struct </span>ldap * GetOpenLDAP() const { <span class="keywordflow">return</span> ldapContext; }00425 00428     <span class="keyword">const</span> <a class="code" href="classPTimeInterval.html">PTimeInterval</a> &amp; GetTimeout()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> timeout; }00429 00432     <span class="keywordtype">void</span> SetTimeout(00433       <span class="keyword">const</span> <a class="code" href="classPTimeInterval.html">PTimeInterval</a> &amp; t00434     ) { timeout = t; }00435 00438      <span class="keywordtype">void</span> SetSearchLimit(00439       <span class="keyword">const</span> <span class="keywordtype">unsigned</span> s00440     ) { searchLimit = s; }00441 00442   <span class="keyword">protected</span>:00443     <span class="keyword">struct </span>ldap * ldapContext;00444     <span class="keywordtype">int</span>           errorNumber;00445     <span class="keywordtype">unsigned</span>      protocolVersion;00446     <a class="code" href="classPString.html">PString</a>       defaultBaseDN;00447     <span class="keywordtype">unsigned</span>      searchLimit;00448     <a class="code" href="classPTimeInterval.html">PTimeInterval</a> timeout;00449     <a class="code" href="classPString.html">PString</a>       multipleValueSeparator;00450 };00451 00452 00453 00454 <span class="keyword">class </span>PLDAPStructBase;00455 00456 <span class="keyword">class </span>PLDAPAttributeBase : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>00457 {00458     <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(PLDAPAttributeBase, <a class="code" href="classPObject.html">PObject</a>);00459   <span class="keyword">public</span>:00460     PLDAPAttributeBase(<span class="keyword">const</span> <span class="keywordtype">char</span> * name, <span class="keywordtype">void</span> * pointer, PINDEX size);00461 00462     <span class="keyword">const</span> <span class="keywordtype">char</span> * GetName()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> name; }00463     BOOL IsBinary()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> pointer != NULL; }00464 00465     <span class="keyword">virtual</span> <span class="keywordtype">void</span> Copy(<span class="keyword">const</span> PLDAPAttributeBase &amp; other) = 0;00466 00467     <span class="keyword">virtual</span> <a class="code" href="classPString.html">PString</a> ToString() <span class="keyword">const</span>;00468     <span class="keyword">virtual</span> <span class="keywordtype">void</span> FromString(<span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; str);00469     <span class="keyword">virtual</span> <a class="code" href="classPBYTEArray.html">PBYTEArray</a> ToBinary() <span class="keyword">const</span>;00470     <span class="keyword">virtual</span> <span class="keywordtype">void</span> FromBinary(<span class="keyword">const</span> PArray&lt;PBYTEArray&gt; &amp; data);00471 00472   <span class="keyword">protected</span>:00473     <span class="keyword">const</span> <span class="keywordtype">char</span> * name;00474     <span class="keywordtype">void</span>       * pointer;00475     PINDEX       size;00476 };00477 00478 00479 <span class="keyword">class </span>PLDAPStructBase : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a> {00480     <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(PLDAPStructBase, <a class="code" href="classPObject.html">PObject</a>);00481   <span class="keyword">protected</span>:00482     PLDAPStructBase();00483     PLDAPStructBase &amp; operator=(<span class="keyword">const</span> PLDAPStructBase &amp;);00484     PLDAPStructBase &amp; operator=(<span class="keyword">const</span> <a class="code" href="classPStringArray.html">PStringArray</a> &amp; array);00485     PLDAPStructBase &amp; operator=(<span class="keyword">const</span> <a class="code" href="classPStringToString.html">PStringToString</a> &amp; dict);00486   <span class="keyword">private</span>:00487     PLDAPStructBase(<span class="keyword">const</span> PLDAPStructBase &amp;) { }00488 00489   <span class="keyword">public</span>:00490     <span class="keywordtype">void</span> <a class="code" href="classPObject.html#z201_0">PrintOn</a>(ostream &amp; strm) <span class="keyword">const</span>;00491 00492     PINDEX GetNumAttributes()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> attributes.GetSize(); }00493     PLDAPAttributeBase &amp; GetAttribute(PINDEX idx)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> attributes.GetDataAt(idx); }00494     PLDAPAttributeBase * GetAttribute(<span class="keyword">const</span> <span class="keywordtype">char</span> * name)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> attributes.GetAt(name); }00495 00496     <span class="keywordtype">void</span> AddAttribute(PLDAPAttributeBase * var);00497     <span class="keyword">static</span> PLDAPStructBase &amp; GetInitialiser() { <span class="keywordflow">return</span> *<a class="code" href="object_8h.html#a8">PAssertNULL</a>(initialiserInstance); }00498 00499   <span class="keyword">protected</span>:00500     <span class="keywordtype">void</span> EndConstructor();00501 00502     PDictionary&lt;PString, PLDAPAttributeBase&gt; attributes;00503 00504     PLDAPStructBase        * initialiserStack;00505     <span class="keyword">static</span> <a class="code" href="classPMutex.html">PMutex</a>            initialiserMutex;00506     <span class="keyword">static</span> PLDAPStructBase * initialiserInstance;00507 };00508 00509 00510 <span class="preprocessor">#define PLDAP_STRUCT_BEGIN(name) \</span>00511 <span class="preprocessor">  class name : public PLDAPStructBase { \</span>00512 <span class="preprocessor">    public: name() { EndConstructor(); } \</span>00513 <span class="preprocessor">    public: name(const name &amp; other) { EndConstructor(); operator=(other); } \</span>00514 <span class="preprocessor">    public: name(const PStringArray &amp; array) { EndConstructor(); operator=(array); } \</span>00515 <span class="preprocessor">    public: name(const PStringToString &amp; dict) { EndConstructor(); operator=(dict); } \</span>00516 <span class="preprocessor">    public: name &amp; operator=(const name &amp; other) { PLDAPStructBase::operator=(other); return *this; } \</span>00517 <span class="preprocessor">    public: name &amp; operator=(const PStringArray &amp; array) { PLDAPStructBase::operator=(array); return *this; } \</span>00518 <span class="preprocessor">    public: name &amp; operator=(const PStringToString &amp; dict) { PLDAPStructBase::operator=(dict); return *this; } \</span>00519 <span class="preprocessor">    PLDAP_ATTR_INIT(name, PString, objectClass, #name);</span>00520 <span class="preprocessor"></span>00521 <span class="preprocessor">#define PLDAP_ATTRIBUTE(base, type, attribute, pointer, init) \</span>00522 <span class="preprocessor">    public: type attribute; \</span>00523 <span class="preprocessor">    private: struct PLDAPAttr_##attribute : public PLDAPAttributeBase { \</span>00524 <span class="preprocessor">      PLDAPAttr_##attribute() \</span>00525 <span class="preprocessor">        : PLDAPAttributeBase(#attribute, pointer, sizeof(type)), \</span>00526 <span class="preprocessor">          instance(((base &amp;)base::GetInitialiser()).attribute) \</span>00527 <span class="preprocessor">        { init } \</span>00528 <span class="preprocessor">      virtual void PrintOn (ostream &amp; s) const { s &lt;&lt; instance; } \</span>00529 <span class="preprocessor">      virtual void ReadFrom(istream &amp; s)       { s &gt;&gt; instance; } \</span>00530 <span class="preprocessor">      virtual void Copy(const PLDAPAttributeBase &amp; other) \</span>00531 <span class="preprocessor">                    { instance = ((PLDAPAttr_##attribute &amp;)other).instance; } \</span>00532 <span class="preprocessor">      type &amp; instance; \</span>00533 <span class="preprocessor">    } pldapvar_##attribute</span>00534 <span class="preprocessor"></span>00535 <span class="preprocessor">#define PLDAP_ATTR_SIMP(base, type, attribute) \</span>00536 <span class="preprocessor">        PLDAP_ATTRIBUTE(base, type, attribute, NULL, ;)</span>00537 <span class="preprocessor"></span>00538 <span class="preprocessor">#define PLDAP_ATTR_INIT(base, type, attribute, init) \</span>00539 <span class="preprocessor">        PLDAP_ATTRIBUTE(base, type, attribute, NULL, instance = init;)</span>00540 <span class="preprocessor"></span>00541 <span class="preprocessor">#define PLDAP_BINATTRIB(base, type, attribute) \</span>00542 <span class="preprocessor">        PLDAP_ATTRIBUTE(base, type, attribute, &amp;((base &amp;)base::GetInitialiser()).attribute, ;)</span>00543 <span class="preprocessor"></span>00544 <span class="preprocessor">#define PLDAP_STRUCT_END() \</span>00545 <span class="preprocessor">  };</span>00546 <span class="preprocessor"></span>00547 <span class="preprocessor">#endif // P_LDAP</span>00548 <span class="preprocessor"></span>00549 <span class="preprocessor">#endif // _PLDAP_H</span>00550 <span class="preprocessor"></span>00551 00552 <span class="comment">// End of file ////////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:11 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -