Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>input - class istream</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Input - Class istream

   Class istream provides input operations that mirror the output operations
   of class ostream.

   The right shift operator is overloaded to provide a similar convenient

   notation for most input operations.

   This deals with input of the built-in types, and is designed to make
   implementation of input for user defined types simple and type-safe. The
   multiple overloads of the operator>> function are known as extractors,
   that is they extract typed values from sequences of characters in the
   input stream. It is the intention of the IOStream system that given:

       class T;        // T is a type, built in or user defined
       istream s;
       T x;

   Then:

       s >> x;

   is either a compilation error, or will cause the input to be parsed to
   translate it into a value of type T. If the character stream is
   inconsistent with the type, the error state will be set appropriately.

   The istream class is derived from class ios, so all of the functions
   listed for class ios can be called for an istream object.

   The istream class is defined in the IOstreams header file iostream.hpp.
   Its public interface is as follows:

   class istream {
   public:
       istream(streambuf *);
       virtual ~istream();
       int ipfx(int need = 0);

       istream &operator>>(char *);
       istream &operator>>(signed char *s);
       istream &operator>>(unsigned char *s);
       istream &operator>>(char &);
       istream &operator>>(signed char &c);
       istream &operator>>(unsigned char &);
       istream &operator>>(short &);
       istream &operator>>(int &);

       istream &operator>>(long &);
       istream &operator>>(unsigned short &);
       istream &operator>>(unsigned int &);
       istream &operator>>(unsigned long &);
       istream &operator>>(float &);
       istream &operator>>(double &);
       istream &operator>>(streambuf*);
       istream &operator>>(istream &(*)(istream&));
       istream &operator>>(ios &(*)(ios&));

       int sync();

       istream &get(char *data, int length, char delimiter = '\n');
       istream &get(signed char *data, int length, char delimiter = '\n');
       istream &get(unsigned char *data, int length, char delimiter = '\n');
       istream &get(char &destination);
       istream &get(signed char &destination);
       istream &get(unsigned char &destination);
       istream &get(streambuf &destination, char delimiter = '\n');
       int get();

       int peek();
       istream &read(void *data, int size);

       istream &getline(char *data, int length, char delimiter = '\n');
       istream &getline(signed char *data, int length, char delimiter = '\n');
       istream &getline(unsigned char *data, int length, char delimiter = '\n');
       size_t gcount();

       istream &ignore(int length, int delimiter = EOF);
       istream &putback(char c);
       istream &seekg(streampos);
       istream &seekg(streamoff, relative_to);
       streampos tellg();
       static int is_white_space(char c);
   };

   All functions described here require the inclusion of iostream.hpp or
   some header file that itself includes iostream.hpp.





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson