]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/VfrCompile/Pccts/h/DLG_stream_input.h
2 /************************************************************/
4 /* Predefined char stream: Input from (c++) stream. */
6 /* By Hubert Holin (Hubert.Holin@Bigfoot.com), 1998. */
8 /* This is completely free stuff, do whatever you want with */
9 /* it (but then, I will take no responsibility for whatever */
10 /* may happen if you do either... caveat emptor!). */
12 /************************************************************/
14 #ifndef _DLG_STREAM_INPUT_H
15 #define _DLG_STREAM_INPUT_H
17 #include "pccts_istream.h"
22 #include "DLexerBase.h"
26 // NOTES: The semantics of the copy constructor
27 // and the affectation operator may be unwarranted...
28 // and the stream may not be reset.
30 // It would have been so much nicer for nextChar()
31 // to throw (of for the DLGInputStream to change status)
32 // upon hitting EOF than to return an "int"...
36 class T
= ::std::char_traits
<E
>
38 class DLG_stream_input
: public DLGInputStream
42 DLG_stream_input(::std::basic_istream
<E
,T
> * p_input_stream
)
43 : input(p_input_stream
)
48 DLG_stream_input(const DLG_stream_input
& a_recopier
)
49 : input(a_recopier
.input
)
54 virtual ~DLG_stream_input()
56 this->purge(); // bloody templarized lookup...
59 DLG_stream_input
operator = (const DLG_stream_input
& a_affecter
)
61 if (this != &a_affecter
)
63 input
= a_affecter
.input
;
69 virtual int nextChar()
73 input
->get(extracted_stuff
);
77 return(int(extracted_stuff
));
87 ::std::basic_istream
<E
,T
> * input
;
97 #endif /* _DLG_STREAM_INPUT_H */