aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/text.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2019-07-05 10:26:37 -0700
committerMike Buland <eichlan@xagasoft.com>2019-07-05 10:26:37 -0700
commit9cdf227b84a18141de527a0ad85344a20914b974 (patch)
treec1cb3d0e15b8ce96c0d680e2ce8360e3e452fbfd /src/unstable/text.cpp
parent14683979c43e17393dc4f902fe65ed22898b2bce (diff)
downloadlibbu++-9cdf227b84a18141de527a0ad85344a20914b974.tar.gz
libbu++-9cdf227b84a18141de527a0ad85344a20914b974.tar.bz2
libbu++-9cdf227b84a18141de527a0ad85344a20914b974.tar.xz
libbu++-9cdf227b84a18141de527a0ad85344a20914b974.zip
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.
Diffstat (limited to 'src/unstable/text.cpp')
-rw-r--r--src/unstable/text.cpp25
1 files changed, 25 insertions, 0 deletions
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 @@
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
6 */ 6 */
7 7
8#include "bu/text.h"
9#include <string.h>
10
11Bu::Text::Text() :
12 pData( NULL ),
13 iSize( 0 ),
14 iCodePoints( 0 )
15{
16}
17
18Bu::Text::Text( const Text &rSrc ) :
19 pData( NULL ),
20 iSize( rSrc.iSize ),
21 iCodePoints( rSrc.iCodePoints )
22{
23 pData = new uint16_t[iSize];
24 memcpy( pData, rSrc.pData, sizeof(uint16_t)*iSize );
25}
26
27Bu::Text::~Text()
28{
29 delete[] pData;
30 pData = NULL;
31}
32
8 33