00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SCANNERPP_H_
00022 #define SCANNERPP_H_
00023
00024
00025 #include<iostream>
00026 #include<istream>
00027 #include<string>
00028 #include<sstream>
00029
00030 #include<vector>
00031
00032 #include <stdlib.h>
00033
00034 using namespace std;
00035
00036 #include "File.h"
00037
00038 class Scanner
00039 {
00040 private:
00041 istream *input;
00042
00043 File* inputfile;
00044
00045 string sep;
00046
00047 public:
00048
00049 bool hasNextChar();
00050 char nextChar();
00051
00052 Scanner(File* inputfile);
00053 Scanner(istream* input);
00054 Scanner(string input);
00055
00056 virtual ~Scanner();
00057
00058
00059
00060
00061 void useDefaultSeparators();
00062
00063
00064
00065
00066
00067
00068
00069 void useSeparators(string s);
00070 bool inSeparators(char c);
00071
00072 std::string next();
00073 std::string nextLine();
00074 int nextInt();
00075 long nextLong();
00076 float nextFloat();
00077 double nextDouble();
00078
00079 bool hasNext();
00080 bool hasNextLine();
00081 bool hasNextInt(){return true;}
00082 bool hasNextLong(){return true;}
00083 bool hasNextFloat(){return true;}
00084 bool hasNextDouble(){return true;}
00085
00086 void close();
00087
00088 string rest();
00089 };
00090
00091 #endif