1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: wildcard.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_CLASSES_WILDCARD_HXX_
32 #define __FRAMEWORK_CLASSES_WILDCARD_HXX_
34 //_________________________________________________________________________________________________________________
36 //_________________________________________________________________________________________________________________
38 #include <macros/debug.hxx>
40 //_________________________________________________________________________________________________________________
42 //_________________________________________________________________________________________________________________
44 //_________________________________________________________________________________________________________________
46 //_________________________________________________________________________________________________________________
47 #include <rtl/ustring.hxx>
49 //_________________________________________________________________________________________________________________
51 //_________________________________________________________________________________________________________________
53 //_________________________________________________________________________________________________________________
55 //_________________________________________________________________________________________________________________
59 //_________________________________________________________________________________________________________________
61 //_________________________________________________________________________________________________________________
63 /*-************************************************************************************************************//**
64 @short implement wildcard-mechanism for unicode
65 @descr This class can be used to get information about the matching of a pattern to a given text.
66 It's suitable for 8-Bit- AND 16-Bit-strings!
71 @ATTENTION This class is'nt threadsafe!
74 *//*-*************************************************************************************************************/
78 //-------------------------------------------------------------------------------------------------------------
80 //-------------------------------------------------------------------------------------------------------------
84 //---------------------------------------------------------------------------------------------------------
85 // constructor / destructor
86 //---------------------------------------------------------------------------------------------------------
88 /*-****************************************************************************************************//**
90 @descr We do nothing here.
98 *//*-*****************************************************************************************************/
102 /*-****************************************************************************************************//**
104 @descr We do nothing here.
112 *//*-*****************************************************************************************************/
116 //---------------------------------------------------------------------------------------------------------
118 //---------------------------------------------------------------------------------------------------------
120 /*-****************************************************************************************************//**
121 @short try to find an agreement between given text and searchpattern
122 @descr You can use wildcards in pattern only!
126 @param "sText" is the text, in which we search given pattern.
127 @param "sPattern" is the searched pattern with includes wildcards.
128 @return sal_True , if pattern was found.
129 @return sal_False, if pattern don't match the text.
132 *//*-*****************************************************************************************************/
134 static sal_Bool
match( const ::rtl::OUString
& sText
,
135 const ::rtl::OUString
& sPattern
);
137 //---------------------------------------------------------------------------------------------------------
138 // debug and test methods
139 //---------------------------------------------------------------------------------------------------------
141 /*-****************************************************************************************************//**
142 @short debug-methods to check incoming parameter of some other mehods of this class
143 @descr The follow methods are used to check parameters for other methods
144 of this class. The return value is used directly for an ASSERT(...).
145 This mechanism is active in debug version only!
147 @seealso FRAMEWORK_ASSERT in implementation!
149 @param references to checking variables
150 @return sal_False on invalid parameter
151 @return sal_True otherwise
154 *//*-*****************************************************************************************************/
156 #ifdef ENABLE_ASSERTIONS
158 static sal_Bool
impldbg_checkParameter_match( const ::rtl::OUString
& sText
,
159 const ::rtl::OUString
& sPattern
);
161 #endif // #ifdef ENABLE_ASSERTIONS
163 /*-****************************************************************************************************//**
164 @short test implementation of match() with different examples
165 @descr If TESTMODE activated, you cann call these method to start and log some special examples.
166 Do this if you have changed the implementation of method match() to test it.
173 @onerror Error-conditions are written to file or show in a messagebox.
174 Thhat depends from current setting of ASSERT_OUTPUTTYPE. (see debug.hxx for further informations.)
175 *//*-*****************************************************************************************************/
177 #ifdef ENABLE_CLASSDEBUG
179 void impldbg_testWildcard();
181 #endif // #ifdef ENABLE_CLASSDEBUG
185 } // namespace framework
187 #endif // #ifndef __FRAMEWORK_CLASSES_WILDCARD_HXX_