1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
10 #include <rtl/strbuf.hxx>
11 #include <rtl/string.hxx>
12 #include <rtl/ustrbuf.hxx>
13 #include <rtl/ustring.hxx>
15 // ---------------------------------------------------------------
16 // replacing OUStringBuffer.append sequences to OUString+
21 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
28 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
30 v
.append("xxx").append("aaaa");
32 void f3(OString class_name
)
34 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
35 OStringBuffer
sig_buf(5 + class_name
.getLength());
36 sig_buf
.append("(I)L");
37 //sig_buf.append( class_name.replace( '.', '/' ) );
39 OString
sig(sig_buf
.makeStringAndClear());
42 void f4(sal_Unicode
const* pPathBegin
)
44 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
46 v
.append(pPathBegin
, 12);
49 void f5(OUStringBuffer
& input
)
51 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
52 OUStringBuffer
v(input
);
55 void f6(OString
const& s
)
57 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
58 OUStringBuffer
b("foo");
59 b
.append(OStringToOUString(s
, RTL_TEXTENCODING_ASCII_US
));
63 OStringBuffer m_descriptorStart
;
64 OString m_descriptorEnd
;
67 // expected-error@+1 {{convert this append sequence into a *String + sequence [loplugin:bufferadd]}}
68 OStringBuffer
buf(m_descriptorStart
);
69 buf
.append(m_descriptorEnd
);
70 return buf
.makeStringAndClear();
79 // no warning expected
85 void appendTo(OUStringBuffer
&);
88 // no warning expected
95 // no warning expected
102 // no warning expected
109 // no warning expected
110 OUStringBuffer
noel1("xxx");
112 noel1
.append("ffff").append("aaa");
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */