Ignore:
Timestamp:
Jan 19, 2024, 2:44:41 AM (20 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
ac939461
Parents:
59c8dff (diff), e8b3717 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.hfa

    r59c8dff rf988834  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Nov 15 17:55:31 2023
    13 // Update Count     : 596
     12// Last Modified On : Wed Jan  3 10:53:18 2024
     13// Update Count     : 610
    1414//
    1515
     
    392392        union {
    393393                const char * scanset;
    394                 char delimiter[2];
     394                char delimiters[3];                                                             // [0] => left, [1] => right
    395395        };
    396396        int wd;                                                                                         // width
     
    412412
    413413struct _Istream_Cquoted {
    414         char * s;
    415         inline _Istream_str_base;
     414        _Istream_Cstr cstr;
    416415}; // _Istream_Cquoted
    417416
     
    419418        // width must include room for null terminator
    420419        _Istream_Cstr wdi( unsigned int wd, char s[] ) { return (_Istream_Cstr)@{ s, { {0p}, wd, {.all : 0} } }; }
    421         // read width does not include null terminator
    422420        _Istream_Cstr wdi( unsigned int wd, unsigned int rwd, char s[] ) {
    423421                if ( wd <= rwd ) throw (cstring_length){ &cstring_length_vt };
    424422                return (_Istream_Cstr)@{ s, { {0p}, rwd, {.flags.rwd : true} } };
    425423        }
    426         _Istream_Cquoted & quoted( _Istream_Cstr & fmt, const char delimiter = '"' ) {
    427                 fmt.delimiter[0] = delimiter; fmt.delimiter[1] = '\0';
     424        _Istream_Cquoted & quoted( _Istream_Cstr & fmt, const char Ldelimiter = '"', const char Rdelimiter = '\0' ) {
     425                fmt.delimiters[0] = Ldelimiter;  fmt.delimiters[1] = Rdelimiter;  fmt.delimiters[2] = '\0';
    428426                return (_Istream_Cquoted &)fmt;
    429427        }
    430428        _Istream_Cstr & getline( _Istream_Cstr & fmt, const char delimiter = '\n' ) {
    431                 fmt.delimiter[0] = delimiter; fmt.delimiter[1] = '\0'; fmt.flags.delimiter = true; fmt.flags.inex = true; return fmt; }
     429                fmt.delimiters[0] = delimiter; fmt.delimiters[1] = '\0'; fmt.flags.delimiter = true; fmt.flags.inex = true; return fmt;
     430        }
    432431        _Istream_Cstr & incl( const char scanset[], _Istream_Cstr & fmt ) { fmt.scanset = scanset; fmt.flags.inex = false; return fmt; }
    433432        _Istream_Cstr & excl( const char scanset[], _Istream_Cstr & fmt ) { fmt.scanset = scanset; fmt.flags.inex = true; return fmt; }
Note: See TracChangeset for help on using the changeset viewer.