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 #ifndef INCLUDED_FILTER_SOURCE_CONFIG_CACHE_QUERYTOKENIZER_HXX
21 #define INCLUDED_FILTER_SOURCE_CONFIG_CACHE_QUERYTOKENIZER_HXX
23 #include <rtl/ustring.hxx>
24 #include <unordered_map>
31 /** @short It can be used to split any query string (which can be used at the
32 related interface <type scope="com::sun::star::container">XContainerQuery</type>)
33 into its different tokens using a fix schema.
35 @descr All queries implemented of the services
37 <li><type scope="com::sun::star::document">TypeDetection</type></li>
38 <li><type scope="com::sun::star::document">FilterFactory</type></li>
39 <li><type scope="com::sun::star::document">ExtendedTypeDetectionFactory</type></li>
40 <li><type scope="com::sun::star::frame">FrameLoaderFactory</type></li>
41 <li><type scope="com::sun::star::frame">ContentHandlerFactory</type></li>
45 @attention This class is not threadsafe implemented. Because its not necessary.
46 But you have to make sure, that ist not used as such :-)
48 class QueryTokenizer
: public std::unordered_map
< OUString
,
51 std::equal_to
< OUString
> >
58 /** @short Because the given query can contain errors,
59 it should be checked outside.
61 TODO May it's a good idea to describe the real problem
71 /** @short create a new tokenizer instance with a
74 @descr The given query is immidiatly analyzed
75 and separated into its token, which can
76 be access by some specialized method later.
81 QueryTokenizer(const OUString
& sQuery
);
85 /** @short destruct an instance of this class.
87 virtual ~QueryTokenizer();
91 /** @short can be used to check if analyzing of given query
92 was successfully or not.
100 #endif // INCLUDED_FILTER_SOURCE_CONFIG_CACHE_QUERYTOKENIZER_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */