home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / dn511.exe / DSFILTER.H < prev    next >
C/C++ Source or Header  |  1995-01-09  |  4KB  |  96 lines

  1. /*
  2. **    Copyright ⌐ 1994 Novell, Inc.  All rights reserved.
  3. **
  4. **    Permission is granted to the recipient of this work ("you") to use,
  5. **    reproduce and distribute Novell's original publication of the work free
  6. **    of charge provided that you reproduce the work in its entirety and
  7. **    include all Novell copyright notices as they originally appear.
  8. **
  9. **    Novell grants you permission to modify and distribute copies of this
  10. **    work including any portion of this work (a "modified work") provided
  11. **    that you include prominent notification of such modification along with
  12. **    the date of modification on a modified work; distribute or publish a
  13. **    modified work to third parties under the same conditions and granting
  14. **    the same rights as are extended to you by Novell under this under
  15. **    permission notice; and provided that you include a copy of Novell's
  16. **    original publication of the work along with any copy of a modified
  17. **    work.
  18. **
  19. **    NOVELL MAKES NO WARRANTY, REPRESENTATION OR PROMISE THAT THIS WORK OR A
  20. **    MODIFIED WORK WILL SATISFY YOUR REQUIREMENTS OR THAT THIS WORK OR A
  21. **    MODIFIED WORK IS WITHOUT DEFECT OR ERROR.  NOVELL DISCLAIMS AND
  22. **    EXCLUDES ANY AND ALL IMPLIED WARRANTIES OF MERCHANTABILITY, TITLE OR
  23. **    FITNESS FOR A PARTICULAR PURPOSE.
  24. **
  25. **    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL NOVELL OR ANY OTHER
  26. **    PARTY BE LIABLE FOR DAMAGES INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
  27. **    CONSEQUENTIAL, INDIRECT OR PUNATIVE DAMAGES ARISING OUT OF THE USE OF
  28. **    OR INABLITITY TO USE THE WORK OR A MODIFIED WORK.
  29. **
  30. **    DSFILTER.H - October 1994
  31. **
  32. **    Declaration of the DSFilter class.
  33. **
  34. **    Author: John Buckle, Asia Pacific Support Centre, Novell Australia
  35. **    ==================================================================
  36. **    9 Jan 1995           First release              John Buckle
  37. */
  38.  
  39. # ifndef dsFILTER_H
  40. # define dsFILTER_H
  41.  
  42. # include "dscontex.h"
  43.  
  44. /*
  45. ** LPDelValueFunc    Type of an optional function that can be supplied to
  46. **            filter operations.
  47. */
  48.  
  49. typedef void (*LPDelValueFunc)(NWSYNTAX_ID,void *) ;
  50.  
  51. /*
  52. ** Class DSFilter
  53. **
  54. **    Used to initialise an NWDS buffer for filtering the DSSearch function.
  55. **    The assignment operator and initialisation contructor are declared but
  56. **    not defined, this is to stop the directory buffer being copied and
  57. **    inadvertantly released.
  58. */
  59.  
  60. class _DSCLASSDEC DSFilter : public virtual DSContext
  61. {
  62. protected:
  63.  
  64.     NWDS_BUFFER *        Filter ;
  65.     NWDS_FILTER_CURSOR *    Cursor ;
  66.  
  67. public:
  68.                 DSFilter(WORD size = DEFAULT_MESSAGE_LEN) ;
  69.                 DSFilter(DSFilter &) ;
  70.     virtual              ~ DSFilter() ;
  71.     void            operator=(DSFilter &) ;
  72.  
  73.     NWDS_BUFFER *        filter()    { return Filter ; }
  74.     NWDS_FILTER_CURSOR *    cursor()    { return Cursor ; }
  75.  
  76.  
  77.     NWDSCCODE    AllocFilter()
  78.                 { return Status = NWDSAllocFilter(& Cursor) ; }
  79.     NWDSCCODE    AddAttrNameToken(void * data, NWSYNTAX_ID syntax = SYN_CLASS_NAME)
  80.                 { return Status = NWDSAddFilterToken(Cursor,FTOK_ANAME,data,syntax) ; }
  81.     NWDSCCODE    AddAttrValueToken(void * data, NWSYNTAX_ID syntax = SYN_CLASS_NAME)
  82.                 { return Status = NWDSAddFilterToken(Cursor,FTOK_AVAL,data,syntax) ; }
  83.     NWDSCCODE    AddFilterToken(NWDS_TOKEN tok, void * data = 0, NWSYNTAX_ID syntax = 0)
  84.                 { return Status = NWDSAddFilterToken(Cursor,tok,data,syntax) ; }
  85.     NWDSCCODE    DelFilterToken(LPDelValueFunc func = 0)
  86.                 { return Status = NWDSDelFilterToken(Cursor,func) ; }
  87.     NWDSCCODE    FreeFilter(LPDelValueFunc func = 0)
  88.                 { NWDSFreeFilter(Cursor,func) ; return Status = 0 ; }
  89.     NWDSCCODE    InitBuf(NWDS_OPERATION function)
  90.                 { return Status = NWDSInitBuf(dContext,function,Filter) ; }
  91.     NWDSCCODE    PutFilter(LPDelValueFunc func = 0)
  92.                 { return Status = NWDSPutFilter(dContext,Filter,Cursor,func) ; }
  93. } ;
  94.  
  95. # endif dsFILTER_H
  96.