Changes between Version 4 and Version 5 of FdoTextReaderEnhancements


Ignore:
Timestamp:
Oct 18, 2007, 2:12:59 PM (17 years ago)
Author:
gregboone
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FdoTextReaderEnhancements

    v4 v5  
    5858}}}
    5959
    60 ''Parameters'':
    61 
    62 outString: the string that was read
    63 
    64 leftDelimiters: list of left delimiter characters; defaults to empty string (L"").
    65 
    66 rightDelimiters: list of right delimiter characters; defaults to empty string (L""). Position is important: 1st left delimiter corresponds to 1st right delimiter and so on. If a right delimiter is not explicitly specified for a particular left delimiter then the right delimiter is the same as the left.
    67 
    68 skipChars: list of characters that can be skipped while looking for the left delimiter; defaults to blank character plus end-of line (L" \n").
    69 
    70 separators: list of separator characters. These are similar to skip characters except that a separator can only occur once between each string that is read; defaults to empty string (L"").
    71 
    72 ''Description'':
    73 
    74 !ReadLine() Reads the current line (from the current position to the next end-of-line character or end-of-stream).
    75 
    76 Read() provides the ability to read delimited strings.
     60'''''Parameters''''':
     61
     62''outString'': the string that was read
     63
     64''leftDelimiters'': list of left delimiter characters; defaults to empty string (L"").
     65
     66''rightDelimiters'': list of right delimiter characters; defaults to empty string (L""). Position is important: 1st left delimiter corresponds to 1st right delimiter and so on. If a right delimiter is not explicitly specified for a particular left delimiter then the right delimiter is the same as the left.
     67
     68''skipChars'': list of characters that can be skipped while looking for the left delimiter; defaults to blank character plus end-of line (L" \n").
     69
     70''separators'': list of separator characters. These are similar to skip characters except that a separator can only occur once between each string that is read; defaults to empty string (L"").
     71
     72'''''Description''''':
     73
     74''!ReadLine()'' Reads the current line (from the current position to the next end-of-line character or end-of-stream).
     75
     76''Read()'' provides the ability to read delimited strings.
    7777
    7878Reading is done according to the following steps:
     
    8383• Any subsequent skipChars or separators are skipped. However, Read() stops if a second separator character is encountered.  In this case, the 2nd separator is not skipped but the current position is set to it.[[br]]
    8484
    85 ''Returns'':
    86 
    87 !ReadLine() returns true if a line was read and false if at the end of the underlying stream.
    88 
    89 Read() returns true if a string was read and false otherwise. false is returned if the end of the stream is reached before a string can be extracted.
     85'''''Returns''''':
     86
     87''!ReadLine()'' returns true if a line was read and false if at the end of the underlying stream.
     88
     89''Read()'' returns true if a string was read and false otherwise. false is returned if the end of the stream is reached before a string can be extracted.
    9090
    9191It is possible for both of the above to return true with outString being an empty string. For !ReadLine(), this happens when the character at the current position is the end-of-line character. For Read() this can happen when there are no characters between the left and right delimeters.
    9292
    93 ''Exceptions'':
    94 
    95 Read() throws an !FdoException if a left delimiter is encountered but end-of-stream is reached before the right delimiter is found.
    96 
    97 ''Example 1'':
     93'''''Exceptions''''':
     94
     95''Read()'' throws an !FdoException if a left delimiter is encountered but end-of-stream is reached before the right delimiter is found.
     96
     97'''''Example 1''''':
    9898
    9999if the data at and after the input stream’s current position looks like this:
     
    114114(**) – the 2nd ("{"} leftDelimiter is encountered before "'", so read is done until the 2nd right delimiter ("}") is reached[[br]]
    115115
    116 ''Example 2'':
     116'''''Example 2''''':
    117117
    118118If a stream contains comma separated values where:
     
    142142"9876"[[br]]
    143143
    144 ''Example 3'':
     144'''''Example 3''''':
    145145
    146146!ReadLine is actually just a convenience function. It is equivalent to:
     
    174174
    175175
    176 ''Parameters'':
    177 
    178 baseSteam: underlying stream where data will ultimately be read from or written to.
    179 
    180 bufferSize: size in bytes of data cache. The cache is used to provide better read/write performance
    181 
    182 ''Description'':
    183 
    184 !GetStream() returns the underlying stream.
    185 
    186 Flush()  if the cache contains data to write, this function writes it to the underlying stream.
     176'''''Parameters''''':
     177
     178''baseSteam'': underlying stream where data will ultimately be read from or written to.
     179
     180''bufferSize'': size in bytes of data cache. The cache is used to provide better read/write performance
     181
     182'''''Description''''':
     183
     184''!GetStream()'' returns the underlying stream.
     185
     186''Flush()''  if the cache contains data to write, this function writes it to the underlying stream.
    187187
    188188This class provides buffered reads and writes from and to an FdoIStream by adding an in-memory cache.
     
    193193
    194194The following class will be added for convenience:
    195 
    196195
    197196{{{