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 .
22 #include <rtl/ustring.hxx>
23 #include <unordered_map>
26 namespace filter::config
{
29 /** @short It can be used to split any query string (which can be used at the
30 related interface <type scope="css::container">XContainerQuery</type>)
31 into its different tokens using a fix schema.
33 @descr All queries implemented of the services
35 <li><type scope="css::document">TypeDetection</type></li>
36 <li><type scope="css::document">FilterFactory</type></li>
37 <li><type scope="css::document">ExtendedTypeDetectionFactory</type></li>
38 <li><type scope="css::frame">FrameLoaderFactory</type></li>
39 <li><type scope="css::frame">ContentHandlerFactory</type></li>
43 @attention This class is not threadsafe implemented. Because it's not necessary.
44 But you have to make sure that it's not used as such :-)
46 class QueryTokenizer
: public std::unordered_map
< OUString
, OUString
>
53 /** @short Because the given query can contain errors,
54 it should be checked outside.
56 TODO May it's a good idea to describe the real problem
66 /** @short create a new tokenizer instance with a
69 @descr The given query is immediately analyzed
70 and separated into its token, which can
71 be access by some specialized method later.
76 explicit QueryTokenizer(std::u16string_view sQuery
);
79 /** @short destruct an instance of this class.
81 virtual ~QueryTokenizer();
84 /** @short can be used to check if analyzing of given query
85 was successful or not.
90 } // namespace filter::config
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */