Kstars

HtmRangeIterator.cpp
1 #include <HtmRangeIterator.h>
2 
3 extern "C" {
4 // uint64 cc_name2ID(const char *name);
5 int cc_ID2name(char *name, uint64 id);
6 }
7 
8 Key HtmRangeIterator::next()
9 {
10  Key key = this->nextval;
11  getNext();
12  return key;
13 }
14 
15 void 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 
36 char *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 }
49 bool HtmRangeIterator::hasNext()
50 {
51  return (nextval > 0);
52 }
53 
54 // HtmRangeIterator::
const QList< QKeySequence > & next()
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 19 2022 03:57:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.