proj home

Files   Classes   Functions   Hierarchy  

tokenizerfind Class Reference

Search and index into the string without changing it. More...

#include <tokenizerfind.h>

Collaboration diagram for tokenizerfind:

List of all members.

Public Member Functions

 tokenizerfind (tokenizer &ref_)
 Constructor.
 tokenizerfind (tokenizer &ref_, stringc &atom_)
 Constructor.
boolc find (stringc &atom1)
 From current find the next atom1.
boolc find (stringc &atom1, stringc &atom2)
boolc find (stringc &atom1, stringc &atom2, stringc &atom3)
boolc find (stringc &atom1, stringc &atom2, stringc &atom3, stringc &atom4)
boolc find (stringc &atom1, stringc &atom2, stringc &atom3, stringc &atom4, stringc &atom5)
boolc find (stringc &atom1, stringc &atom2, stringc &atom3, stringc &atom4, stringc &atom5, stringc &atom6)
boolc reset ()
 Resets token iteration.
boolc operator! ()
 Can the stream be read?
void operator++ ()
 Increment the stream's index.
stringcoperator() () const
 Access the current token in the stream.
string & operator* ()

Public Attributes

tokenizerref
 Reference.
string::size_type index
 Index into the string pointed to by ref.current.
string atom
 Immediate target string.


Detailed Description

Search and index into the string without changing it.

Excludes tokenizer::current. Compare this with tokenizer::atomize_next which tokenizes the finds.

Definition at line 13 of file tokenizerfind.h.


Constructor & Destructor Documentation

tokenizerfind::tokenizerfind ( tokenizer ref_  )  [inline]

Constructor.

Definition at line 26 of file tokenizerfind.h.

00027     : ref(ref_), index(0) {}

tokenizerfind::tokenizerfind ( tokenizer ref_,
stringc atom_ 
) [inline]

Constructor.

Definition at line 29 of file tokenizerfind.h.

00030     : ref(ref_), index(0), atom(atom_) {}


Member Function Documentation

boolc tokenizerfind::find ( stringc atom1,
stringc atom2,
stringc atom3,
stringc atom4,
stringc atom5,
stringc atom6 
)

Definition at line 33 of file tokenizerfind.cpp.

References find(), and index.

00034 {
00035   if (find(atom1)==false)
00036     return false;
00037 
00038   index += atom1.length()-1;
00039   return find(atom2,atom3,atom4,atom5,atom6);
00040 }

boolc tokenizerfind::find ( stringc atom1,
stringc atom2,
stringc atom3,
stringc atom4,
stringc atom5 
)

Definition at line 42 of file tokenizerfind.cpp.

References find(), and index.

00043 {
00044   if (find(atom1)==false)
00045     return false;
00046 
00047   index += atom1.length()-1;
00048   return find(atom2,atom3,atom4,atom5);
00049 }

boolc tokenizerfind::find ( stringc atom1,
stringc atom2,
stringc atom3,
stringc atom4 
)

Definition at line 51 of file tokenizerfind.cpp.

References find(), and index.

00052 {
00053   if (find(atom1)==false)
00054     return false;
00055 
00056   index += atom1.length()-1;
00057   return find(atom2,atom3,atom4);
00058 }

boolc tokenizerfind::find ( stringc atom1,
stringc atom2,
stringc atom3 
)

Definition at line 60 of file tokenizerfind.cpp.

References find(), and index.

00061 {
00062   if (find(atom1)==false)
00063     return false;
00064 
00065   index += atom1.length()-1;
00066   return find(atom2,atom3);
00067 }

boolc tokenizerfind::find ( stringc atom1,
stringc atom2 
)

Definition at line 69 of file tokenizerfind.cpp.

References find(), and index.

00070 {
00071   if (find(atom1)==false)
00072     return false;
00073 
00074   index += atom1.length()-1;
00075   return find(atom2);
00076 }

boolc tokenizerfind::find ( stringc atom1  ) 

From current find the next atom1.

Definition at line 78 of file tokenizerfind.cpp.

References atom, and reset().

Referenced by find().

00079 {
00080   atom=atom1;
00081   return reset();
00082 }

boolc tokenizerfind::operator! (  ) 

Can the stream be read?

Definition at line 8 of file tokenizerfind.cpp.

References ref.

00009 { 
00010   return !ref; 
00011 }

stringc & tokenizerfind::operator() (  )  const

Access the current token in the stream.

Definition at line 19 of file tokenizerfind.cpp.

References ref.

00020 { 
00021   return ref(); 
00022 }

string & tokenizerfind::operator* (  ) 

Definition at line 24 of file tokenizerfind.cpp.

References ref.

00025 { 
00026   return *ref; 
00027 }

void tokenizerfind::operator++ (  ) 

Increment the stream's index.

Definition at line 13 of file tokenizerfind.cpp.

References atom, tokenizer::find(), index, and ref.

00014 { 
00015   ++index; 
00016   ref.find(index,atom,index); 
00017 }

boolc tokenizerfind::reset (  ) 

Resets token iteration.

Definition at line 3 of file tokenizerfind.cpp.

References atom, tokenizer::find(), index, and ref.

Referenced by find().

00004 { 
00005   return ref.find(index,atom); 
00006 }


Member Data Documentation

Immediate target string.

Definition at line 23 of file tokenizerfind.h.

Referenced by find(), operator++(), and reset().

string::size_type tokenizerfind::index

Index into the string pointed to by ref.current.

Definition at line 21 of file tokenizerfind.h.

Referenced by find(), operator++(), and reset().

Reference.

Definition at line 18 of file tokenizerfind.h.

Referenced by operator!(), operator()(), operator*(), operator++(), and reset().


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

Generated on Fri Mar 4 00:50:20 2011 for Chelton Evans Source by  doxygen 1.5.8