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 cmpustr( const sal_Unicode* str1, const sal_Unicode* str2, sal_uInt32 len );
60 sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2 );
61 
62 sal_Char* createName( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt );
63 void makeComment(char *com, const char *str1, const char *str2, sal_Int32 sgn);
64 
65 
66 sal_uInt32 AStringLen( const sal_Char *pAStr );
67 
68 sal_uInt32 UStringLen( const sal_Unicode *pUStr );
69 
70 //------------------------------------------------------------------------
71 
72 sal_Bool AStringToFloatCompare ( const sal_Char  *pStr,
73                                  const float      nX,
74                                  const float      nEPS
75                                 );
76 
77 sal_Bool AStringToDoubleCompare ( const sal_Char  *pStr,
78                                   const double     nX,
79                                   const double     nEPS
80                                 );
81 
82 //------------------------------------------------------------------------
83 
84 sal_Bool AStringIsValid( const sal_Char  *pAStr );
85 
86 sal_Bool AStringNIsValid( const sal_Char   *pAStr,
87                           const sal_uInt32  nStrLen
88                         );
89 
90 //------------------------------------------------------------------------
91 
92 sal_Int32 AStringToUStringCompare( const sal_Unicode *pUStr,
93                                    const sal_Char    *pAStr
94                                  );
95 
96 sal_Int32 AStringToUStringNCompare( const sal_Unicode  *pUStr,
97                                     const sal_Char     *pAStr,
98                                     const sal_uInt32    nAStrCount
99                                    );
100 
101 sal_Int32 AStringToRTLUStringCompare( const rtl_uString  *pRTLUStr,
102                                       const sal_Char     *pAStr
103                                     );
104 
105 sal_Int32 AStringToRTLUStringNCompare( const rtl_uString  *pRTLUStr,
106                                        const sal_Char     *pAStr,
107                                        const sal_uInt32    nAStrCount
108                                      );
109 
110 //------------------------------------------------------------------------
111 
112 sal_Bool AStringToUStringCopy( sal_Unicode     *pDest,
113                                const sal_Char  *pSrc
114                              );
115 
116 sal_Bool AStringToUStringNCopy( sal_Unicode       *pDest,
117                                 const sal_Char    *pSrc,
118                                 const sal_uInt32   nSrcLen
119                               );
120 
121 //------------------------------------------------------------------------
122 //------------------------------------------------------------------------
123 
124 #endif /* __cplusplus */
125 
126 #endif /* _RTL_STRING_UTILS_HXX */
127 
128 
129 
130 
131 
132 
133 
134