// // Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // strstream.hfa -- // // Author : Peter A. Buhr // Created On : Thu Apr 22 22:20:59 2021 // Last Modified By : Peter A. Buhr // Last Modified On : Sat Apr 24 11:17:33 2021 // Update Count : 37 // #pragma once #include "iostream.hfa" #include // *********************************** strstream *********************************** enum { strstream_sepSize = 16 }; struct strstream { // satisfied basic_ostream char * buf$; size_t size$; size_t cursor$; bool sepDefault$; bool sepOnOff$; bool nlOnOff$; bool prt$; // print text bool sawNL$; const char * sepCur$; char separator$[strstream_sepSize]; char tupleSeparator$[strstream_sepSize]; }; // strstream // Satisfies basic_ostream // private bool sepPrt$( strstream & ); void sepReset$( strstream & ); void sepReset$( strstream &, bool ); const char * sepGetCur$( strstream & ); void sepSetCur$( strstream &, const char [] ); bool getNL$( strstream & ); void setNL$( strstream &, bool ); bool getANL$( strstream & ); bool getPrt$( strstream & ); void setPrt$( strstream &, bool ); // public void sepOn( strstream & ); void sepOff( strstream & ); bool sepDisable( strstream & ); bool sepEnable( strstream & ); void nlOn( strstream & ); void nlOff( strstream & ); const char * sepGet( strstream & ); void sepSet( strstream &, const char [] ); const char * sepGetTuple( strstream & ); void sepSetTuple( strstream &, const char [] ); void ends( strstream & ); int fmt( strstream &, const char format[], ... ) __attribute__(( format(printf, 2, 3) )); int flush( strstream & ); strstream & write( strstream & os ); // use stdout, default value not working strstream & write( strstream & os, FILE * stream = stdout ); void ?{}( strstream &, char buf[], size_t size ); extern strstream & sstr; // Local Variables: // // mode: c // // tab-width: 4 // // End: //