KSquare Utilities
KKLSC::StartStopPoint Class Reference

Class that keeps track of parameter details of a single scanner file. More...

#include <StartStopPoint.h>

Public Types

typedef StartStopPointStartStopPointPtr
 
enum  StartStopType : int { StartStopType::Null, StartStopType::StartPoint, StartStopType::StopPoint, StartStopType::Invalid }
 

Public Member Functions

 StartStopPoint (kkint32 _scanLineNum, StartStopType _type)
 
 StartStopPoint (const StartStopPoint &entry)
 
 StartStopPoint (const KKStr &s)
 
 ~StartStopPoint ()
 
kkint32 MemoryConsumedEstimated () const
 
void ParseTabDelStr (KKStr parser)
 
kkint32 ScanLineNum () const
 
void ScanLineNum (const kkint32 _scanLineNum)
 
KKStr ToTabDelStr () const
 
StartStopType Type () const
 
void Type (StartStopType _type)
 
const KKStrTypeStr () const
 

Static Public Member Functions

static StartStopType StartStopTypeFromStr (const KKStr &s)
 
static const KKStrStartStopTypeToStr (StartStopType t)
 

Detailed Description

Class that keeps track of parameter details of a single scanner file.

Definition at line 28 of file StartStopPoint.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
Null 
StartPoint 
StopPoint 
Invalid 

Definition at line 33 of file StartStopPoint.h.

33  : int
34  {Null,
35  StartPoint,
36  StopPoint,
37  Invalid
38  };

Constructor & Destructor Documentation

StartStopPoint::StartStopPoint ( kkint32  _scanLineNum,
StartStopType  _type 
)

Definition at line 50 of file StartStopPoint.cpp.

Referenced by KKLSC::StartStopPointList::AddEntry().

52  :
53  scanLineNum (_scanLineNum),
54  type (_type)
55 {
56 }
StartStopPoint::StartStopPoint ( const StartStopPoint entry)

Definition at line 60 of file StartStopPoint.cpp.

60  :
61  scanLineNum (entry.scanLineNum),
62  type (entry.type)
63 {
64 }
StartStopPoint::StartStopPoint ( const KKStr s)

Definition at line 68 of file StartStopPoint.cpp.

References Invalid, and ParseTabDelStr().

Referenced by KKLSC::ScannerFile::LoadIndexFile().

68  :
69  scanLineNum (-1),
71 {
72  ParseTabDelStr (s);
73 }
void ParseTabDelStr(KKStr parser)
StartStopPoint::~StartStopPoint ( )

Definition at line 77 of file StartStopPoint.cpp.

78 {
79 }

Member Function Documentation

kkint32 StartStopPoint::MemoryConsumedEstimated ( ) const

Definition at line 82 of file StartStopPoint.cpp.

Referenced by KKLSC::StartStopPointList::MemoryConsumedEstimated().

83 {
84  return sizeof (*this);
85 }
void StartStopPoint::ParseTabDelStr ( KKStr  parser)

Definition at line 99 of file StartStopPoint.cpp.

References KKB::KKStr::Concat(), KKB::KKStr::ExtractToken2(), KKB::KKStr::ExtractTokenInt(), and StartStopTypeFromStr().

Referenced by StartStopPoint().

100 {
101  scanLineNum = parser.ExtractTokenInt ("\t");
102  KKStr typeStr = parser.ExtractToken2 ("\t");
103  type = StartStopTypeFromStr (typeStr);
104 }
KKStr ExtractToken2(const char *delStr="\n\t\r ")
Extract first Token from the string.
Definition: KKStr.cpp:3026
static StartStopType StartStopTypeFromStr(const KKStr &s)
kkint32 ExtractTokenInt(const char *delStr)
Definition: KKStr.cpp:3129
kkint32 KKLSC::StartStopPoint::ScanLineNum ( ) const
inline

Definition at line 56 of file StartStopPoint.h.

Referenced by KKLSC::StartStopPointList::AddEntry().

56 {return scanLineNum;}
void KKLSC::StartStopPoint::ScanLineNum ( const kkint32  _scanLineNum)
inline

Definition at line 60 of file StartStopPoint.h.

60 {scanLineNum = _scanLineNum;}
StartStopPoint::StartStopType StartStopPoint::StartStopTypeFromStr ( const KKStr s)
static

Definition at line 41 of file StartStopPoint.cpp.

References KKB::KKStr::EqualIgnoreCase(), Invalid, and Null.

Referenced by ParseTabDelStr().

42 {
43  for (int x = (int)StartStopType::Null; x < (int)StartStopType::Invalid; ++x)
44  if (s.EqualIgnoreCase (startStopPointStrs[x]))
45  return (StartStopType)x;
46  return StartStopType::Null;
47 }
bool EqualIgnoreCase(const KKStr &s2) const
Definition: KKStr.cpp:1250
const KKStr & StartStopPoint::StartStopTypeToStr ( StartStopType  t)
static

Definition at line 32 of file StartStopPoint.cpp.

References Invalid, and Null.

Referenced by TypeStr().

33 {
34  if (t <= StartStopType::Null) return (startStopPointStrs[(int)StartStopType::Null]);
35  if (t >= StartStopType::Invalid) return (startStopPointStrs[(int)StartStopType::Invalid]);
36  return (startStopPointStrs[(int)t]);
37 }
KKStr StartStopPoint::ToTabDelStr ( ) const

Definition at line 90 of file StartStopPoint.cpp.

References KKB::KKStr::Concat(), KKB::KKStr::KKStr(), and TypeStr().

91 {
92  KKStr s (48);
93  s << scanLineNum << "\t" << TypeStr ();
94  return s;
95 }
const KKStr & TypeStr() const
StartStopType KKLSC::StartStopPoint::Type ( ) const
inline

Definition at line 57 of file StartStopPoint.h.

Referenced by KKLSC::StartStopPointList::AddEntry(), and KKLSC::ScannerFile::LoadIndexFile().

57 {return type;}
void KKLSC::StartStopPoint::Type ( StartStopType  _type)
inline

Definition at line 61 of file StartStopPoint.h.

Referenced by KKLSC::StartStopPointList::AddEntry().

61 {type = _type;}
const KKStr& KKLSC::StartStopPoint::TypeStr ( ) const
inline

Definition at line 58 of file StartStopPoint.h.

References StartStopTypeToStr().

Referenced by ToTabDelStr().

58 {return StartStopTypeToStr (type);}
static const KKStr & StartStopTypeToStr(StartStopType t)

The documentation for this class was generated from the following files: