Kstars

HtmRangeIterator.cpp
1#include <HtmRangeIterator.h>
2
3extern "C" {
4// uint64 cc_name2ID(const char *name);
5int cc_ID2name(char *name, uint64 id);
6}
7
8Key HtmRangeIterator::next()
9{
10 Key key = this->nextval;
11 getNext();
12 return key;
13}
14
15void HtmRangeIterator::getNext()
16{
17 if (currange[0] <= 0)
18 {
19 nextval = -1;
20 return;
21 }
22 nextval++;
23 if (nextval > currange[1])
24 {
25 range->getNext(&currange[0], &currange[1]);
26 if (currange[0] <= 0)
27 {
28 nextval = -1;
29 return;
30 }
31 nextval = currange[0];
32 }
33 return;
34}
35
36char *HtmRangeIterator::nextSymbolic(char *buffer)
37{
38 Key key = this->next();
39 if (key <= 0)
40 {
41 buffer[0] = '\0';
42 }
43 else
44 {
45 cc_ID2name(buffer, key);
46 }
47 return buffer;
48}
49bool HtmRangeIterator::hasNext()
50{
51 return (nextval > 0);
52}
53
54// HtmRangeIterator::
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.