Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExampleCleanString.cpp
1 /* This file is part of the BIAS library (Basic ImageAlgorithmS).
2 
3  Copyright (C) 2003-2009 (see file CONTACT for details)
4  Vision N GmbH
5  Schauenburgerstr. 116
6  24118 Kiel
7 
8  BIAS is free software; you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation; either version 2.1 of the License, or
11  (at your option) any later version.
12 
13  BIAS is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with BIAS; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/
21 
22 /**
23  @example ExampleCleanString.cpp
24  @brief Example for usage of wx clean string
25  @ingroup g_examples
26  @author MIP
27 */
28 
29 #include <Gui/StringConv.hh>
30 
31 #include <Base/Common/BIASpragmaStart.hh>
32 #include <wx/wx.h>
33 #include <Base/Common/BIASpragmaEnd.hh>
34 
35 using namespace BIAS;
36 using namespace std;
37 
38 /** \cond HIDDEN_SYMBOLS*/
39 class MyApp : public wxApp
40 {
41  virtual bool OnInit()
42  {
43  wxInitAllImageHandlers();
44  wxString in = wxGetTextFromUser(wxT("Enter some text"));
45  wxString out = CleanString(in);
46  wxString message = wxT("Input: \n ") + in + wxT("\n\nOutput: \n ") + out;
47  wxMessageBox(message);
48 
49  exit(0);
50  return true;
51  }
52 };
53 /** \endcond */
54 IMPLEMENT_APP(MyApp)
55 
wxString CleanString(const wxString &input, const wxString replaceWith=wxEmptyString)
Definition: StringConv.hh:107