HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CMD_History.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CMD library (C++)
7  *
8  * COMMENTS: History logger for command library
9  *
10  */
11 
12 #ifndef __CMD_History_h__
13 #define __CMD_History_h__
14 
15 #include "CMD_API.h"
16 #include <UT/UT_NonCopyable.h>
17 #include <UT/UT_ValArray.h>
18 #include <iosfwd>
19 
20 class UT_String;
21 class UT_WorkBuffer;
22 class CMD_History;
23 class CMD_Manager;
24 
26 {
27 public:
30 
32 
33  //
34  // historyExpand returns 1 if substitution was made
35  int historyExpand(CMD_Manager *, UT_String &cmd);
36  void addHistory(const char *cmd);
37  //
38  // getEntry will return the most recent first. i.e. getEntry(0) returns
39  // the most recent command.
40  //
41  const char *getCommand(int n) const;
42  unsigned int entries() const { return myHistory.entries(); }
43 
44  void clearAndDestroy();
45  void saveHistory(std::ostream &os) const;
46 
47 private:
48  int editHistory(UT_String &cmd);
49  int getHistory(const char *pattern, UT_WorkBuffer &where);
50 
52 };
53 
54 #endif
unsigned int entries() const
Definition: CMD_History.h:42
GLdouble n
Definition: glcorearb.h:2008
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLushort pattern
Definition: glad.h:2583
#define CMD_API
Definition: CMD_API.h:10