Container for a string. Need to use a class that allows the text to be changed while the container (this class) remains constant. This way, operations can be applied to the text and the container's contents change but not the container (strings are immutable in C#; this dances around that problem). More...
#include <Command_Classes.h>
Public Types | |
using | shared_ptr_t = std::shared_ptr< Command_TextObject > |
Public Member Functions | |
Command_TextObject (std::string text) | |
Constructs a text object with an initial string. | |
std::string | Text () |
Gets the text in this TextObject. | |
void | SetText (std::string value) |
Sets the text in this TextObject. | |
void | Reset () |
Resets the TextObject to the starting string. | |
std::string | ToString () |
Converts the TextObject to a string. | |
Private Attributes | |
std::string | _startingText |
std::string | _text |
Container for a string. Need to use a class that allows the text to be changed while the container (this class) remains constant. This way, operations can be applied to the text and the container's contents change but not the container (strings are immutable in C#; this dances around that problem).
Definition at line 26 of file Command_Classes.h.
using shared_ptr_t = std::shared_ptr<Command_TextObject> |
Definition at line 29 of file Command_Classes.h.
|
inline |
Constructs a text object with an initial string.
text | The initial string for the text object. |
Definition at line 43 of file Command_Classes.h.
References Command_TextObject::_startingText, and Command_TextObject::_text.
|
inline |
Resets the TextObject to the starting string.
Definition at line 61 of file Command_Classes.h.
References Command_TextObject::_startingText, and Command_TextObject::_text.
|
inline |
Sets the text in this TextObject.
Definition at line 56 of file Command_Classes.h.
References Command_TextObject::_text.
|
inline |
Gets the text in this TextObject.
Definition at line 52 of file Command_Classes.h.
References Command_TextObject::_text.
|
inline |
Converts the TextObject to a string.
Definition at line 70 of file Command_Classes.h.
References Command_TextObject::_text.
|
private |
Definition at line 33 of file Command_Classes.h.
Referenced by Command_TextObject::Command_TextObject(), and Command_TextObject::Reset().
|
private |
Definition at line 36 of file Command_Classes.h.
Referenced by Command_TextObject::__init__(), Memento_TextObject::__init__(), Command_TextObject::Command_TextObject(), Memento_TextObject::GetMemento(), Command_TextObject::Reset(), Memento_TextObject::RestoreMemento(), Command_TextObject::SetText(), Command_TextObject::Text(), Memento_TextObject.Memento::Text(), Memento_TextObject::Text(), Command_TextObject::ToString(), and Memento_TextObject::ToString().