⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commandhistory.h

📁 MONA是为数不多的C++语言编写的一个很小的操作系统
💻 H
字号:
/*!
  \file   CommandHistory.h
  \brief  one line shell command history

  Copyright (c) 2002-2004 shadow
  All rights reserved.<BR>
  \b License NYSL<BR>
  \b Create 2004/03/27
  \author  shadow

  $Revision: 1.3 $
  $Date: 2004/05/08 06:39:41 $
*/
#ifndef _COMAND_HISTORY_
#define _COMAND_HISTORY_
#include <sys/types.h>
#include <monapi/CString.h>
#include "Command.h"

#define HISTORYSIZE 32

#define GETCURRENT 0
#define GETPREV   -1
#define GETNEXT   -2
#define GETLAST   -3
#define GETFIRST  -4

typedef struct tCommandHistory{
  struct tCommandHistory *prev;
  struct tCommandHistory *next;
  Command command;
} commandHistory_t;

/*!
  \brief Command Hittory class
*/
class CommandHistory{

  private:
    int historySize;
    commandHistory_t history;
    commandHistory_t *historyCurrent;
    commandHistory_t *SearchHistory(int numIndex);

  public:
    CommandHistory();
    ~CommandHistory();
    bool AddCommand(Command cmd);
    Command GetCommand(int numIndex);
    CString GetHistoryInfo(int numIndex, unsigned int numSize);
    bool UpdateHistory(Command cmd);
    int RemoveHistory(int numIndex, unsigned int numSize);

};

#endif

⌨️ 快捷键说明

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