From 9cdf227b84a18141de527a0ad85344a20914b974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 5 Jul 2019 10:26:37 -0700 Subject: Started work on Text and friends. Text processing isn't trivial, and I want this iteration to be significantly more robust. This time I/O will be seperated out into codecs that will handle the encoding/decoding to/from different formats. --- src/unstable/text.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/unstable/text.cpp') diff --git a/src/unstable/text.cpp b/src/unstable/text.cpp index 73271f8..9e5670d 100644 --- a/src/unstable/text.cpp +++ b/src/unstable/text.cpp @@ -5,4 +5,29 @@ * terms of the license contained in the file LICENSE. */ +#include "bu/text.h" +#include + +Bu::Text::Text() : + pData( NULL ), + iSize( 0 ), + iCodePoints( 0 ) +{ +} + +Bu::Text::Text( const Text &rSrc ) : + pData( NULL ), + iSize( rSrc.iSize ), + iCodePoints( rSrc.iCodePoints ) +{ + pData = new uint16_t[iSize]; + memcpy( pData, rSrc.pData, sizeof(uint16_t)*iSize ); +} + +Bu::Text::~Text() +{ + delete[] pData; + pData = NULL; +} + -- cgit v1.2.3