diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc index d094e63c..fcc23707 100644 --- a/src/ClientPattern.cc +++ b/src/ClientPattern.cc @@ -23,7 +23,6 @@ // $Id$ #include "ClientPattern.hh" -#include "RegExp.hh" #include "FocusControl.hh" #include "Layer.hh" diff --git a/src/ClientPattern.hh b/src/ClientPattern.hh index b76aef82..4531c4a3 100644 --- a/src/ClientPattern.hh +++ b/src/ClientPattern.hh @@ -26,7 +26,7 @@ #ifndef CLIENTPATTERN_HH #define CLIENTPATTERN_HH -#include "RegExp.hh" +#include "FbTk/RegExp.hh" #include "NotCopyable.hh" #include @@ -99,7 +99,7 @@ private: struct Term { Term(const std::string ®str, bool full_match) :regexp(regstr, full_match){}; std::string orig; - RegExp regexp; + FbTk::RegExp regexp; WinProperty prop; bool negate; }; diff --git a/src/FbTk/Makefile.am b/src/FbTk/Makefile.am index 86f85947..5f1c2466 100644 --- a/src/FbTk/Makefile.am +++ b/src/FbTk/Makefile.am @@ -41,6 +41,7 @@ libFbTk_a_SOURCES = App.hh App.cc Color.cc Color.hh Command.hh \ XLayer.cc XLayer.hh XLayerItem.cc XLayerItem.hh \ Resource.hh Resource.cc \ StringUtil.hh StringUtil.cc Parser.hh Parser.cc \ + RegExp.hh RegExp.cc \ FbString.hh FbString.cc \ Subject.hh Subject.cc Observer.hh Observer.cc \ Transparent.hh Transparent.cc \ diff --git a/src/RegExp.cc b/src/FbTk/RegExp.cc similarity index 82% rename from src/RegExp.cc rename to src/FbTk/RegExp.cc index 895cc7b9..df989827 100644 --- a/src/RegExp.cc +++ b/src/FbTk/RegExp.cc @@ -1,4 +1,4 @@ -// RegExp.cc for Fluxbox Window Manager +// RegExp.cc for FbTk // Copyright (c) 2003 Henrik Kinnunen (fluxgen at fluxbox dot org) // and Simon Bowden (rathnor at users.sourceforge.net) // @@ -20,10 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id$ - #include "RegExp.hh" -#include "FbTk/I18n.hh" //use GNU extensions #ifndef _GNU_SOURCE @@ -40,10 +37,7 @@ using std::cerr; using std::endl; #endif // USE_REGEXP - -/******************************************************** - * RegExp * - **********/ +namespace FbTk { // full_match is to say if we match on this regexp using the full string // or just a substring. Substrings aren't supported if not HAVE_REGEXP @@ -62,15 +56,6 @@ m_regex(0) { m_regex = new regex_t; int ret = regcomp(m_regex, match.c_str(), REG_NOSUB | REG_EXTENDED); if (ret != 0) { - char *errstr = 0; - _FB_USES_NLS; - // gives us the length of the string - unsigned int size = regerror(ret, m_regex, errstr, 0); - errstr = new char[size]; - - regerror(ret, m_regex, errstr, size); - cerr<<_FB_CONSOLETEXT(Fluxbox, ErrorRegexp, "Error parsing regular expression", "Error parsing regular expression (following)")<<": "< #endif // USE_REGEXP -class WinClient; +namespace FbTk { -class RegExp:private FbTk::NotCopyable { +class RegExp: private NotCopyable { public: RegExp(const std::string &str, bool full_match = true); ~RegExp(); @@ -63,4 +61,6 @@ private: }; -#endif // REGEXP_HH +}; // end namespace FbTk + +#endif // FBTK_REGEXP_HH diff --git a/src/Makefile.am b/src/Makefile.am index dfed93b7..b40affd4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -78,9 +78,8 @@ if GNOME gnome_SOURCE= Gnome.hh Gnome.cc endif if REMEMBER_SRC -# For now we only want regexp if we have remember REMEMBER_SOURCE= Remember.hh Remember.cc \ - RegExp.hh RegExp.cc ClientPattern.hh ClientPattern.cc + ClientPattern.hh ClientPattern.cc endif if TOOLBAR_SRC TOOLBAR_SOURCE = Toolbar.hh Toolbar.cc \