home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ivbstrng.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  8.3 KB  |  192 lines

  1. #ifndef _IVBSTRNG_
  2.   #define _IVBSTRNG_
  3. /*******************************************************************************
  4. * FILE NAME: ivbstrng.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    IVBStringPart - IBM VB sample string part.                                *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM(R) VisualAge(TM) for C++                                               *
  12. *   (C) Copyright International Business Machines Corporation 1991, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *   This program will not run in DOS mode.                                     *
  18. *                                                                              *
  19. * DISCLAIMER OF WARRANTIES:                                                    *
  20. *   The following [enclosed] code is sample code created by IBM                *
  21. *   Corporation.  This sample code is not part of any standard IBM product     *
  22. *   and is provided to you solely for the purpose of assisting you in the      *
  23. *   development of your applications.  The code is provided "AS IS",           *
  24. *   without warranty of any kind.  IBM shall not be liable for any damages     *
  25. *   arising out of your use of the sample code, even if they have been         *
  26. *   advised of the possibility of such damages.                                *
  27. *******************************************************************************/
  28.  
  29. #ifndef _IVBDTYPE_
  30.   #include <ivbdtype.hpp>
  31. #endif
  32.  
  33. #ifndef _ISTRING_
  34.   #include <istring.hpp>
  35. #endif
  36.  
  37. /*-------------------------- Pragma Library Support --------------------------*/
  38. #ifndef __NO_DEFAULT_LIBS__
  39.   #ifdef __OS2__
  40.     #ifdef __IMPORTLIB__
  41.        #pragma library("CPPOV03I.LIB")
  42.     #else
  43.        #pragma library("CPPOV03.LIB")
  44.     #endif
  45.   #endif
  46.   #ifdef __WINDOWS__
  47.     #ifdef __IMPORTLIB__
  48.        #pragma library("CPPWV03I.LIB")
  49.     #else
  50.        #pragma library("CPPWV03.LIB")
  51.     #endif
  52.   #endif
  53. #endif
  54.  
  55.  
  56. /*----------------------------------------------------------------------------*/
  57. /* Align classes on four byte boundary.                                       */
  58. /*----------------------------------------------------------------------------*/
  59. #pragma pack(4)
  60.  
  61. class IVBStringPart : public IVBDataTypePart
  62. {
  63. typedef IVBDataTypePart
  64.   Inherited;
  65. public:
  66. /*--------------------------- PUBLIC -----------------------------------------*/
  67.  
  68. /*------------------------- Constructors/Destructor ----------------------------
  69. ------------------------------------------------------------------------------*/
  70.   IVBStringPart (const IString& text = IString());
  71.   IVBStringPart (const IVBStringPart& partCopy);
  72. virtual
  73.   ~IVBStringPart ();
  74.  
  75. /*-------------------------------- Operators -----------------------------------
  76. |   operator ==       - Operator == (return true if equal).                    |
  77. |   operator !=       - Operator != (return true if not equal).                |
  78. ------------------------------------------------------------------------------*/
  79.   IVBStringPart& operator= (const IVBStringPart& aIVBStringPart);
  80. Boolean
  81.   operator == (const IVBStringPart& aValue) const,
  82.   operator != (const IVBStringPart& aValue) const,
  83.   operator == (const IVBStringPart* aValue) const,
  84.   operator != (const IVBStringPart* aValue) const;
  85.  
  86. #ifdef __OS2__
  87. virtual IString
  88.   asString    ( ) const;
  89. #endif
  90.  
  91. /*-------------------------------- Attributes ----------------------------------
  92. | List of query and set members functions for this class:                      |
  93. |                                                                              |
  94. |   text              - Query the text (IString) attribute.                    |
  95. |   textAsLowerCase   - Query the textAsLowerCase (IString) attribute.         |
  96. |   textAsUpperCase   - Query the textAsUpperCase (IString) attribute.         |
  97. |   defaultText       - Query the defaultText (IString) attribute.             |
  98. |   isTextEqualDefault - Query the textEqualDefault (Boolean) attribute.       |
  99. |   isTextNotEqualDefault - Query the textNotEqualDefault (Boolean) attribute. |
  100. |   textLength        - Query the textLength (unsigned long) attribute.             |
  101. |   isLowerCase       - Query the lowerCase (Boolean) attribute.               |
  102. |   isUpperCase       - Query the upperCase (Boolean) attribute.               |
  103. |   isDigits          - Query the digits (Boolean) attribute.                  |
  104. |   setText           - Set the text (IString) attribute.                      |
  105. |   setDefaultText    - Set the defaultText (IString) attribute.               |
  106. ------------------------------------------------------------------------------*/
  107.  
  108. virtual IString
  109.   text () const;
  110. virtual IVBStringPart
  111.  &setText (const IString& text),
  112.  &setText ();
  113.  
  114. virtual IString
  115.   textAsLowerCase () const;
  116.  
  117. virtual IString
  118.   textAsUpperCase () const;
  119.  
  120. virtual IString
  121.   defaultText () const;
  122. virtual IVBStringPart
  123.  &setDefaultText (const IString& defaultText = false);
  124.  
  125. virtual Boolean
  126.   isTextEqualDefault () const;
  127.  
  128. virtual Boolean
  129.   isTextNotEqualDefault () const;
  130.  
  131. virtual unsigned long
  132.   textLength () const;
  133.  
  134. virtual Boolean
  135.   isLowerCase () const;
  136.  
  137. virtual Boolean
  138.   isUpperCase () const;
  139.  
  140. virtual Boolean
  141.   isDigits () const;
  142.  
  143. /*-------------------------------- Actions -------------------------------------
  144. | List of operations or services provided by this class:                       |
  145. |                                                                              |
  146. |   assignTextToEmpty               - Assign text attribute to empty.          |
  147. |   assignTextToDateToday           - Assign text to today's date.             |
  148. |   assignTextToTimeNow             - Assign text to time now.                 |
  149. |   assignTextToCmdLineParm0           - Set text to command line parm 0. |
  150. |   assignTextToCmdLineParm1           - Set text to command line parm 1. |
  151. |   assignTextToDefault             - Assign the text attribute to false. |
  152. |   changeTextToLowerCase           - Change the text to lower case.           |
  153. |   changeTextToUpperCase           - Change the text to upper case.           |
  154. |   reverseText                     - Perform reverse on text.                 |
  155. |   stripBlanksOnText               - Strip blanks on text.                    |
  156. |   appendText                      - Append to the end of text.               |
  157. |   preappendText                   - Add to the beginning of text.            |
  158. ------------------------------------------------------------------------------*/
  159.  
  160. virtual IVBStringPart
  161.  &assignTextToEmpty (),
  162.  &assignTextToDateToday (),
  163.  &assignTextToTimeNow (),
  164.  &assignTextToCmdLineParm0 (),
  165.  &assignTextToCmdLineParm1 (),
  166.  &assignTextToDefault (),
  167.  &changeTextToLowerCase (),
  168.  &changeTextToUpperCase (),
  169.  &reverseText (),
  170.  &stripBlanksOnText (),
  171.  &appendText (const IString& appendText),
  172.  &preappendText (const IString& appendText);
  173.  
  174. /*----------------------- Notification Event Descriptions ----------------------
  175. | List of attribute and event notification identifiers:                        |
  176. |                                                                              |
  177. ------------------------------------------------------------------------------*/
  178.  
  179.  
  180. private:
  181. /*--------------------------- PRIVATE ----------------------------------------*/
  182.   IString iText;                        //Data member for text attribute
  183.   IString iDefaultText;                 //Data member for defaultText attribute
  184. };
  185.  
  186. /*----------------------------------------------------------------------------*/
  187. /* Resume compiler default packing.                                           */
  188. /*----------------------------------------------------------------------------*/
  189. #pragma pack()
  190.  
  191. #endif
  192.