mirror of
https://github.com/Dejvino/lilybook.git
synced 2024-11-14 20:33:28 +00:00
35 lines
649 B
C++
35 lines
649 B
C++
#include <string.h>
|
|
#include "Typesetter.h"
|
|
|
|
Typesetter::Typesetter()
|
|
{}
|
|
|
|
Page* Typesetter::preparePage(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;
|
|
}
|
|
|
|
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;
|
|
}
|