1
0
mirror of https://github.com/Dejvino/lilybook.git synced 2024-11-14 20:33:28 +00:00
lilybook/main/Typesetter.cpp

35 lines
649 B
C++
Raw Normal View History

#include <string.h>
2020-01-31 19:54:19 +00:00
#include "Typesetter.h"
Typesetter::Typesetter()
{}
Page* Typesetter::preparePage(char* text, size_t len)
2020-01-31 19:54:19 +00:00
{
Page* page = new Page;
page->text = new char[len+1];
memcpy(page->text, text, len);
page->text[len] = 0;
2020-01-31 19:54:19 +00:00
page->len = len;
return page;
}
Page* Typesetter::preparePreviousPage(char* text, size_t len)
{
Page* page = new Page;
page->text = new char[len+1];
memcpy(page->text, text, len);
page->text[len] = 0;
page->len = len;
return page;
}
void Typesetter::destroyPage(Page* page)
{
if (page == NULL) {
return;
}
delete page->text;
delete page;
2020-01-31 19:54:19 +00:00
}