item.h

来自「一个在linux下的shell的计算器」· C头文件 代码 · 共 71 行

H
71
字号
/* * * * */#ifndef __ITEM_H#define __ITEM_H#include <iostream>#include <string>enum itemtype{ EMPTY, INTEGER, LOGICAL, REAL, STRING, OPERATION, LIST};std::string TypeName(itemtype t);class Item{ private:  std::string name; protected:  itemtype type; public:  Item *prev, *next;  //   Item();  virtual ~Item();  itemtype GetType() const;  // Virtual Methods  virtual Item *Clone() = 0;  virtual long ToInteger() const;    virtual bool ToBoolean() const;    virtual double ToDouble() const;  virtual std::string ToString() const;  //   void SetName(std::string s);  std::string GetName() const;};std::ostream & operator<<(std::ostream & stream, Item const & x);#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?