Design Pattern Examples
Overview of object-oriented design patterns
Memento_TextObject.h
Go to the documentation of this file.
1
8
9#pragma once
10#ifndef __MEMENTO_TEXTOBJECT_H__
11#define __MEMENTO_TEXTOBJECT_H__
12
16typedef struct
17{
18 char* text;
20
30
37
47
55void Memento_TextObject_SetText(Memento_TextObject* textObject, const char* newText);
56
64const char* Memento_TextObject_ToString(Memento_TextObject* textObject);
65
66#endif // __MEMENTO_TEXTOBJECT_H__
67
char * Memento_TextObject_GetText(Memento_TextObject *textObject)
Retrieve a pointer to the text contained within the Memento_TextObject. The text can be altered throu...
void Memento_TextObject_Destroy(Memento_TextObject *textObject)
Destroy the given Memento_TextObject object and release any used memory. After this function returns,...
Memento_TextObject * Memento_TextObject_Create(const char *text)
Create a new instance of the Memento_TextObject structure and initialize it with the given text.
void Memento_TextObject_SetText(Memento_TextObject *textObject, const char *newText)
Replace the existing text in the Memento_TextObject object with the given text.
const char * Memento_TextObject_ToString(Memento_TextObject *textObject)
Return a string representation of the Memento_TextObject. In this case, it is just the underlying tex...
Container for a string.
char * text
The text object contained within this Memento_TextObject.