File: HtmRangeIterator.cpp

package info (click to toggle)
siril 1.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 47,656 kB
  • sloc: ansic: 175,395; cpp: 28,654; python: 8,476; makefile: 974; xml: 879; sh: 280
file content (54 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (6)
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
#include <HtmRangeIterator.h>

extern "C" {
// uint64 cc_name2ID(const char *name);
int cc_ID2name(char *name, uint64 id);
}

Key HtmRangeIterator::next()
{
    Key key = this->nextval;
    getNext();
    return key;
}

void HtmRangeIterator::getNext()
{
    if (currange[0] <= 0)
    {
        nextval = -1;
        return;
    }
    nextval++;
    if (nextval > currange[1])
    {
        range->getNext(&currange[0], &currange[1]);
        if (currange[0] <= 0)
        {
            nextval = -1;
            return;
        }
        nextval = currange[0];
    }
    return;
}

char *HtmRangeIterator::nextSymbolic(char *buffer)
{
    Key key = this->next();
    if (key <= 0)
    {
        buffer[0] = '\0';
    }
    else
    {
        cc_ID2name(buffer, key);
    }
    return buffer;
}
bool HtmRangeIterator::hasNext()
{
    return (nextval > 0);
}

// HtmRangeIterator::