home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / dn511.exe / DSVCHAR.H < prev    next >
C/C++ Source or Header  |  1995-02-13  |  3KB  |  101 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. **    DSVCHAR.H - October 1994
  31. **
  32. **    Declaration of the DSVString and DSVStringList classes.
  33. **
  34. **    Author: John Buckle, Asia Pacific Support Centre, Novell Australia
  35. **    ==================================================================
  36. **    9 Jan 1995           First release              John Buckle
  37. */
  38.  
  39. # ifndef dsVCHAR_H
  40. # define dsVCHAR_H
  41.  
  42. # include "dsvalue.h"
  43. # include "dsvlist.h"
  44.  
  45. /*
  46. ** Structure DSVString
  47. **
  48. **    Used to hold the SYN_**_STRING values.
  49. */
  50.  
  51. struct _DSCLASSDEC DSVString : public DSValue
  52. {
  53.     NWPSTR        String ;
  54.  
  55.     NWDSCCODE    assign (NWSYNTAX_ID, void *) ;
  56.     NWDSCCODE    assign (DSVString *) ;
  57.     NWDSCCODE    release(int = DSCPP_DEF_INDEX) ;
  58.     NWDSCCODE    compare(DSValue *) ;
  59.  
  60.             DSVString()                { String = 0 ; }
  61.             DSVString(NWSYNTAX_ID s, void * v)    { assign(s,v) ; }
  62.             DSVString(DSVString & v)        { assign(& v) ; }
  63.               ~    DSVString()                { release() ; }
  64.     void        operator=(DSVString & v)        { assign(& v) ; }
  65.  
  66.     void *        data()                    { return String ; }
  67.     DSValueType    type()                    { return DSCPP_STRING ; }
  68.     NWPSTR        text(int = DSCPP_DEF_INDEX)        { return (String) ? String : "" ; }
  69. } ;
  70.  
  71. /*
  72. ** Structure DSVStringList
  73. **
  74. **    Used to hold the SYN_CI_LIST values.
  75. */
  76.  
  77. struct _DSCLASSDEC DSVStringList : public DSValue
  78. {
  79.     DSVList<char>    List ;
  80.  
  81.     NWDSCCODE    assign (NWSYNTAX_ID, void *) ;
  82.     NWDSCCODE    release(int index = DSCPP_DEF_INDEX) ;
  83.     NWDSCCODE    compare(DSValue *) ;
  84.  
  85.             DSVStringList()                { ; }
  86.             DSVStringList(NWSYNTAX_ID s, void * v)    { assign(s,v) ; }
  87.               ~    DSVStringList()                { release() ; }
  88.  
  89.     NWPSTR        text(int index = DSCPP_DEF_INDEX) ;
  90.     NWPSTR        operator[](int index)            { return List[index] ; }
  91.     void *        data()                    { return List.Head ; }
  92.     DSValueType    type()                    { return DSCPP_STRING_LIST ; }
  93.     WORD        count()                    { return List.Count ; }
  94. } ;
  95.  
  96. typedef DSVListNode<char>    DSVStringNode ;
  97. typedef    DSVListIterator<char>    DSVStringIterator ;
  98.  
  99. #endif dsVCHAR_H
  100.  
  101.