]> git.lyx.org Git - lyx.git/blobdiff - src/BackStack.h
removed a warning from screen and added CFLAGS in lyx.spec.in.
[lyx.git] / src / BackStack.h
index 89f49730b6efb9ac0974597a67cae35bc5d6cbbe..5ca40451a3cb009f7bcaa6a8091ccb85a648d6ac 100644 (file)
@@ -1,15 +1,15 @@
 // -*- C++ -*-
 /* This file is part of
-* ======================================================
-* 
-*           LyX, The Document Processor
-*       
-*          Copyright (C) 1997-1998 The LyX Team.
-*
-*======================================================*/
+ * ======================================================
+ 
+ *           LyX, The Document Processor
+ *      
+ *         Copyright (C) 1997-1999 The LyX Team.
+ *
+ * ======================================================*/
 
-#ifndef _BACK_STACK_H
-#define _BACK_STACK_H
+#ifndef BACK_STACK_H
+#define BACK_STACK_H
 
 #include "LString.h"
 
@@ -22,37 +22,38 @@ public:
        ///
        struct BackStackItem {
                ///
-               void set(LString f, int xx, int yy) {
+               void set(string f, int xx, int yy) {
                        fname = f;  x = xx;  y = yy;
                }
                /// Filename
-               LString fname;
+               string fname;
                /// Cursor x-position
                int x;
                /// Cursor y-position
-               int y;   
+               int y;
        };
        ///
-       BackStack(int n) : imax(n) {
-               item = new BackStackItem[imax];
-               i = 0;
-       }
+       BackStack(int n) : item(new BackStackItem[n]) , i(0), imax(n) {}
        ///
        ~BackStack() {
                delete[] item;
        }
        ///
-       void push(LString f, int x, int y) {
-               if (i<imax) 
+       void push(string f, int x, int y) {
+               if (i < imax) 
                        item[i++].set(f, x, y);
        }
        ///
-       LString &pop(int *x, int *y) {
-               if (i>0) i--;
+       string & pop(int *x, int *y) {
+               if (i > 0) i--;
                *x = item[i].x;
                *y = item[i].y;
                return item[i].fname;
        }
+       ///
+       bool empty() const {
+               return i == 0;
+       }
 private:
        ///
        BackStackItem *item;