aboutsummaryrefslogtreecommitdiff
path: root/src/Remember.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-11-17 00:20:54 (GMT)
committerfluxgen <fluxgen>2003-11-17 00:20:54 (GMT)
commitf592b67c70b29542d716fe633bdca2c20f2db689 (patch)
tree46f1ec31e341e7e43e8795f51d0f5cf0bfe9aa58 /src/Remember.cc
parent0035e57b649d4ce85df97439b82d430043cb9145 (diff)
downloadfluxbox-f592b67c70b29542d716fe633bdca2c20f2db689.zip
fluxbox-f592b67c70b29542d716fe633bdca2c20f2db689.tar.bz2
check for sstream header
Diffstat (limited to 'src/Remember.cc')
-rw-r--r--src/Remember.cc29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index 14e65fb..401d29c 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -21,7 +21,7 @@
21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22// DEALINGS IN THE SOFTWARE. 22// DEALINGS IN THE SOFTWARE.
23 23
24// $Id: Remember.cc,v 1.29 2003/08/18 09:32:15 fluxgen Exp $ 24// $Id: Remember.cc,v 1.30 2003/11/17 00:20:54 fluxgen Exp $
25 25
26#include "Remember.hh" 26#include "Remember.hh"
27#include "ClientPattern.hh" 27#include "ClientPattern.hh"
@@ -43,12 +43,25 @@
43 43
44 44
45#include <iostream> 45#include <iostream>
46#include <sstream>
47#include <fstream> 46#include <fstream>
48#include <string> 47#include <string>
49#include <memory> 48#include <memory>
50#include <set> 49#include <set>
51 50
51#ifdef HAVE_CONFIG_H
52#include "config.h"
53#endif // HAVE_CONFIG_H
54
55#ifdef HAVE_SSTREAM
56#include <sstream>
57#define FB_istringstream istringstream
58#elif HAVE_STRSTREAM
59#include <strstream>
60#define FB_istringstream istrstream
61#else
62#error "You dont have sstream or strstream headers!"
63#endif // HAVE_STRSTREAM
64
52using namespace std; 65using namespace std;
53 66
54#ifndef MAXPATHLEN 67#ifndef MAXPATHLEN
@@ -157,7 +170,7 @@ bool handleStartupItem(const string &line, int offset) {
157 if (pos > 0) { 170 if (pos > 0) {
158 option = str.substr(0, pos); 171 option = str.substr(0, pos);
159 if (option == "screen") { 172 if (option == "screen") {
160 istringstream iss(str.c_str() + pos + 1); 173 FB_istringstream iss(str.c_str() + pos + 1);
161 iss >> screen; 174 iss >> screen;
162 } else { 175 } else {
163 error = true; 176 error = true;
@@ -303,22 +316,22 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) {
303 continue; //read next line 316 continue; //read next line
304 if (str_key == "Workspace") { 317 if (str_key == "Workspace") {
305 unsigned int w; 318 unsigned int w;
306 istringstream iss(str_label.c_str()); 319 FB_istringstream iss(str_label.c_str());
307 iss >> w; 320 iss >> w;
308 app.rememberWorkspace(w); 321 app.rememberWorkspace(w);
309 } else if (str_key == "Layer") { 322 } else if (str_key == "Layer") {
310 unsigned int l; 323 unsigned int l;
311 istringstream iss(str_label.c_str()); 324 FB_istringstream iss(str_label.c_str());
312 iss >> l; 325 iss >> l;
313 app.rememberLayer(l); 326 app.rememberLayer(l);
314 } else if (str_key == "Dimensions") { 327 } else if (str_key == "Dimensions") {
315 unsigned int h,w; 328 unsigned int h,w;
316 istringstream iss(str_label.c_str()); 329 FB_istringstream iss(str_label.c_str());
317 iss >> w >> h; 330 iss >> w >> h;
318 app.rememberDimensions(w,h); 331 app.rememberDimensions(w,h);
319 } else if (str_key == "Position") { 332 } else if (str_key == "Position") {
320 unsigned int x,y; 333 unsigned int x,y;
321 istringstream iss(str_label); 334 FB_istringstream iss(str_label.c_str());
322 iss >> x >> y; 335 iss >> x >> y;
323 app.rememberPosition(x,y); 336 app.rememberPosition(x,y);
324 } else if (str_key == "Shaded") { 337 } else if (str_key == "Shaded") {
@@ -350,7 +363,7 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) {
350 unsigned int mask; 363 unsigned int mask;
351 const char * str = str_label.c_str(); 364 const char * str = str_label.c_str();
352 // it'll have at least one char and \0, so this is safe 365 // it'll have at least one char and \0, so this is safe
353 istringstream iss(str); 366 FB_istringstream iss(str);
354 // check for hex 367 // check for hex
355 if (str[0] == '0' && str[1] == 'x') { 368 if (str[0] == '0' && str[1] == 'x') {
356 iss.seekg(2); 369 iss.seekg(2);