# HUtilityTextParser

## Functions

| `HUtilityTextParser`
| `~HUtilityTextParser`
void | `SetDelimiterList`
char | `GetStartDelimiter`
char | `GetEndDelimiter`
char | `PeekAt`
void | `Rewind`
void | `SkipAhead`
bool | `ParseBuffer`
bool | `ParseBuffer`
void | `InsertBuffer`

## Detailed Description

class HUtilityTextParser

  The HUtilityTextParser is used for parsing of text using one or more delimiter lists.

  Public Functions

  HUtilityTextParser()

    Constructs an HUtilityXMLTag object

  virtual ~HUtilityTextParser()
  void SetDelimiterList(const delimiter_t dlist[], unsigned int length)

    Sets the list of delimiters used for parsing

    Parameters

      - dlist – List of Delimiter Objects

      - length – Length of Delimiter List

  inline char GetStartDelimiter()
    Returns

      Start delimiter of currently parsed string

  inline char GetEndDelimiter()
    Returns

      End delimiter of currently parsed string

  inline char PeekAt(unsigned int i = 0)
    Parameters

      i – Character Position to Peek

    Returns

      Character at requested position in currently parsed string

  inline void Rewind()

    Restarts Parsing at previous position

  inline void SkipAhead(int snum)

    Skip x number of characters ahead in currently parsed string

    Parameters

      snum – Amount of Characters to Skip Ahead

  bool ParseBuffer(char *tempbuf, int &dnum, const delimiter_t dlist[], unsigned int length, bool checkforquote = true)

    Parse String using delimiter list

    Parameters

      - tempbuf – Returns next string token

      - dnum – Number of Delimiter Object

      - dlist – Delimiter List Used for Parsing

      - length – Length of Delimiter List

      - checkforquote – True: Keeps track of quotes in string

    Returns

      True: String not parsed to end

  bool ParseBuffer(const char *searchbuffer, char *tempbuf, int &dnum, const delimiter_t dlist[], unsigned int length, bool checkforquote = true)

    Parse String using delimiter list

    Parameters

      - searchbuffer – String to Parse

      - tempbuf – Returns next string token

      - dnum – Number of Delimiter Object

      - dlist – Delimiter List Used for Parsing

      - length – Length of Delimiter List

      - checkforquote – True: Keeps track of quotes in string

    Returns

      True: String not parsed to end

  void InsertBuffer(const char *buffer, unsigned int bufferlength)

    Pass new string buffer for parsing

    Parameters

      - buffer – String buffer to parse

      - bufferlength – Length of buffer