EditLine Struct Reference

A datastructure holding a line of text in an edit session. Lines of text are tab expanded before display and binary characters are converted into ~'s for display purposes. More...

Collaboration diagram for EditLine:
Collaboration graph
[legend]

List of all members.

Public Member Functions

std::string * data ()
 Get the raw, un-tab-expanded copy of the edit record.
 EditLine (std::string *original_data)
std::string & maybe_tabbify ()
 Return a tab compressed version of this line -- but only if the line was modified. If the original_data is unmodified, just return it.
 operator std::string ()
 Get the tab expanded, version (that has the non-ascii chars turned to ~).
void replace (std::string const &s)
 Replace the edit line's data with that specified in the string.
 ~EditLine ()
 A destructor -- what'll they thank uv next, pawww?

Public Attributes

bool crRemoved_
 data after characters are changed
std::string * modified_data_
 original unmodified data
std::string * original_data_

Detailed Description

A datastructure holding a line of text in an edit session. Lines of text are tab expanded before display and binary characters are converted into ~'s for display purposes.

If you don't change a line of text, the tab expansion never gets written back to the file, even if you save the edit session, but if you do save, any changed lines will be tab packed before writing.

This data structure keeps two pointers -- one pointer if the data is never modified and the other if it is. It could be done with a flag and a pointer, but it would take up the same space on most machines.

Definition at line 141 of file texteditor.cxx.


Constructor & Destructor Documentation

EditLine ( std::string *  original_data  ) 

A constructor -- you must supply the original data.

Definition at line 165 of file texteditor.cxx.

~EditLine (  ) 

A destructor -- what'll they thank uv next, pawww?

Definition at line 173 of file texteditor.cxx.


Member Function Documentation

std::string* data (  ) 

Get the raw, un-tab-expanded copy of the edit record.

Definition at line 180 of file texteditor.cxx.

Here is the caller graph for this function:

std::string& maybe_tabbify (  ) 

Return a tab compressed version of this line -- but only if the line was modified. If the original_data is unmodified, just return it.

Definition at line 210 of file texteditor.cxx.

operator std::string (  ) 

Get the tab expanded, version (that has the non-ascii chars turned to ~).

Definition at line 186 of file texteditor.cxx.

void replace ( std::string const &  s  ) 

Replace the edit line's data with that specified in the string.

Definition at line 196 of file texteditor.cxx.


Member Data Documentation

bool crRemoved_

data after characters are changed

A carriage return was removed from this line during the file reading process (linux/unix only).

Definition at line 162 of file texteditor.cxx.

std::string* modified_data_

original unmodified data

Definition at line 160 of file texteditor.cxx.

std::string* original_data_

Definition at line 159 of file texteditor.cxx.


The documentation for this struct was generated from the following file:
Generated on Wed Feb 29 22:51:50 2012 for CXXUtilities by  doxygen 1.6.3