Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    rcce4648 r874b16e  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Apr  9 14:55:54 2022
    13 // Update Count     : 515
     12// Last Modified On : Mon Jun  5 22:00:23 2023
     13// Update Count     : 518
    1414//
    1515
     
    117117    } // for
    118118        if ( file == 0p ) {
    119                 throw (Open_Failure){ os };
     119                throw (open_failure){ os };
    120120                // abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno );
    121121        } // if
     
    137137    } // for
    138138        if ( ret == EOF ) {
    139                 throw (Close_Failure){ os };
     139                throw (close_failure){ os };
    140140                // abort | IO_MSG "close output" | nl | strerror( errno );
    141141        } // if
     
    145145ofstream & write( ofstream & os, const char data[], size_t size ) {
    146146        if ( fail( os ) ) {
    147                 throw (Write_Failure){ os };
     147                throw (write_failure){ os };
    148148                // abort | IO_MSG "attempt write I/O on failed stream";
    149149        } // if
    150150
    151151        if ( fwrite( data, 1, size, (FILE *)(os.file$) ) != size ) {
    152                 throw (Write_Failure){ os };
     152                throw (write_failure){ os };
    153153                // abort | IO_MSG "write" | nl | strerror( errno );
    154154        } // if
     
    240240    } // for
    241241        if ( file == 0p ) {
    242                 throw (Open_Failure){ is };
     242                throw (open_failure){ is };
    243243                // abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno );
    244244        } // if
     
    260260    } // for
    261261        if ( ret == EOF ) {
    262                 throw (Close_Failure){ is };
     262                throw (close_failure){ is };
    263263                // abort | IO_MSG "close input" | nl | strerror( errno );
    264264        } // if
     
    268268ifstream & read( ifstream & is, char data[], size_t size ) {
    269269        if ( fail( is ) ) {
    270                 throw (Read_Failure){ is };
     270                throw (read_failure){ is };
    271271                // abort | IO_MSG "attempt read I/O on failed stream";
    272272        } // if
    273273
    274274        if ( fread( data, size, 1, (FILE *)(is.file$) ) == 0 ) {
    275                 throw (Read_Failure){ is };
     275                throw (read_failure){ is };
    276276                // abort | IO_MSG "read" | nl | strerror( errno );
    277277        } // if
     
    318318
    319319
    320 static vtable(Open_Failure) Open_Failure_vt;
     320static vtable(open_failure) open_failure_vt;
    321321
    322322// exception I/O constructors
    323 void ?{}( Open_Failure & ex, ofstream & ostream ) with(ex) {
    324         virtual_table = &Open_Failure_vt;
     323void ?{}( open_failure & ex, ofstream & ostream ) with(ex) {
     324        virtual_table = &open_failure_vt;
    325325        ostream = &ostream;
    326326        tag = 1;
    327327} // ?{}
    328328
    329 void ?{}( Open_Failure & ex, ifstream & istream ) with(ex) {
    330         virtual_table = &Open_Failure_vt;
     329void ?{}( open_failure & ex, ifstream & istream ) with(ex) {
     330        virtual_table = &open_failure_vt;
    331331        istream = &istream;
    332332        tag = 0;
     
    334334
    335335
    336 static vtable(Close_Failure) Close_Failure_vt;
     336static vtable(close_failure) close_failure_vt;
    337337
    338338// exception I/O constructors
    339 void ?{}( Close_Failure & ex, ofstream & ostream ) with(ex) {
    340         virtual_table = &Close_Failure_vt;
     339void ?{}( close_failure & ex, ofstream & ostream ) with(ex) {
     340        virtual_table = &close_failure_vt;
    341341        ostream = &ostream;
    342342        tag = 1;
    343343} // ?{}
    344344
    345 void ?{}( Close_Failure & ex, ifstream & istream ) with(ex) {
    346         virtual_table = &Close_Failure_vt;
     345void ?{}( close_failure & ex, ifstream & istream ) with(ex) {
     346        virtual_table = &close_failure_vt;
    347347        istream = &istream;
    348348        tag = 0;
     
    350350
    351351
    352 static vtable(Write_Failure) Write_Failure_vt;
     352static vtable(write_failure) write_failure_vt;
    353353
    354354// exception I/O constructors
    355 void ?{}( Write_Failure & ex, ofstream & ostream ) with(ex) {
    356         virtual_table = &Write_Failure_vt;
     355void ?{}( write_failure & ex, ofstream & ostream ) with(ex) {
     356        virtual_table = &write_failure_vt;
    357357        ostream = &ostream;
    358358        tag = 1;
    359359} // ?{}
    360360
    361 void ?{}( Write_Failure & ex, ifstream & istream ) with(ex) {
    362         virtual_table = &Write_Failure_vt;
     361void ?{}( write_failure & ex, ifstream & istream ) with(ex) {
     362        virtual_table = &write_failure_vt;
    363363        istream = &istream;
    364364        tag = 0;
     
    366366
    367367
    368 static vtable(Read_Failure) Read_Failure_vt;
     368static vtable(read_failure) read_failure_vt;
    369369
    370370// exception I/O constructors
    371 void ?{}( Read_Failure & ex, ofstream & ostream ) with(ex) {
    372         virtual_table = &Read_Failure_vt;
     371void ?{}( read_failure & ex, ofstream & ostream ) with(ex) {
     372        virtual_table = &read_failure_vt;
    373373        ostream = &ostream;
    374374        tag = 1;
    375375} // ?{}
    376376
    377 void ?{}( Read_Failure & ex, ifstream & istream ) with(ex) {
    378         virtual_table = &Read_Failure_vt;
     377void ?{}( read_failure & ex, ifstream & istream ) with(ex) {
     378        virtual_table = &read_failure_vt;
    379379        istream = &istream;
    380380        tag = 0;
    381381} // ?{}
    382382
    383 // void throwOpen_Failure( ofstream & ostream ) {
    384 //      Open_Failure exc = { ostream };
     383// void throwopen_failure( ofstream & ostream ) {
     384//      open_failure exc = { ostream };
    385385// }
    386386
    387 // void throwOpen_Failure( ifstream & istream ) {
    388 //      Open_Failure exc = { istream };
     387// void throwopen_failure( ifstream & istream ) {
     388//      open_failure exc = { istream };
    389389// }
    390390
Note: See TracChangeset for help on using the changeset viewer.