INTEGRATION: CWS salstrintern (1.17.94); FILE MERGED

2007/03/12 10:27:28 mmeeks 1.17.94.6: fix sb quibbling.
2007/02/08 17:05:25 mmeeks 1.17.94.5: more comments from Stefan.
2007/02/08 15:19:19 mmeeks 1.17.94.4: Issue number: i#73909#
Submitted by: mmeeks
More cleanups from Stefan, remove debugging getenv after measurement.
2007/02/07 14:45:34 mmeeks 1.17.94.3: Issue number: i#73909#
Submitted by: mmeeks
Reviewed by:  sb
A load of fixes for Stefan, thanks for the review.
2007/01/26 15:07:02 mmeeks 1.17.94.2: Issue number: i#73908#
Submitted by: mmeeks

Add 'intern' regression tests, add new RTL_CONSTASCII foo static string magic.
2007/01/25 17:56:36 mmeeks 1.17.94.1: Start of OUString interning.
This commit is contained in:
Rüdiger Timm 2007-04-03 13:04:17 +00:00
parent 8f7f4f96e2
commit 9874094bce

View file

@ -4,9 +4,9 @@
*
* $RCSfile: ustring.h,v $
*
* $Revision: 1.17 $
* $Revision: 1.18 $
*
* last change: $Author: hr $ $Date: 2006-06-20 04:14:53 $
* last change: $Author: rt $ $Date: 2007-04-03 14:04:17 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@ -39,6 +39,9 @@
#ifndef _SAL_TYPES_H_
#include <sal/types.h>
#endif
#ifndef _OSL_INTERLOCK_H_
#include <osl/interlck.h>
#endif
#ifndef _RTL_STRING_H_
#include <rtl/string.h>
#endif
@ -1030,9 +1033,9 @@ double SAL_CALL rtl_ustr_toDouble( const sal_Unicode * str ) SAL_THROW_EXTERN_C(
*/
typedef struct _rtl_uString
{
sal_Int32 refCount;
sal_Int32 length;
sal_Unicode buffer[1];
oslInterlockedCount refCount; /* opaque */
sal_Int32 length;
sal_Unicode buffer[1];
} rtl_uString;
#ifdef SAL_W32
@ -1431,6 +1434,73 @@ sal_Int32 SAL_CALL rtl_uString_getToken( rtl_uString ** newStr , rtl_uString * s
*/
void SAL_CALL rtl_string2UString( rtl_uString ** newStr, const sal_Char * str, sal_Int32 len, rtl_TextEncoding encoding, sal_uInt32 convertFlags ) SAL_THROW_EXTERN_C();
/* ======================================================================= */
/* Interning methods */
/** Return a canonical representation for a string.
A pool of strings, initially empty is maintained privately
by the string class. On invocation, if present in the pool
the original string will be returned. Otherwise this string,
or a copy thereof will be added to the pool and returned.
@param newStr
pointer to the new string. The pointed-to data must be null or a valid
string.
If an out-of-memory condition occurs, newStr will point to a null pointer
upon return.
@param str
pointer to the string to be interned.
@since UDK 3.2.7
*/
void SAL_CALL rtl_uString_intern( rtl_uString ** newStr,
rtl_uString * str) SAL_THROW_EXTERN_C();
/** Return a canonical representation for a string.
A pool of strings, initially empty is maintained privately
by the string class. On invocation, if present in the pool
the original string will be returned. Otherwise this string,
or a copy thereof will be added to the pool and returned.
@param newStr
pointer to the new string. The pointed-to data must be null or a valid
string.
If an out-of-memory condition occurs, newStr will point to a null pointer
upon return.
@param str
a byte character array. Need not be null-terminated, but must be at
least as long as the specified len.
@param len
the length of the byte character array.
@param encoding
the text encoding to use for conversion.
@param convertFlags
flags which control the conversion. Either use
OSTRING_TO_OUSTRING_CVTFLAGS, or see
<http://udk.openoffice.org/cpp/man/spec/textconversion.html> for more
details.
@param pInfo
pointer to return conversion status in, or NULL.
@since UDK 3.2.7
*/
void SAL_CALL rtl_uString_internConvert( rtl_uString ** newStr,
const sal_Char * str,
sal_Int32 len,
rtl_TextEncoding encoding,
sal_uInt32 convertFlags,
sal_uInt32 *pInfo) SAL_THROW_EXTERN_C();
#ifdef __cplusplus
}
#endif