|
rlmm::basic_history< Lock > Struct Template Reference |
Public Types | |
typedef std::list< entry > | entry_list |
enum | direction { backward = -1, forward = 1 } |
Public Member Functions | |
Creating and deleting | |
basic_history () | |
virtual | ~basic_history () |
Setting/getting parameters | |
void | comment_character (char c) |
char | comment_character () const |
void | expansion_character (char c) |
char | expansion_character () const |
void | no_expand_characters (const std::string &noexp) |
const std::string & | no_expand_characters () const |
void | quote_inhibit_expansion (bool inhibit) |
bool | quote_inhibit_expansion () const |
void | search_delimiters (const std::string &del) |
const std::string & | search_delimiters () const |
void | substitution_character (char c) |
char | substitution_character () const |
void | word_delimiters (const std::string &del) |
const std::string & | word_delimiters () const |
void | add (const std::string &line, void *data=0) |
void | add (const entry &e) |
entry | at (int index) const |
int | bytes () const |
void | clear () |
entry | current () const |
int | length () const |
entry | next () const |
entry | previous () const |
entry | remove (int index) |
entry | replace (int index, const entry &e) |
bool | position (int pos) |
int | where () const |
const entry_list | list () const |
Expansion of history | |
std::string | event (const std::string &text, int &index, char term='\0') |
int | expand (const std::string &line, std::string &expansion) |
searching in the history | |
bool | search (const std::string &line, direction dir=forward, bool anchored=false) |
bool | search (const std::string &line, int &pos, direction dir=forward) |
(Un)freezing of history size | |
int | stifle () const |
int | stifle (int max) |
History file manipulation | |
int | append (const std::string &filename, int lines) |
int | read (const std::string &filename, int from=-1, int to=-1) |
int | truncate (const std::string &filename, int lines) |
int | write (const std::string &filename) |
Miscellaneous operations | |
std::string | arguments (int first, int last, const std::string &text) const |
void | sync () |
std::list< std::string > | tokenize (const std::string &text) const |
Static Public Attributes | |
static const entry | no_entry |
Protected Types | |
typedef HISTORY_STATE * | state_type |
typedef HIST_ENTRY * | entry_type |
Protected Member Functions | |
void | save () const |
void | restore () const |
virtual bool | inhibit_expansion (const std::string &line, int where) |
global manupulations | |
void | do_activate () |
void | do_deactivate () |
Protected Attributes | |
entry_list | _list |
state_type | _state |
state_type | _keep |
char | _comment_character |
char | _expansion_character |
char | _substitution_character |
std::string | _word_delimiters |
std::string | _no_expand_characters |
std::string | _search_delimiters |
bool | _quote_inhibit_expansion |
Static Protected Attributes | |
static bool | _initialized = false |
Friends | |
class | one_at_a_time |
int | rlmm_inhibit_expansion (char *, int) |
Classes | |
class | entry |
An entry in the history list. More... | |
struct | saver |
|
|
|
C API entry type.
|
|
C API state type.
|
|
Directions.
|
|
CTOR.
|
|
DTOR.
|
|
|
|
Add a line to the history.
|
|
Append lines to history file.
|
|
Return arguments. Return a string of positional arguments in the passed text.
|
|
Get entry at position.
|
|
Return the number of bytes used by entries.
|
|
Clear the history.
|
|
Get the comment character.
|
|
Set the comment character (
|
|
Get the current history entry.
|
|
Install a new history state. At this point, the old history is synced with the current internal state. Implements rlmm::one_at_a_time< basic_history, Lock >. |
|
Remove a history state.
Implements rlmm::one_at_a_time< basic_history, Lock >. |
|
Return an event. Returns the text of the history event at index in passed string. The index will be modified to point to after the event specifier.
|
|
Do a history expansion on a line.
|
|
Return the expansion character.
|
|
Set the expansion character.
|
|
Inhibit expansion hook. Users can override this method in derived classes.
|
|
Get the length of the current history.
|
|
Get the history list. Note, this cannot be modified.
|
|
Get the next entry.
|
|
Get the characters that are not expanded.
|
|
Set the characters that shouldn't be expanded.
|
|
Set the position in the history.
|
|
Get the previous entry.
|
|
Set wether quotes inhibit expansion.
|
|
Set wether quotes inhibit expansion.
|
|
Read history from a file.
|
|
Remove an entry from the history. Remove one entry from the history. The entry is returned, and it's the users responsibility to free the allocated memory in the returned entry. Note, that the string is allocated using std::malloc and should therefor be deallocated with std::free.
|
|
Replace a line in the history. Replace a line in the history with a new element. The entry is returned, and it's the users responsibility to free the allocated memory in the returned entry. Note, that the string is allocated using std::malloc and should therefor be deallocated with std::free.
|
|
Restore the previously saved state.
|
|
Save the current state if this object is not the current history state.
|
|
Search for a line in the history. Contrary to the non-position search, this does not change the current position in the history list.
|
|
Search for a line in the history. Set the current history entry to the line if found.
|
|
Get the search delimiters.
|
|
set the search delimiters.
|
|
Stiffle the history. Set the maximum number of lines to remember in the history, or release the history.
|
|
Test if the history is stiffled.
|
|
Get the substitution character.
|
|
Set the substitution character.
( |
|
Syncronise this object with current history.
|
|
Tokenize a string according to history.
|
|
Truncate the history file. This will throw an Errno exception on failure.
|
|
Get the current offset in the history.
|
|
Get the word delimiters.
|
|
Set the word delimiters.
|
|
Write history to file.
|
|
Base classs is a friend.
|
|
|
|
comment character
|
|
expension character
|
|
Flag telling us if history library has been initialised.
|
|
keep
|
|
The history.
|
|
no expand characters
|
|
wether quotes inhibits expansion
|
|
Search delimiters.
|
|
Internal state information.
|
|
substitution character
|
|
Word delimiters.
|
|
The empty entry.
|