NCBI C++ ToolKit
Public Types | Public Member Functions | List of all members
CStrTokenize< TStr, TV, TP, TCount, TReserve > Class Template Reference

Search Toolkit Book for CStrTokenize

Main tokenization algorithm. More...

#include <corelib/ncbistr_util.hpp>

+ Inheritance diagram for CStrTokenize< TStr, TV, TP, TCount, TReserve >:
+ Collaboration diagram for CStrTokenize< TStr, TV, TP, TCount, TReserve >:

Public Types

typedef TStr TString
 
typedef TV TContainer
 
typedef TP TPosContainer
 
typedef TCount TCountTrait
 
typedef TReserve TReserveTrait
 
- Public Types inherited from CStrTokenizeBase
typedef NStr::TSplitFlags TFlags
 

Public Member Functions

 CStrTokenize (const TString &str, const TString &delim, TFlags flags, CTempString_Storage *storage)
 Constructor. More...
 
void Do (TContainer &target, TPosContainer &token_pos, const TString &empty_str=TString())
 Tokenize the string using the specified set of char delimiters. More...
 
- Public Member Functions inherited from CStrTokenizeBase
 CStrTokenizeBase (const CTempString &str, const CTempString &delim, TFlags flags, CTempString_Storage *storage)
 
SIZE_TYPE GetPos (void) const
 
bool AtEnd (void) const
 
bool Advance (CTempStringList *part_collector)
 Return TRUE if it found some text and put it into collector. More...
 
bool Advance (CTempStringList *part_collector, SIZE_TYPE *ptr_part_start, SIZE_TYPE *ptr_delim_pos)
 
void SkipDelims (void)
 Skip all delimiters starting from current position. More...
 
void MergeDelims (void)
 Assumes that we already have a delimiter on the previous position, so just skip all subsequent, depending on flags. More...
 
void SetDelim (const CTempString &delim)
 

Additional Inherited Members

- Protected Attributes inherited from CStrTokenizeBase
const CTempStringm_Str
 
CTempString m_Delim
 
SIZE_TYPE m_Pos
 
TFlags m_Flags
 
CTempString_Storagem_Storage
 

Detailed Description

template<class TStr, class TV, class TP = CStrDummyTokenPos, class TCount = CStrDummyTokenCount, class TReserve = CStrDummyTargetReserve<TV, TP>>
class CStrTokenize< TStr, TV, TP, TCount, TReserve >

Main tokenization algorithm.

TStr - string type (must follow std::string interface) TV - container type for tokens (std::vector) TP - target container type for token positions (vector<size_t>) TCount - token count trait for the target container space reservation TReserve- target space reservation trait

Definition at line 226 of file ncbistr_util.hpp.


The documentation for this class was generated from the following file:
Modified on Fri Dec 01 04:45:50 2023 by modify_doxy.py rev. 669887