25 using namespace KKLSC;
29 KKB::
KKStr StartStopPoint::startStopPointStrs [] = {
"NULL",
"StartPoint",
"Start",
"StopPoint",
"Stop",
"Invalid",
""};
36 return (startStopPointStrs[(
int)t]);
53 scanLineNum (_scanLineNum),
61 scanLineNum (entry.scanLineNum),
84 return sizeof (*
this);
125 StartStopPointPtr e = back ();
140 for (idx2 = begin (); idx2 != end (); ++idx2)
142 StartStopPointPtr sp = *idx2;
170 StartStopPointPtr entryAdded = _entry;
178 StartStopPointPtr existingEntry = (*
this)[m];
181 entryAdded = existingEntry;
190 insert (idx, _entry);
201 kkint32 m = FindEqual (_scanLineNum);
205 StartStopPointPtr entry = (*
this)[m];
206 erase (begin () + m);
226 entryScanLineNum = (*
this)[m]->ScanLineNum ();
228 if (entryScanLineNum == _scanLineNum)
231 if (entryScanLineNum > _scanLineNum)
249 if ((*
this)[size () - 1]->ScanLineNum () < _scanLineNum)
253 kkint32 e = (kkint32)size () - 1;
262 entryScanLineNum = (*
this)[m]->ScanLineNum ();
264 if (entryScanLineNum == _scanLineNum)
267 if (entryScanLineNum > _scanLineNum)
275 if (entryScanLineNum > _scanLineNum)
278 if (m < ((kkint32)size () - 1))
291 if ((*
this)[0]->ScanLineNum () > _scanLineNum)
295 kkint32 e = (kkint32)size () - 1;
304 entryScanLineNum = (*
this)[m]->ScanLineNum ();
306 if (entryScanLineNum == _scanLineNum)
309 if (entryScanLineNum > _scanLineNum)
317 if (entryScanLineNum < _scanLineNum)
330 kkint32 m = FindLessOrEqual (_scanLineNum);
341 kkint32 m = FindGreaterOrEqual (_scanLineNum);
355 else if (size () == 1)
358 kkint32 m = FindLessOrEqual (_scanLineNum);
362 if (m >= ((kkint32)size () - 1))
365 kkint32 deltaBefore = (_scanLineNum - (*
this)[m]->ScanLineNum ());
366 kkint32 deltaAfter = (*
this)[m + 1]->ScanLineNum () - _scanLineNum;
367 if (deltaBefore <= deltaAfter)
370 return (*
this)[m + 1];
396 if (startStopPoints.size () < 1)
398 PushOnBack (
new StartStopRegion (0,
int32_max));
402 kkint32 prevLineNum = 0;
403 StartStopPoint::StartStopType prevType = StartStopPoint::StartStopType::StartPoint;
405 StartStopPointList::const_iterator idx = startStopPoints.begin ();
406 while (idx != startStopPoints.end ())
408 kkint32 nextLineNum = (*idx)->ScanLineNum ();
409 StartStopPoint::StartStopType nextType = (*idx)->Type ();
411 if (prevType == StartStopPoint::StartStopType::StartPoint)
413 if (nextType == StartStopPoint::StartStopType::StopPoint)
415 PushOnBack (
new StartStopRegion (prevLineNum, nextLineNum));
417 prevLineNum = nextLineNum;
427 if (nextType == StartStopPoint::StartStopType::StopPoint)
435 prevLineNum = nextLineNum;
442 if (prevType == StartStopPoint::StartStopType::StartPoint)
444 PushOnBack (
new StartStopRegion (prevLineNum,
int32_max));
KKStr(kkint32 size)
Creates a KKStr object that pre-allocates space for 'size' characters.
static const KKStr & StartStopTypeToStr(StartStopType t)
KKStr ToTabDelStr() const
void DeleteEntry(kkint32 _scanLineNum)
KKStr ExtractToken2(const char *delStr="\n\t\r ")
Extract first Token from the string.
kkint32 ScanLineNum() const
StartStopRegionList(const StartStopPointList &startStopPoints)
StartStopRegion(kkint32 _start, kkint32 _end)
StartStopPointPtr PrevEntry(kkint32 _scanLineNum) const
bool EqualIgnoreCase(const KKStr &s2) const
unsigned __int32 kkuint32
StartStopPointPtr SuccEntry(kkint32 _scanLineNum) const
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
void ParseTabDelStr(KKStr parser)
StartStopPoint(kkint32 _scanLineNum, StartStopType _type)
Contains Classes that are specific to Cameras physical characteristics.
StartStopType Type() const
Defines a single region in a Scanner File that is to be included in a count.
static StartStopType StartStopTypeFromStr(const KKStr &s)
StartStopPointPtr AddEntry(kkint32 _scanLineNum, StartStopPoint::StartStopType _type)
kkint32 MemoryConsumedEstimated() const
kkint32 ExtractTokenInt(const char *delStr)
StartStopPointPtr NearestEntry(kkint32 _scanLineNum) const
StartStopPoint(const KKStr &s)
StartStopRegionList(bool _owner)
StartStopPointPtr AddEntry(StartStopPointPtr &_entry)
kkint32 MemoryConsumedEstimated() const
void Type(StartStopType _type)
const KKStr & TypeStr() const
StartStopPoint(const StartStopPoint &entry)
Class that keeps track of parameter details of a single scanner file.