command.h

来自「MONA是为数不多的C++语言编写的一个很小的操作系统」· C头文件 代码 · 共 56 行

H
56
字号
/*!
  \file   Command.h
  \brief  one line shell command

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

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

#define POSITION_RIGHT -2
#define POSITION_LEFT -1

using namespace MonAPI;

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

  private:
    CString commandLine;
    int posCurrent;
    bool isTerminateFlag;
    
    int ParseCommand();

  public:
    Command();
    ~Command();
    int GetCurrentPos();
    int SetCurrentPos(int pos);
    bool InsertCommandLine(const CString& s);
    bool RemoveCommandLine();
    bool InitializeCommandLine();
    bool IsTerminate();
    int ExecuteCommand();

    Command operator+(const CString& s);
    Command& operator=(const CString& s);
    Command& operator+=(const CString& s);
    operator const char *();
    operator CString *();
};


#endif

⌨️ 快捷键说明

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