forked from unicode-org/icu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
line.h
115 lines (98 loc) · 3.13 KB
/
line.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// © 2017 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
* Copyright (C) 2003, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
*
* File line.h
*
* Modification History:
*
* Date Name Description
* 03/18/2003 weiv Creation.
*******************************************************************************
*/
//
// class Line
//
// Each line from the source file (containing a name, presumably) gets
// one of these structs.
//
#ifndef COLPROBE_LINE_H
#define COLPROBE_LINE_H
#include "unicode/utypes.h"
#include "unicode/ucol.h"
#include "unicode/ustring.h"
#include "unicode/unistr.h"
#include "unicode/uchar.h"
#include "unicode/uniset.h"
#include "colprobe.h"
#include <stdlib.h>
#include <string.h>
static const int MAX_EXPANSION_PREFIXES = 10;
class Line {
public:
static void copyArray(Line *dest, const Line *src, int32_t size);
Line();
Line(const Line &other);
Line(const char16_t* name, int32_t len);
Line(const UnicodeString &string);
Line(const char16_t name);
Line(const char *buff, int32_t buffLen, UErrorCode &status);
~Line();
Line & operator=(const Line &other);
UBool operator==(const Line &other) const;
UBool operator!=(const Line &other) const;
void setToConcat(const Line *first, const Line *second);
void setName(const char16_t* name, int32_t len);
UnicodeString toString(UBool pretty = false);
UnicodeString toBundleString();
UnicodeString toHTMLString();
int32_t write(char *buff, int32_t buffLen, UErrorCode &status);
void initFromString(const char *buff, int32_t buffLen, UErrorCode &status);
UnicodeString strengthIndent(UColAttributeValue strength, int indentSize, UnicodeString &result);
UnicodeString strengthToString(UColAttributeValue strength, UBool pretty, UBool html = false);
UnicodeString stringToName(char16_t *string, int32_t len);
void setTo(const UnicodeString &string);
void setTo(const UChar32 n);
UBool equals(const Line &other) const;
Line *nextInteresting();
void append(const char16_t n);
void append(const char16_t* n, int32_t length);
void append(const Line &l);
void clear();
void swapCase();
void swapCase(char16_t *string, int32_t &sLen);
UnicodeString dumpSortkey();
void init();
public:
char16_t name[25];
int32_t len;
char16_t expansionString[25];
int32_t expLen;
UColAttributeValue strength;
UColAttributeValue strengthFromEmpty;
UColAttributeValue cumulativeStrength;
UColAttributeValue expStrength;
Line *previous;
Line *next;
// In case this element is a contraction
// we keep a pointer at which lines were components
Line *left;
Line *right;
UBool isContraction;
UBool isExpansion;
UBool isRemoved;
UBool isReset;
int32_t expIndex;
uint8_t firstCC;
uint8_t lastCC;
uint8_t *sortKey;
public:
static UnicodeSet *needsQuoting;
};
#endif //COLPROBE_LINE_H