Ignore:
Timestamp:
Apr 27, 2021, 10:13:14 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
bbbd2c4
Parents:
f451177
Message:

rename strstream to ostrstream, first draft of istrstream but problem parsing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/strstream.hfa

    rf451177 r666483d  
    1010// Created On       : Thu Apr 22 22:20:59 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Apr 24 11:17:33 2021
    13 // Update Count     : 37
     12// Last Modified On : Tue Apr 27 20:58:50 2021
     13// Update Count     : 41
    1414//
    1515
     
    2020
    2121
    22 // *********************************** strstream ***********************************
     22// *********************************** ostrstream ***********************************
    2323
    2424
    25 enum { strstream_sepSize = 16 };
    26 struct strstream {                                                                              // satisfied basic_ostream
     25enum { ostrstream_sepSize = 16 };
     26struct ostrstream {                                                                             // satisfied basic_ostream
    2727        char * buf$;
    2828        size_t size$;
     
    3434        bool sawNL$;
    3535        const char * sepCur$;
    36         char separator$[strstream_sepSize];
    37         char tupleSeparator$[strstream_sepSize];
    38 }; // strstream
     36        char separator$[ostrstream_sepSize];
     37        char tupleSeparator$[ostrstream_sepSize];
     38}; // ostrstream
    3939
    4040// Satisfies basic_ostream
    4141
    4242// private
    43 bool sepPrt$( strstream & );
    44 void sepReset$( strstream & );
    45 void sepReset$( strstream &, bool );
    46 const char * sepGetCur$( strstream & );
    47 void sepSetCur$( strstream &, const char [] );
    48 bool getNL$( strstream & );
    49 void setNL$( strstream &, bool );
    50 bool getANL$( strstream & );
    51 bool getPrt$( strstream & );
    52 void setPrt$( strstream &, bool );
     43bool sepPrt$( ostrstream & );
     44void sepReset$( ostrstream & );
     45void sepReset$( ostrstream &, bool );
     46const char * sepGetCur$( ostrstream & );
     47void sepSetCur$( ostrstream &, const char [] );
     48bool getNL$( ostrstream & );
     49void setNL$( ostrstream &, bool );
     50bool getANL$( ostrstream & );
     51bool getPrt$( ostrstream & );
     52void setPrt$( ostrstream &, bool );
    5353
    5454// public
    55 void sepOn( strstream & );
    56 void sepOff( strstream & );
    57 bool sepDisable( strstream & );
    58 bool sepEnable( strstream & );
    59 void nlOn( strstream & );
    60 void nlOff( strstream & );
     55void sepOn( ostrstream & );
     56void sepOff( ostrstream & );
     57bool sepDisable( ostrstream & );
     58bool sepEnable( ostrstream & );
     59void nlOn( ostrstream & );
     60void nlOff( ostrstream & );
    6161
    62 const char * sepGet( strstream & );
    63 void sepSet( strstream &, const char [] );
    64 const char * sepGetTuple( strstream & );
    65 void sepSetTuple( strstream &, const char [] );
     62const char * sepGet( ostrstream & );
     63void sepSet( ostrstream &, const char [] );
     64const char * sepGetTuple( ostrstream & );
     65void sepSetTuple( ostrstream &, const char [] );
    6666
    67 void ends( strstream & );
    68 int fmt( strstream &, const char format[], ... ) __attribute__(( format(printf, 2, 3) ));
    69 int flush( strstream & );
     67void ends( ostrstream & );
     68int fmt( ostrstream &, const char format[], ... ) __attribute__(( format(printf, 2, 3) ));
    7069
    71 strstream & write( strstream & os );                                    // use stdout, default value not working
    72 strstream & write( strstream & os, FILE * stream = stdout );
     70ostrstream & write( ostrstream & os, FILE * stream ); // FIX ME: use default = stdout
     71ostrstream & write( ostrstream & os );
    7372
    74 void ?{}( strstream &, char buf[], size_t size );
     73void ?{}( ostrstream &, char buf[], size_t size );
    7574
    76 extern strstream & sstr;
     75
     76// *********************************** istrstream ***********************************
     77
     78
     79struct istrstream {
     80        char * buf$;
     81        size_t cursor$;
     82        bool nlOnOff$;
     83}; // istrstream
     84
     85// Satisfies basic_istream
     86
     87// public
     88bool getANL( istrstream & );
     89void nlOn( istrstream & );
     90void nlOff( istrstream & );
     91void ends( istrstream & );
     92int fmt( istrstream &, const char format[], ... ) __attribute__(( format(scanf, 2, 3) ));
     93istrstream & ungetc( istrstream & is, char c );
     94int eof( istrstream & is );
     95
     96void ?{}( istrstream & is, char buf[] );
    7797
    7898// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.