Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
cSimpleStringList Class Reference

A simple string list. (Fixed maximum number of strings of fixed maximum length) More...

#include <simplestringlist.h>

Public Types

enum  { eMAX_LINES = 256, eMAX_CHARS = 256 }
 anonymous enum instead of define macros More...
 

Public Member Functions

 cSimpleStringList ()
 Default constructor: init members. More...
 
char * CurrentLine ()
 Return the current line. More...
 
int Length () const
 Return number of lines stored. More...
 
char * NextLine ()
 Return the next line, this increases current_line. More...
 
char * operator[] (int index)
 return ptr to line with index. More...
 
char const * operator[] (int index) const
 return ptr to line with index. More...
 
void Reset ()
 reset list More...
 

Public Attributes

int current_line
 the index of the current line. For empty cSimpleStringLists this is -1. More...
 

Protected Attributes

char line [eMAX_LINES][eMAX_CHARS]
 a fixed length array of lines with fixed length More...
 

Detailed Description

A simple string list. (Fixed maximum number of strings of fixed maximum length)

Definition at line 70 of file simplestringlist.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

anonymous enum instead of define macros

Enumerator
eMAX_LINES 
eMAX_CHARS 

Definition at line 79 of file simplestringlist.h.

Constructor & Destructor Documentation

◆ cSimpleStringList()

USING_NAMESPACE_SDH cSimpleStringList::cSimpleStringList ( )

Default constructor: init members.

Definition at line 65 of file simplestringlist.cpp.

Member Function Documentation

◆ CurrentLine()

char * cSimpleStringList::CurrentLine ( )

Return the current line.

Definition at line 72 of file simplestringlist.cpp.

◆ Length()

int cSimpleStringList::Length ( ) const

Return number of lines stored.

Definition at line 88 of file simplestringlist.cpp.

◆ NextLine()

char * cSimpleStringList::NextLine ( )

Return the next line, this increases current_line.

Definition at line 79 of file simplestringlist.cpp.

◆ operator[]() [1/2]

char * cSimpleStringList::operator[] ( int  index)

return ptr to line with index.

if index < 0 then the numbering starts from the end, thus [-1] gives the last line, [-2] the next to last, ...

Definition at line 95 of file simplestringlist.cpp.

◆ operator[]() [2/2]

char const * cSimpleStringList::operator[] ( int  index) const

return ptr to line with index.

if index < 0 then the numbering starts from the end, thus [-1] gives the last line, [-2] the next to last, ...

Definition at line 109 of file simplestringlist.cpp.

◆ Reset()

void cSimpleStringList::Reset ( )

reset list

Definition at line 123 of file simplestringlist.cpp.

Member Data Documentation

◆ current_line

int cSimpleStringList::current_line

the index of the current line. For empty cSimpleStringLists this is -1.

Definition at line 75 of file simplestringlist.h.

◆ line

char cSimpleStringList::line[eMAX_LINES][eMAX_CHARS]
protected

a fixed length array of lines with fixed length

Definition at line 120 of file simplestringlist.h.


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


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Wed Mar 2 2022 01:00:59