From a2f947e3003b353f2ac0b5de63eab6b6d6483534 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 17 Nov 2003 00:33:16 +0000 Subject: check for sstream header --- src/ClientPattern.cc | 20 +++++++++++++++++--- src/FbCommandFactory.cc | 25 ++++++++++++++++++++----- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc index 99f6b49..5c110fc 100644 --- a/src/ClientPattern.cc +++ b/src/ClientPattern.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ClientPattern.cc,v 1.4 2003/10/12 16:25:28 rathnor Exp $ +// $Id: ClientPattern.cc,v 1.5 2003/11/17 00:29:30 fluxgen Exp $ #include "ClientPattern.hh" #include "RegExp.hh" @@ -34,7 +34,6 @@ #include -#include #include #include #include @@ -43,6 +42,21 @@ // needed as well for index on some systems (e.g. solaris) #include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif // HAVE_CONFIG_H + +#ifdef HAVE_SSTREAM +#include +#define FB_istringstream istringstream +#elif HAVE_STRSTREAM +#include +#define FB_istringstream istrstream +#else +#error "You dont have sstream or strstream headers!" +#endif // HAVE_STRSTREAM + + using namespace std; ClientPattern::ClientPattern(): @@ -120,7 +134,7 @@ ClientPattern::ClientPattern(const char *str): str+pos, '{', '}'); if (err > 0) { - istringstream iss(number.c_str()); + FB_istringstream iss(number.c_str()); iss >> m_matchlimit; pos+=err; } diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index b0b5976..b62a9ce 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.19 2003/10/25 22:11:22 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.20 2003/11/17 00:33:16 fluxgen Exp $ #include "FbCommandFactory.hh" @@ -36,7 +36,22 @@ #include "FbTk/MacroCommand.hh" #include + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif // HAVE_CONFIG_H + +#ifdef HAVE_SSTREAM #include +#define FB_istringstream istringstream +#elif HAVE_STRSTREAM +#include +#define FB_istringstream istrstream +#else +#error "You dont have sstream or strstream headers!" +#endif // HAVE_STRSTREAM + +using namespace std; // autoregister this module to command parser FbCommandFactory FbCommandFactory::s_autoreg; @@ -141,13 +156,13 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, else if (command == "maximizehorizontal") return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); else if (command == "resize") { - std::istringstream is(arguments); + FB_istringstream is(arguments.c_str()); int dx = 0, dy = 0; is >> dx >> dy; return new ResizeCmd(dx, dy); } else if (command == "resizeto") { - std::istringstream is(arguments); + FB_istringstream is(arguments.c_str()); int dx = 0, dy = 0; is >> dx >> dy; return new ResizeToCmd(dx, dy); @@ -157,13 +172,13 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, else if (command == "resizevertical") return new ResizeCmd(0,atoi(arguments.c_str())); else if (command == "moveto") { - std::istringstream is(arguments); + FB_istringstream is(arguments.c_str()); int dx = 0, dy = 0; is >> dx >> dy; return new MoveToCmd(dx,dy); } else if (command == "move") { - std::istringstream is(arguments); + FB_istringstream is(arguments.c_str()); int dx = 0, dy = 0; is >> dx >> dy; return new MoveCmd(dx, dy); -- cgit v0.11.2