1 /*************************************************************************
2 #
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26 #*************************************************************************/
27 
28 //------------------------------------------------------------------------
29 //------------------------------------------------------------------------
30 
31 #ifndef _RTL_STRING_UTILS_HXX_
32 #define _RTL_STRING_UTILS_HXX_
33 
34 #ifdef __cplusplus
35 
36 //------------------------------------------------------------------------
37 //------------------------------------------------------------------------
38 
39 #include <math.h>
40 #include <stdlib.h>
41 
42 //------------------------------------------------------------------------
43 //------------------------------------------------------------------------
44 
45 #ifndef _SAL_TYPES_H_
46 	#include <sal/types.h>
47 #endif
48 
49 #ifndef _RTL_USTRING_H_
50 	#include <rtl/ustring.h>
51 #endif
52 
53 #ifndef _RTL_STRING_HXX_
54 	#include <rtl/string.hxx>
55 #endif
56 
57 //------------------------------------------------------------------------
58 //------------------------------------------------------------------------
59 sal_Char* cpystr( sal_Char* dst, const sal_Char* src );
60 sal_Char* cpynstr( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt );
61 
62 sal_Bool cmpstr( const sal_Char* str1, const sal_Char* str2, sal_uInt32 len );
63 sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2, sal_uInt32 len );
64 sal_Bool cmpustr( const sal_Unicode* str1, const sal_Unicode* str2 );
65 
66 sal_Char* createName( sal_Char* dst, const sal_Char* src, sal_uInt32 cnt );
67 void makeComment(char *com, const char *str1, const char *str2, sal_Int32 sgn);
68 
69 
70 sal_uInt32 AStringLen( const sal_Char *pAStr );
71 
72 sal_uInt32 UStringLen( const sal_Unicode *pUStr );
73 
74 //------------------------------------------------------------------------
75 
76 sal_Bool AStringToFloatCompare ( const sal_Char  *pStr,
77                                  const float      nX,
78                                  const float      nEPS
79                                 );
80 
81 sal_Bool AStringToDoubleCompare ( const sal_Char  *pStr,
82                                   const double     nX,
83                                   const double     nEPS
84                                 );
85 
86 //------------------------------------------------------------------------
87 
88 sal_Bool AStringIsValid( const sal_Char  *pAStr );
89 
90 sal_Bool AStringNIsValid( const sal_Char   *pAStr,
91                           const sal_uInt32  nStrLen
92                         );
93 
94 //------------------------------------------------------------------------
95 
96 sal_Int32 AStringToUStringCompare( const sal_Unicode *pUStr,
97                                    const sal_Char    *pAStr
98                                  );
99 
100 sal_Int32 AStringToUStringNCompare( const sal_Unicode  *pUStr,
101                                     const sal_Char     *pAStr,
102                                     const sal_uInt32    nAStrCount
103                                    );
104 
105 sal_Int32 AStringToRTLUStringCompare( const rtl_uString  *pRTLUStr,
106                                       const sal_Char     *pAStr
107                                     );
108 
109 sal_Int32 AStringToRTLUStringNCompare( const rtl_uString  *pRTLUStr,
110                                        const sal_Char     *pAStr,
111                                        const sal_uInt32    nAStrCount
112                                      );
113 
114 //------------------------------------------------------------------------
115 
116 sal_Bool AStringToUStringCopy( sal_Unicode     *pDest,
117                                const sal_Char  *pSrc
118                              );
119 
120 sal_Bool AStringToUStringNCopy( sal_Unicode       *pDest,
121                                 const sal_Char    *pSrc,
122                                 const sal_uInt32   nSrcLen
123                               );
124 
125 //------------------------------------------------------------------------
126 //------------------------------------------------------------------------
127 
128 #endif /* __cplusplus */
129 
130 #endif /* _RTL_STRING_UTILS_HXX */
131 
132 
133 
134 
135 
136 
137 
138