initial
[prop.git] / lib-src / pretty / pristream.cc
blob7c852056447eb73d1bf8f24890d90a391bb71f00
1 //////////////////////////////////////////////////////////////////////////////
2 // NOTICE:
3 //
4 // ADLib, Prop and their related set of tools and documentation are in the
5 // public domain. The author(s) of this software reserve no copyrights on
6 // the source code and any code generated using the tools. You are encouraged
7 // to use ADLib and Prop to develop software, in both academic and commercial
8 // settings, and are welcomed to incorporate any part of ADLib and Prop into
9 // your programs.
11 // Although you are under no obligation to do so, we strongly recommend that
12 // you give away all software developed using our tools.
14 // We also ask that credit be given to us when ADLib and/or Prop are used in
15 // your programs, and that this notice be preserved intact in all the source
16 // code.
18 // This software is still under development and we welcome(read crave for)
19 // any suggestions and help from the users.
21 // Allen Leung (leunga@cs.nyu.edu)
22 // 1994-1997
23 //////////////////////////////////////////////////////////////////////////////
25 #include <iostream.h>
26 #include <AD/pretty/pistream.h>
28 PrettyIStream::PrettyIStream() : the_stream(&cin) {}
29 PrettyIStream::PrettyIStream(istream& s) : the_stream(&s) {}
30 PrettyIStream::~PrettyIStream() {}
32 istream& PrettyIStream::set_stream(istream& s)
33 { istream * old = the_stream;
34 the_stream = &s;
35 return *old;
38 PrettyIStream& PrettyIStream::operator >> (char)
40 return *this;
43 PrettyIStream& PrettyIStream::operator >> (short& n)
44 { int i;
45 operator>>(i);
46 n = i;
47 return *this;
50 PrettyIStream& PrettyIStream::operator >> (unsigned short& n)
51 { int i;
52 operator>>(i);
53 n = i;
54 return *this;
57 PrettyIStream& PrettyIStream::operator >> (int&)
59 return *this;
62 PrettyIStream& PrettyIStream::operator >> (unsigned int& n)
63 { int i;
64 operator>>(i);
65 n = i;
66 return *this;
69 PrettyIStream& PrettyIStream::operator >> (long& n)
70 { int i;
71 operator>>(i);
72 n = i;
73 return *this;
76 PrettyIStream& PrettyIStream::operator >> (unsigned long& n)
77 { int i;
78 operator>>(i);
79 n = i;
80 return *this;
83 PrettyIStream& PrettyIStream::operator >> (float& n)
84 { double i;
85 operator>>(i);
86 n = i;
87 return *this;
90 PrettyIStream& PrettyIStream::operator >> (double&)
91 { return *this; }
93 PrettyIStream& PrettyIStream::operator >> (char *)
94 { return *this;