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