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/.
12 #include <sax/fastattribs.hxx>
13 #include <xmloff/token/tokens.hxx>
14 #include <sal/log.hxx>
16 namespace xmloff::token
{
20 /** Returns the UTF-8 name of the passed token identifier as byte sequence. */
21 css::uno::Sequence
<sal_Int8
> const& getUtf8TokenName(sal_Int32 nToken
);
23 /** Returns the token identifier for a UTF-8 string */
24 sal_Int32
getTokenFromUtf8(std::string_view token
);
27 class FastTokenHandler final
:
28 public sax_fastparser::FastTokenHandlerBase
31 explicit FastTokenHandler() = default;
34 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getUTF8Identifier( sal_Int32 nToken
) override
;
35 virtual sal_Int32 SAL_CALL
getTokenFromUTF8( const css::uno::Sequence
< sal_Int8
>& Identifier
) override
;
37 static const OUString
& getIdentifier(sal_Int32 nToken
);
39 // Much faster direct C++ shortcut to the method that matters
40 virtual sal_Int32
getTokenDirect(std::string_view token
) const override
;
43 } // namespace xmloff::token
45 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */