MCPcopy Create free account
hub / github.com/DFHack/dfhack / add

Method add

library/include/Console.h:84–92  ·  view source on GitHub ↗

add a command to the history

Source from the content-addressed store, hash-verified

82 }
83 /// add a command to the history
84 void add(const std::string& command)
85 {
86 // if current command = last in history -> do not add. Always add if history is empty.
87 if(!history.empty() && history.front() == command)
88 return;
89 history.push_front(command);
90 if(history.size() > capacity)
91 history.pop_back();
92 }
93 /// clear the command history
94 void clear()
95 {

Callers

nothing calls this directly

Calls 3

push_frontMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected