Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private System.Nullable<System.Char> ReadChar( System.IO.StringReader reader, System.Nullable<System.Char> escape, System.Char @break, System.Boolean readNextOnBreak ) {
- if ( null == reader ) {
- throw new System.ArgumentNullException( "reader" );
- }
- var p = reader.Peek();
- if ( -1 == p ) {
- return null;
- }
- var c = System.Convert.ToChar( reader.Read() );
- if ( escape.HasValue && escape.Value.Equals( c ) ) {
- return System.Convert.ToChar( reader.Read() );
- }
- if ( @break.Equals( c ) ) {
- if ( readNextOnBreak ) {
- p = reader.Peek();
- if ( -1 == p ) {
- return null;
- } else if ( @break.Equals( System.Convert.ToChar( p ) ) ) {
- return System.Convert.ToChar( reader.Read() );
- }
- }
- return null;
- }
- return c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement