Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / TAO_IDL / include / utl_string.h
blobde9d488445652fba21d4ef4e75469d5eb2d90cf0
1 /*
3 COPYRIGHT
5 Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
6 States of America. All Rights Reserved.
8 This product is protected by copyright and distributed under the following
9 license restricting its use.
11 The Interface Definition Language Compiler Front End (CFE) is made
12 available for your use provided that you include this license and copyright
13 notice on all media and documentation and the software program in which
14 this product is incorporated in whole or part. You may copy and extend
15 functionality (but may not remove functionality) of the Interface
16 Definition Language CFE without charge, but you are not authorized to
17 license or distribute it to anyone else except as part of a product or
18 program developed by you or with the express written consent of Sun
19 Microsystems, Inc. ("Sun").
21 The names of Sun Microsystems, Inc. and any of its subsidiaries or
22 affiliates may not be used in advertising or publicity pertaining to
23 distribution of Interface Definition Language CFE as permitted herein.
25 This license is effective until terminated by Sun for failure to comply
26 with this license. Upon termination, you shall destroy or return all code
27 and documentation for the Interface Definition Language CFE.
29 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
30 ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
31 FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
32 DEALING, USAGE OR TRADE PRACTICE.
34 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
35 ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
36 TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
38 SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
39 RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
40 INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
42 IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
43 ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
44 DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
46 Use, duplication, or disclosure by the government is subject to
47 restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
48 Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
49 52.227-19.
51 Sun, Sun Microsystems and the Sun logo are trademarks or registered
52 trademarks of Sun Microsystems, Inc.
54 SunSoft, Inc.
55 2550 Garcia Avenue
56 Mountain View, California 94043
58 NOTE:
60 SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
61 trademarks or registered trademarks of Sun Microsystems, Inc.
65 #ifndef _STRING_STRING_HH
66 #define _STRING_STRING_HH
68 #include "TAO_IDL_FE_Export.h"
70 #include "ace/iosfwd.h"
71 /* Basic_Types.h are needed in QNX for size_t type. */
72 #include "ace/Basic_Types.h"
73 #include "ace/SStringfwd.h"
75 class TAO_IDL_FE_Export UTL_String
77 // =TITLE
78 // UTL_String
79 // =DESCRIPTION
80 // string class to store identifiers
81 public:
82 UTL_String ();
84 UTL_String (const char *str, bool take_copy= false);
86 UTL_String (UTL_String *s, bool force_copy= false);
88 virtual ~UTL_String ();
90 virtual void destroy ();
91 // Cleanup function.
93 virtual void dump (ACE_OSTREAM_TYPE &o);
94 // Dump to the ostream.
96 char *get_string () const {return this->p_str;}
97 // Get contents of utl_string.
99 char *get_canonical_rep ();
100 // Get canonical representation. This is (implemented as) the all upper
101 // case corresponding string.
103 bool compare (UTL_String *s);
104 // Compare two UTL_String *
106 bool compare_quiet (UTL_String *s);
107 // Like the above but without error or warning message output.
109 static bool strcmp_caseless (
110 const char *lhs,
111 const char *rhs,
112 bool &mixed_case);
113 // Caseless string compare returns true if match, mixed_case is
114 // true if match only true due to ignoring case differences.
116 static bool compare (const char *lhs, const char *rhs);
117 // Compare two const char * (like the UTL_String compare)
119 static bool compare_quiet (const char *lhs, const char *rhs);
120 // Like the above but without error or warning message output.
122 static void get_canonical_rep (const char *src, char *dest);
123 // Get canonical representation. This is (implemented as) the all upper
124 // case corresponding string.
126 static void get_canonical_rep (ACE_CString &cstr);
127 // Get canonical representation. This is (implemented as) the all upper
128 // case corresponding string.
130 private:
131 // Data
132 bool copy_taken;
133 // If delete needs to be called on destroy/delete
135 char *p_str;
136 // Storage for characters.
138 char *c_str;
139 // Storage for canonicalized string.
142 #endif // _STRING_STRING_HH