1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <osl/interlck.h>
21 #include <rtl/character.hxx>
22 #include <rtl/ustrbuf.h>
26 #define RTL_LOG_STRING_BITS 16
29 #include "strtmpl.hxx"
31 void SAL_CALL
rtl_uStringbuffer_newFromStr_WithLength( rtl_uString
** newStr
,
32 const sal_Unicode
* value
,
35 rtl::str::stringbuffer_newFromStr_WithLength(newStr
, value
, count
);
38 rtl_uString
* SAL_CALL
rtl_uStringBuffer_refReturn( rtl_uString
* pThis
)
40 RTL_LOG_STRING_NEW( pThis
);
41 rtl::str::acquire( pThis
);
45 rtl_uString
* SAL_CALL
rtl_uStringBuffer_makeStringAndClear( rtl_uString
** ppThis
,
46 sal_Int32
*nCapacity
)
50 // avoid an un-necessary atomic ref/unref pair
51 rtl_uString
*pStr
= *ppThis
;
54 rtl::str::new_(ppThis
);
57 RTL_LOG_STRING_NEW( pStr
);
62 sal_Int32 SAL_CALL
rtl_uStringbuffer_newFromStringBuffer( rtl_uString
** newStr
,
64 rtl_uString
* oldStr
)
66 return rtl::str::stringbuffer_newFromStringBuffer(newStr
, capacity
, oldStr
);
69 void SAL_CALL rtl_uStringbuffer_ensureCapacity
70 (rtl_uString
** This
, sal_Int32
* capacity
, sal_Int32 minimumCapacity
)
72 rtl::str::stringbuffer_ensureCapacity(This
, capacity
, minimumCapacity
);
75 void SAL_CALL
rtl_uStringbuffer_insert( rtl_uString
** This
,
78 const sal_Unicode
* str
,
81 rtl::str::stringbuffer_insert(This
, capacity
, offset
, str
, len
);
84 void rtl_uStringbuffer_insertUtf32(
85 rtl_uString
** pThis
, sal_Int32
* capacity
, sal_Int32 offset
, sal_uInt32 c
)
89 sal_Int32 len
= rtl::splitSurrogates(c
, buf
);
90 rtl::str::stringbuffer_insert(pThis
, capacity
, offset
, buf
, len
);
93 void SAL_CALL
rtl_uStringbuffer_insert_ascii( /*inout*/rtl_uString
** This
,
94 /*inout*/sal_Int32
* capacity
,
99 rtl::str::stringbuffer_insert(This
, capacity
, offset
, str
, len
);
102 /*************************************************************************
103 * rtl_uStringbuffer_remove
105 void SAL_CALL
rtl_uStringbuffer_remove( rtl_uString
** This
,
109 rtl::str::stringbuffer_remove(This
, start
, len
);
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */