source: libcfa/src/strstream.hfa @ e46ea00

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since e46ea00 was 666483d, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

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

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[fec63b2]1//
2// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// strstream.hfa --
8//
9// Author           : Peter A. Buhr
10// Created On       : Thu Apr 22 22:20:59 2021
11// Last Modified By : Peter A. Buhr
[666483d]12// Last Modified On : Tue Apr 27 20:58:50 2021
13// Update Count     : 41
[fec63b2]14//
15
16#pragma once
17
18#include "iostream.hfa"
19#include <stdio.h>
20
21
[666483d]22// *********************************** ostrstream ***********************************
[fec63b2]23
24
[666483d]25enum { ostrstream_sepSize = 16 };
26struct ostrstream {                                                                             // satisfied basic_ostream
[fec63b2]27        char * buf$;
28        size_t size$;
29        size_t cursor$;
30        bool sepDefault$;
31        bool sepOnOff$;
32        bool nlOnOff$;
33        bool prt$;                                                                                      // print text
34        bool sawNL$;
35        const char * sepCur$;
[666483d]36        char separator$[ostrstream_sepSize];
37        char tupleSeparator$[ostrstream_sepSize];
38}; // ostrstream
[fec63b2]39
40// Satisfies basic_ostream
41
42// private
[666483d]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 );
[fec63b2]53
54// public
[666483d]55void sepOn( ostrstream & );
56void sepOff( ostrstream & );
57bool sepDisable( ostrstream & );
58bool sepEnable( ostrstream & );
59void nlOn( ostrstream & );
60void nlOff( ostrstream & );
[fec63b2]61
[666483d]62const char * sepGet( ostrstream & );
63void sepSet( ostrstream &, const char [] );
64const char * sepGetTuple( ostrstream & );
65void sepSetTuple( ostrstream &, const char [] );
[fec63b2]66
[666483d]67void ends( ostrstream & );
68int fmt( ostrstream &, const char format[], ... ) __attribute__(( format(printf, 2, 3) ));
[fec63b2]69
[666483d]70ostrstream & write( ostrstream & os, FILE * stream ); // FIX ME: use default = stdout
71ostrstream & write( ostrstream & os );
[fec63b2]72
[666483d]73void ?{}( ostrstream &, char buf[], size_t size );
[fec63b2]74
[666483d]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[] );
[fec63b2]97
98// Local Variables: //
99// mode: c //
100// tab-width: 4 //
101// End: //
Note: See TracBrowser for help on using the repository browser.