update dev300-m58
[ooovba.git] / framework / inc / classes / wildcard.hxx
blob51c7ccf015a7838d5fe516edb61cc796dc898a36
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: wildcard.hxx,v $
10 * $Revision: 1.5 $
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 //_________________________________________________________________________________________________________________
35 // my own includes
36 //_________________________________________________________________________________________________________________
38 #include <macros/debug.hxx>
40 //_________________________________________________________________________________________________________________
41 // interface includes
42 //_________________________________________________________________________________________________________________
44 //_________________________________________________________________________________________________________________
45 // other includes
46 //_________________________________________________________________________________________________________________
47 #include <rtl/ustring.hxx>
49 //_________________________________________________________________________________________________________________
50 // const
51 //_________________________________________________________________________________________________________________
53 //_________________________________________________________________________________________________________________
54 // namespace
55 //_________________________________________________________________________________________________________________
57 namespace framework{
59 //_________________________________________________________________________________________________________________
60 // declarations
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!
68 @implements -
69 @base -
71 @ATTENTION This class is'nt threadsafe!
73 @devstatus deprecated
74 *//*-*************************************************************************************************************/
76 class Wildcard
78 //-------------------------------------------------------------------------------------------------------------
79 // public methods
80 //-------------------------------------------------------------------------------------------------------------
82 public:
84 //---------------------------------------------------------------------------------------------------------
85 // constructor / destructor
86 //---------------------------------------------------------------------------------------------------------
88 /*-****************************************************************************************************//**
89 @short standard ctor
90 @descr We do nothing here.
92 @seealso -
94 @param -
95 @return -
97 @onerror -
98 *//*-*****************************************************************************************************/
100 Wildcard();
102 /*-****************************************************************************************************//**
103 @short standard dtor
104 @descr We do nothing here.
106 @seealso -
108 @param -
109 @return -
111 @onerror -
112 *//*-*****************************************************************************************************/
114 virtual ~Wildcard();
116 //---------------------------------------------------------------------------------------------------------
117 // interface
118 //---------------------------------------------------------------------------------------------------------
120 /*-****************************************************************************************************//**
121 @short try to find an agreement between given text and searchpattern
122 @descr You can use wildcards in pattern only!
124 @seealso -
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.
131 @onerror -
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
153 @onerror -
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.
168 @seealso -
170 @param -
171 @return -
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
183 }; // class Wildcard
185 } // namespace framework
187 #endif // #ifndef __FRAMEWORK_CLASSES_WILDCARD_HXX_