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/.
10 #include "LuceneHelper.hxx"
12 std::vector
<TCHAR
> OUStringToTCHARVec(OUString
const &rStr
)
15 if (sizeof(TCHAR
) == sizeof(sal_Unicode
))
16 return std::vector
<TCHAR
>(rStr
.getStr(), rStr
.getStr() + rStr
.getLength() + 1);
19 std::vector
<TCHAR
> aRet
;
20 for (sal_Int32 nStrIndex
= 0; nStrIndex
< rStr
.getLength(); )
22 const sal_uInt32 nCode
= rStr
.iterateCodePoints(&nStrIndex
);
23 aRet
.push_back(nCode
);
29 OUString
TCHARArrayToOUString(TCHAR
const *str
)
32 if (sizeof(TCHAR
) == sizeof(sal_Unicode
))
33 return OUString(reinterpret_cast<const sal_Unicode
*>(str
));
36 return OUString(reinterpret_cast<const sal_uInt32
*>(str
), wcslen(str
));
39 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */