fs::ut::str::Toknzr_t Class Reference

#include <fsStrUt.h>

Collaboration diagram for fs::ut::str::Toknzr_t:

Collaboration graph
[legend]
List of all members.

Detailed Description

String tokenizer.

Toknzr_t parses the input text sequentially and provides individual tokens according to the given criteria (quoted tokens are also supported). Note that Toknzr_t doesn't copy the input text, so there is no memory overhead. The example of the usage see below.

    fs::ut::str::Toknzr_t Toknzr("one, two, \"t h r e e\"", " ,", '\"');
    for(const char *pszTok = Toknzr.Next(); pszTok; pszTok = Toknzr.Next())
    {
        ::printf("token: %s\n", pszTok);
    }
Examples:

_tests/fsStrUt/main.cpp.

Definition at line 106 of file fsStrUt.h.

Public Member Functions

 Toknzr_t (const char *pszText, const char *pszSprs=" \t", char chQuote= '\"')
 Receives the input text and parsing criteria.
 ~Toknzr_t ()
const char * Next ()
 Returns the next token (0 - no more tokens or error).

Private Member Functions

 Toknzr_t ()
 No def ctor.
 Toknzr_t (const Toknzr_t &)
 No copy.
Toknzr_toperator= (const Toknzr_t &)
 No assignment.

Private Attributes

void * m_pImpl
 The PIPML idiom is used.


Constructor & Destructor Documentation

Toknzr_t::Toknzr_t ( const char *  pszText,
const char *  pszSprs = " \t",
char  chQuote = '\"' 
) [explicit]

Receives the input text and parsing criteria.

Definition at line 254 of file fsStrUt.cpp.

References FS_ASSERT_MSG, and m_pImpl.

Toknzr_t::~Toknzr_t (  ) 

Definition at line 260 of file fsStrUt.cpp.

References FS_ASSERT_MSG, and m_pImpl.

fs::ut::str::Toknzr_t::Toknzr_t (  )  [private]

No def ctor.

fs::ut::str::Toknzr_t::Toknzr_t ( const Toknzr_t  )  [private]

No copy.


Member Function Documentation

const char * Toknzr_t::Next (  ) 

Returns the next token (0 - no more tokens or error).

Examples:
_tests/fsStrUt/main.cpp.

Definition at line 266 of file fsStrUt.cpp.

References FS_ASSERT_MSG, and m_pImpl.

Toknzr_t& fs::ut::str::Toknzr_t::operator= ( const Toknzr_t  )  [private]

No assignment.


Member Data Documentation

void* fs::ut::str::Toknzr_t::m_pImpl [private]

The PIPML idiom is used.

Definition at line 124 of file fsStrUt.h.


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

FipS' Code (Thu Feb 15 22:43:56 2007) - (c) Filip STOKLAS (FipS) - [ www ] [ Guest Book ]