1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 //------------------------------------------------------------------------
25 //------------------------------------------------------------------------
26 
27 #ifndef _RTL_STRING_UTILS_HXX_
28 #define _RTL_STRING_UTILS_HXX_
29 
30 #ifdef __cplusplus
31 
32 //------------------------------------------------------------------------
33 //------------------------------------------------------------------------
34 
35 #include <math.h>
36 #include <stdlib.h>
37 
38 //------------------------------------------------------------------------
39 //------------------------------------------------------------------------
40 
41 #ifndef _SAL_TYPES_H_
42 	#include <sal/types.h>
43 #endif
44 
45 #ifndef _RTL_USTRING_H_
46 	#include <rtl/ustring.h>
47 #endif
48 
49 #ifndef _RTL_STRING_HXX_
50 	#include <rtl/string.hxx>
51 #endif
52 
53 //------------------------------------------------------------------------
54 //------------------------------------------------------------------------
55 sal_Char* cpystr( sal_Char* dst, const sal_Char* src );
56 sal_Char* cpynstr( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt );
57 
58 sal_Bool cmpstr( const sal_Char* str1, const sal_Char* str2, sal_uInt32 len );
59 sal_Bool cmpstr( const sal_Char* str1, const sal_Char* str2 );
60 sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2, sal_uInt32 len );
61 sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2 );
62 
63 sal_Char* createName( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt );
64 void makeComment(char *com, const char *str1, const char *str2, sal_Int32 sgn);
65 
66 
67 sal_uInt32 AStringLen( const sal_Char *pAStr );
68 
69 sal_uInt32 UStringLen( const sal_Unicode *pUStr );
70 
71 //------------------------------------------------------------------------
72 
73 sal_Bool AStringToFloatCompare ( const sal_Char  *pStr,
74                                  const float      nX,
75                                  const float      nEPS
76                                 );
77 
78 sal_Bool AStringToDoubleCompare ( const sal_Char  *pStr,
79                                   const double     nX,
80                                   const double     nEPS
81                                 );
82 
83 //------------------------------------------------------------------------
84 
85 sal_Bool AStringIsValid( const sal_Char  *pAStr );
86 
87 sal_Bool AStringNIsValid( const sal_Char   *pAStr,
88                           const sal_uInt32  nStrLen
89                         );
90 
91 //------------------------------------------------------------------------
92 
93 sal_Int32 AStringToUStringCompare( const sal_Unicode *pUStr,
94                                    const sal_Char    *pAStr
95                                  );
96 
97 sal_Int32 AStringToUStringNCompare( const sal_Unicode  *pUStr,
98                                     const sal_Char     *pAStr,
99                                     const sal_uInt32    nAStrCount
100                                    );
101 
102 sal_Int32 AStringToRTLUStringCompare( const rtl_uString  *pRTLUStr,
103                                       const sal_Char     *pAStr
104                                     );
105 
106 sal_Int32 AStringToRTLUStringNCompare( const rtl_uString  *pRTLUStr,
107                                        const sal_Char     *pAStr,
108                                        const sal_uInt32    nAStrCount
109                                      );
110 
111 //------------------------------------------------------------------------
112 
113 sal_Bool AStringToUStringCopy( sal_Unicode     *pDest,
114                                const sal_Char  *pSrc
115                              );
116 
117 sal_Bool AStringToUStringNCopy( sal_Unicode       *pDest,
118                                 const sal_Char    *pSrc,
119                                 const sal_uInt32   nSrcLen
120                               );
121 
122 //------------------------------------------------------------------------
123 //------------------------------------------------------------------------
124 
125 #endif /* __cplusplus */
126 
127 #endif /* _RTL_STRING_UTILS_HXX */
128 
129 
130 
131 
132 
133 
134 
135