Lines Matching refs:pos
32 BytesTrie::readValue(const uint8_t *pos, int32_t leadByte) {
37 value=((leadByte-kMinTwoByteValueLead)<<8)|*pos;
39 value=((leadByte-kMinThreeByteValueLead)<<16)|(pos[0]<<8)|pos[1];
41 value=(pos[0]<<16)|(pos[1]<<8)|pos[2];
43 value=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
49 BytesTrie::jumpByDelta(const uint8_t *pos) {
50 int32_t delta=*pos++;
54 delta=((delta-kMinTwoByteDeltaLead)<<8)|*pos++;
56 delta=((delta-kMinThreeByteDeltaLead)<<16)|(pos[0]<<8)|pos[1];
57 pos+=2;
59 delta=(pos[0]<<16)|(pos[1]<<8)|pos[2];
60 pos+=3;
62 delta=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
63 pos+=4;
65 return pos+delta;
70 const uint8_t *pos=pos_;
71 if(pos==nullptr) {
75 return (remainingMatchLength_<0 && (node=*pos)>=kMinValueLead) ?
81 BytesTrie::branchNext(const uint8_t *pos, int32_t length, int32_t inByte) {
84 length=*pos++;
90 if(inByte<*pos++) {
92 pos=jumpByDelta(pos);
95 pos=skipDelta(pos);
102 if(inByte==*pos++) {
104 int32_t node=*pos;
111 ++pos;
112 // int32_t delta=readValue(pos, node>>1);
118 delta=((node-kMinTwoByteValueLead)<<8)|*pos++;
120 delta=((node-kMinThreeByteValueLead)<<16)|(pos[0]<<8)|pos[1];
121 pos+=2;
123 delta=(pos[0]<<16)|(pos[1]<<8)|pos[2];
124 pos+=3;
126 delta=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
127 pos+=4;
130 pos+=delta;
131 node=*pos;
134 pos_=pos;
138 pos=skipValue(pos);
140 if(inByte==*pos++) {
141 pos_=pos;
142 int32_t node=*pos;
151 BytesTrie::nextImpl(const uint8_t *pos, int32_t inByte) {
153 int32_t node=*pos++;
155 return branchNext(pos, node, inByte);
159 if(inByte==*pos++) {
161 pos_=pos;
162 return (length<0 && (node=*pos)>=kMinValueLead) ?
173 pos=skipValue(pos, node);
175 U_ASSERT(*pos<kMinValueLead);
184 const uint8_t *pos=pos_;
185 if(pos==nullptr) {
194 if(inByte==*pos++) {
196 pos_=pos;
198 return (length<0 && (node=*pos)>=kMinValueLead) ?
205 return nextImpl(pos, inByte);
214 const uint8_t *pos=pos_;
215 if(pos==nullptr) {
227 pos_=pos;
229 return (length<0 && (node=*pos)>=kMinValueLead) ?
236 if(inByte!=*pos) {
240 ++pos;
247 pos_=pos;
249 return (length<0 && (node=*pos)>=kMinValueLead) ?
258 if(inByte!=*pos) {
262 ++pos;
267 int32_t node=*pos++;
269 UStringTrieResult result=branchNext(pos, node, inByte);
290 pos=pos_; // branchNext() advanced pos and wrote it to pos_ .
294 if(inByte!=*pos) {
298 ++pos;
307 pos=skipValue(pos, node);
309 U_ASSERT(*pos<kMinValueLead);
316 BytesTrie::findUniqueValueFromBranch(const uint8_t *pos, int32_t length,
319 ++pos; // ignore the comparison byte
320 if(nullptr==findUniqueValueFromBranch(jumpByDelta(pos), length>>1, haveUniqueValue, uniqueValue)) {
324 pos=skipDelta(pos);
327 ++pos; // ignore a comparison byte
329 int32_t node=*pos++;
331 int32_t value=readValue(pos, node>>1);
332 pos=skipValue(pos, node);
343 if(!findUniqueValue(pos+value, haveUniqueValue, uniqueValue)) {
349 return pos+1; // ignore the last comparison byte
353 BytesTrie::findUniqueValue(const uint8_t *pos, UBool haveUniqueValue, int32_t &uniqueValue) {
355 int32_t node=*pos++;
358 node=*pos++;
360 pos=findUniqueValueFromBranch(pos, node+1, haveUniqueValue, uniqueValue);
361 if(pos==nullptr) {
367 pos+=node-kMinLinearMatch+1; // Ignore the match bytes.
370 int32_t value=readValue(pos, node>>1);
382 pos=skipValue(pos, node);
389 const uint8_t *pos=pos_;
390 if(pos==nullptr) {
394 append(out, *pos); // Next byte of a pending linear-match node.
397 int32_t node=*pos++;
402 pos=skipValue(pos, node);
403 node=*pos++;
409 node=*pos++;
411 getNextBranchBytes(pos, ++node, out);
415 append(out, *pos);
421 BytesTrie::getNextBranchBytes(const uint8_t *pos, int32_t length, ByteSink &out) {
423 ++pos; // ignore the comparison byte
424 getNextBranchBytes(jumpByDelta(pos), length>>1, out);
426 pos=skipDelta(pos);
429 append(out, *pos++);
430 pos=skipValue(pos);
432 append(out, *pos);