00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CMD_History_h__
00021 #define __CMD_History_h__
00022
00023 #include "CMD_API.h"
00024 #include <UT/UT_PtrArray.h>
00025
00026 class UT_String;
00027 class UT_WorkBuffer;
00028 class CMD_History;
00029 class CMD_Manager;
00030
00031 class CMD_API CMD_HistoryTable
00032 {
00033 public:
00034 CMD_HistoryTable();
00035 ~CMD_HistoryTable();
00036
00037
00038
00039 int historyExpand(CMD_Manager *, UT_String &cmd);
00040 void addHistory(const char *cmd);
00041
00042
00043
00044
00045 const char *getCommand(int n) const;
00046 unsigned int entries() const { return myHistory.entries(); }
00047
00048 void clearAndDestroy();
00049 void saveHistory(ostream &os) const;
00050
00051 private:
00052 int editHistory(UT_String &cmd);
00053 int getHistory(const char *pattern, UT_WorkBuffer &where);
00054
00055 UT_PtrArray<CMD_History *> myHistory;
00056 };
00057
00058 #endif