Bump version to 5.0-14
[LibreOffice.git] / filter / source / config / cache / querytokenizer.hxx
blobcb754e5a2c6a981088314f2cae81b8b117faac12
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
27 namespace filter{
28 namespace config{
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
36 <ul>
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>
42 </ul>
43 uses this schema.
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 ,
49 OUString ,
50 OUStringHash ,
51 std::equal_to< OUString > >
54 // member
56 private:
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
62 more detailed ...
64 bool m_bValid;
67 // interface
69 public:
71 /** @short create a new tokenizer instance with a
72 a new query.
74 @descr The given query is immidiatly analyzed
75 and separated into its token, which can
76 be access by some specialized method later.
78 @param sQuery
79 the query string.
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.
94 bool valid() const;
97 } // namespace config
98 } // namespace filter
100 #endif // INCLUDED_FILTER_SOURCE_CONFIG_CACHE_QUERYTOKENIZER_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */