xref: /trunk/main/framework/inc/classes/wildcard.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1f8e07b45SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f8e07b45SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f8e07b45SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f8e07b45SAndrew Rist  * distributed with this work for additional information
6f8e07b45SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f8e07b45SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f8e07b45SAndrew Rist  * "License"); you may not use this file except in compliance
9f8e07b45SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11f8e07b45SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13f8e07b45SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f8e07b45SAndrew Rist  * software distributed under the License is distributed on an
15f8e07b45SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e07b45SAndrew Rist  * KIND, either express or implied.  See the License for the
17f8e07b45SAndrew Rist  * specific language governing permissions and limitations
18f8e07b45SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20f8e07b45SAndrew Rist  *************************************************************/
21f8e07b45SAndrew Rist 
22f8e07b45SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef __FRAMEWORK_CLASSES_WILDCARD_HXX_
25cdf0e10cSrcweir #define __FRAMEWORK_CLASSES_WILDCARD_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //_________________________________________________________________________________________________________________
28cdf0e10cSrcweir //  my own includes
29cdf0e10cSrcweir //_________________________________________________________________________________________________________________
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <macros/debug.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir //_________________________________________________________________________________________________________________
34cdf0e10cSrcweir //  interface includes
35cdf0e10cSrcweir //_________________________________________________________________________________________________________________
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //_________________________________________________________________________________________________________________
38cdf0e10cSrcweir //  other includes
39cdf0e10cSrcweir //_________________________________________________________________________________________________________________
40cdf0e10cSrcweir #include <rtl/ustring.hxx>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //_________________________________________________________________________________________________________________
43cdf0e10cSrcweir //  const
44cdf0e10cSrcweir //_________________________________________________________________________________________________________________
45cdf0e10cSrcweir 
46cdf0e10cSrcweir //_________________________________________________________________________________________________________________
47cdf0e10cSrcweir //  namespace
48cdf0e10cSrcweir //_________________________________________________________________________________________________________________
49cdf0e10cSrcweir 
50cdf0e10cSrcweir namespace framework{
51cdf0e10cSrcweir 
52cdf0e10cSrcweir //_________________________________________________________________________________________________________________
53cdf0e10cSrcweir //  declarations
54cdf0e10cSrcweir //_________________________________________________________________________________________________________________
55cdf0e10cSrcweir 
56cdf0e10cSrcweir /*-************************************************************************************************************//**
57cdf0e10cSrcweir     @short          implement wildcard-mechanism for unicode
58cdf0e10cSrcweir     @descr          This class can be used to get information about the matching of a pattern to a given text.
59cdf0e10cSrcweir                     It's suitable for 8-Bit- AND 16-Bit-strings!
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     @implements     -
62cdf0e10cSrcweir     @base           -
63cdf0e10cSrcweir 
64cdf0e10cSrcweir     @ATTENTION      This class is'nt threadsafe!
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     @devstatus      deprecated
67cdf0e10cSrcweir *//*-*************************************************************************************************************/
68cdf0e10cSrcweir 
69cdf0e10cSrcweir class Wildcard
70cdf0e10cSrcweir {
71cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
72cdf0e10cSrcweir     //  public methods
73cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     public:
76cdf0e10cSrcweir 
77cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
78cdf0e10cSrcweir         //  constructor / destructor
79cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
80cdf0e10cSrcweir 
81cdf0e10cSrcweir         /*-****************************************************************************************************//**
82cdf0e10cSrcweir             @short      standard ctor
83cdf0e10cSrcweir             @descr      We do nothing here.
84cdf0e10cSrcweir 
85cdf0e10cSrcweir             @seealso    -
86cdf0e10cSrcweir 
87cdf0e10cSrcweir             @param      -
88cdf0e10cSrcweir             @return     -
89cdf0e10cSrcweir 
90cdf0e10cSrcweir             @onerror    -
91cdf0e10cSrcweir         *//*-*****************************************************************************************************/
92cdf0e10cSrcweir 
93cdf0e10cSrcweir         Wildcard();
94cdf0e10cSrcweir 
95cdf0e10cSrcweir         /*-****************************************************************************************************//**
96cdf0e10cSrcweir             @short      standard dtor
97cdf0e10cSrcweir             @descr      We do nothing here.
98cdf0e10cSrcweir 
99cdf0e10cSrcweir             @seealso    -
100cdf0e10cSrcweir 
101cdf0e10cSrcweir             @param      -
102cdf0e10cSrcweir             @return     -
103cdf0e10cSrcweir 
104cdf0e10cSrcweir             @onerror    -
105cdf0e10cSrcweir         *//*-*****************************************************************************************************/
106cdf0e10cSrcweir 
107cdf0e10cSrcweir         virtual ~Wildcard();
108cdf0e10cSrcweir 
109cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
110cdf0e10cSrcweir         //  interface
111cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
112cdf0e10cSrcweir 
113cdf0e10cSrcweir         /*-****************************************************************************************************//**
114cdf0e10cSrcweir             @short      try to find an agreement between given text and searchpattern
115cdf0e10cSrcweir             @descr      You can use wildcards in pattern only!
116cdf0e10cSrcweir 
117cdf0e10cSrcweir             @seealso    -
118cdf0e10cSrcweir 
119cdf0e10cSrcweir             @param      "sText" is the text, in which we search given pattern.
120cdf0e10cSrcweir             @param      "sPattern" is the searched pattern with includes wildcards.
121cdf0e10cSrcweir             @return     sal_True , if pattern was found.
122cdf0e10cSrcweir             @return     sal_False, if pattern don't match the text.
123cdf0e10cSrcweir 
124cdf0e10cSrcweir             @onerror    -
125cdf0e10cSrcweir         *//*-*****************************************************************************************************/
126cdf0e10cSrcweir 
127cdf0e10cSrcweir         static sal_Bool match(  const   ::rtl::OUString&    sText       ,
128cdf0e10cSrcweir                                 const   ::rtl::OUString&    sPattern    );
129cdf0e10cSrcweir 
130cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
131cdf0e10cSrcweir         //  debug and test methods
132cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
133cdf0e10cSrcweir 
134cdf0e10cSrcweir         /*-****************************************************************************************************//**
135*ad1df53dSJohn Bampton             @short      debug-methods to check incoming parameter of some other methods of this class
136cdf0e10cSrcweir             @descr      The follow methods are used to check parameters for other methods
137cdf0e10cSrcweir                         of this class. The return value is used directly for an ASSERT(...).
138cdf0e10cSrcweir                         This mechanism is active in debug version only!
139cdf0e10cSrcweir 
140cdf0e10cSrcweir             @seealso    FRAMEWORK_ASSERT in implementation!
141cdf0e10cSrcweir 
142cdf0e10cSrcweir             @param      references to checking variables
143cdf0e10cSrcweir             @return     sal_False on invalid parameter
144cdf0e10cSrcweir             @return     sal_True otherwise
145cdf0e10cSrcweir 
146cdf0e10cSrcweir             @onerror    -
147cdf0e10cSrcweir         *//*-*****************************************************************************************************/
148cdf0e10cSrcweir 
149cdf0e10cSrcweir         #ifdef ENABLE_ASSERTIONS
150cdf0e10cSrcweir 
151cdf0e10cSrcweir         static sal_Bool impldbg_checkParameter_match(   const   ::rtl::OUString&    sText       ,
152cdf0e10cSrcweir                                                         const   ::rtl::OUString&    sPattern    );
153cdf0e10cSrcweir 
154cdf0e10cSrcweir         #endif  // #ifdef ENABLE_ASSERTIONS
155cdf0e10cSrcweir 
156cdf0e10cSrcweir         /*-****************************************************************************************************//**
157cdf0e10cSrcweir             @short      test implementation of match() with different examples
158cdf0e10cSrcweir             @descr      If TESTMODE activated, you cann call these method to start and log some special examples.
159cdf0e10cSrcweir                         Do this if you have changed the implementation of method match() to test it.
160cdf0e10cSrcweir 
161cdf0e10cSrcweir             @seealso    -
162cdf0e10cSrcweir 
163cdf0e10cSrcweir             @param      -
164cdf0e10cSrcweir             @return     -
165cdf0e10cSrcweir 
166cdf0e10cSrcweir             @onerror    Error-conditions are written to file or show in a messagebox.
167cdf0e10cSrcweir                         Thhat depends from current setting of ASSERT_OUTPUTTYPE. (see debug.hxx for further informations.)
168cdf0e10cSrcweir         *//*-*****************************************************************************************************/
169cdf0e10cSrcweir 
170cdf0e10cSrcweir         #ifdef ENABLE_CLASSDEBUG
171cdf0e10cSrcweir 
172cdf0e10cSrcweir         void impldbg_testWildcard();
173cdf0e10cSrcweir 
174cdf0e10cSrcweir         #endif // #ifdef ENABLE_CLASSDEBUG
175cdf0e10cSrcweir 
176cdf0e10cSrcweir };      //  class Wildcard
177cdf0e10cSrcweir 
178cdf0e10cSrcweir }       //  namespace framework
179cdf0e10cSrcweir 
180cdf0e10cSrcweir #endif  //  #ifndef __FRAMEWORK_CLASSES_WILDCARD_HXX_
181