Lines Matching refs:pos

30 BytesTrie::readValue(const uint8_t *pos, int32_t leadByte) {
35 value=((leadByte-kMinTwoByteValueLead)<<8)|*pos;
37 value=((leadByte-kMinThreeByteValueLead)<<16)|(pos[0]<<8)|pos[1];
39 value=(pos[0]<<16)|(pos[1]<<8)|pos[2];
41 value=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
47 BytesTrie::jumpByDelta(const uint8_t *pos) {
48 int32_t delta=*pos++;
52 delta=((delta-kMinTwoByteDeltaLead)<<8)|*pos++;
54 delta=((delta-kMinThreeByteDeltaLead)<<16)|(pos[0]<<8)|pos[1];
55 pos+=2;
57 delta=(pos[0]<<16)|(pos[1]<<8)|pos[2];
58 pos+=3;
60 delta=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
61 pos+=4;
63 return pos+delta;
68 const uint8_t *pos=pos_;
69 if(pos==NULL) {
73 return (remainingMatchLength_<0 && (node=*pos)>=kMinValueLead) ?
79 BytesTrie::branchNext(const uint8_t *pos, int32_t length, int32_t inByte) {
82 length=*pos++;
88 if(inByte<*pos++) {
90 pos=jumpByDelta(pos);
93 pos=skipDelta(pos);
100 if(inByte==*pos++) {
102 int32_t node=*pos;
109 ++pos;
110 // int32_t delta=readValue(pos, node>>1);
116 delta=((node-kMinTwoByteValueLead)<<8)|*pos++;
118 delta=((node-kMinThreeByteValueLead)<<16)|(pos[0]<<8)|pos[1];
119 pos+=2;
121 delta=(pos[0]<<16)|(pos[1]<<8)|pos[2];
122 pos+=3;
124 delta=(pos[0]<<24)|(pos[1]<<16)|(pos[2]<<8)|pos[3];
125 pos+=4;
128 pos+=delta;
129 node=*pos;
132 pos_=pos;
136 pos=skipValue(pos);
138 if(inByte==*pos++) {
139 pos_=pos;
140 int32_t node=*pos;
149 BytesTrie::nextImpl(const uint8_t *pos, int32_t inByte) {
151 int32_t node=*pos++;
153 return branchNext(pos, node, inByte);
157 if(inByte==*pos++) {
159 pos_=pos;
160 return (length<0 && (node=*pos)>=kMinValueLead) ?
171 pos=skipValue(pos, node);
173 U_ASSERT(*pos<kMinValueLead);
182 const uint8_t *pos=pos_;
183 if(pos==NULL) {
192 if(inByte==*pos++) {
194 pos_=pos;
196 return (length<0 && (node=*pos)>=kMinValueLead) ?
203 return nextImpl(pos, inByte);
212 const uint8_t *pos=pos_;
213 if(pos==NULL) {
225 pos_=pos;
227 return (length<0 && (node=*pos)>=kMinValueLead) ?
234 if(inByte!=*pos) {
238 ++pos;
245 pos_=pos;
247 return (length<0 && (node=*pos)>=kMinValueLead) ?
256 if(inByte!=*pos) {
260 ++pos;
265 int32_t node=*pos++;
267 UStringTrieResult result=branchNext(pos, node, inByte);
288 pos=pos_; // branchNext() advanced pos and wrote it to pos_ .
292 if(inByte!=*pos) {
296 ++pos;
305 pos=skipValue(pos, node);
307 U_ASSERT(*pos<kMinValueLead);
314 BytesTrie::findUniqueValueFromBranch(const uint8_t *pos, int32_t length,
317 ++pos; // ignore the comparison byte
318 if(NULL==findUniqueValueFromBranch(jumpByDelta(pos), length>>1, haveUniqueValue, uniqueValue)) {
322 pos=skipDelta(pos);
325 ++pos; // ignore a comparison byte
327 int32_t node=*pos++;
329 int32_t value=readValue(pos, node>>1);
330 pos=skipValue(pos, node);
341 if(!findUniqueValue(pos+value, haveUniqueValue, uniqueValue)) {
347 return pos+1; // ignore the last comparison byte
351 BytesTrie::findUniqueValue(const uint8_t *pos, UBool haveUniqueValue, int32_t &uniqueValue) {
353 int32_t node=*pos++;
356 node=*pos++;
358 pos=findUniqueValueFromBranch(pos, node+1, haveUniqueValue, uniqueValue);
359 if(pos==NULL) {
365 pos+=node-kMinLinearMatch+1; // Ignore the match bytes.
368 int32_t value=readValue(pos, node>>1);
380 pos=skipValue(pos, node);
387 const uint8_t *pos=pos_;
388 if(pos==NULL) {
392 append(out, *pos); // Next byte of a pending linear-match node.
395 int32_t node=*pos++;
400 pos=skipValue(pos, node);
401 node=*pos++;
407 node=*pos++;
409 getNextBranchBytes(pos, ++node, out);
413 append(out, *pos);
419 BytesTrie::getNextBranchBytes(const uint8_t *pos, int32_t length, ByteSink &out) {
421 ++pos; // ignore the comparison byte
422 getNextBranchBytes(jumpByDelta(pos), length>>1, out);
424 pos=skipDelta(pos);
427 append(out, *pos++);
428 pos=skipValue(pos);
430 append(out, *pos);