Main Page | Class Hierarchy | Class List | Class Members

SC::Scanner Class Reference

List of all members.

Public Member Functions

object[] Scan (string text, string fieldSpecification)
void Scan (string text, string fieldSpecification, params object[] targets)

Detailed Description

Summary description for Scanner.


Member Function Documentation

void SC::Scanner::Scan string  text,
string  fieldSpecification,
params object[]  targets
[inline]
 

Scan memics scanf. A master regular expression pattern is created that will group each "word" in the text and using regex grouping extract the values for the field specifications. Example text: "Hello true 6.5" fieldSpecification: "{0} {1} {2}" and the target array has objects of these types: "String, ,Boolean, Double" The targets are scanned and each target type is extracted in order to build a master pattern based on these types The fieldSpecification and target types will result in the generation of a master Pattern: ([]+)+(true|false)+([-]|[.]|[-.]|[0-9][0-9]*[.]*[0-9]+) This masterPattern is ran against the text string and the groups are extracted and placed back into the targets

object [] SC::Scanner::Scan string  text,
string  fieldSpecification
[inline]
 

Scan memics scanf. A master regular expression pattern is created that will group each "word" in the text and using regex grouping extract the values for the field specifications. Example text: "Hello true 6.5" fieldSpecification: "{String} {Boolean} {Double}" The fieldSpecification will result in the generation of a master Pattern: ([]+)+(true|false)+([-]|[.]|[-.]|[0-9][0-9]*[.]*[0-9]+) This masterPattern is ran against the text string and the groups are extracted. A string that may contain simple field specifications of the form {Int16}, {String}, etc object[] that contains values for each field


The documentation for this class was generated from the following file:
Generated on Sat Jan 15 23:58:59 2005 for StreamCtrl by doxygen 1.3.6