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 bool hasNextChar();
00046 char nextChar();
00047
00048 string sep;
00049
00050 public:
00051 Scanner(File* inputfile);
00052 Scanner(istream* input);
00053 Scanner(string input);
00054
00055 virtual ~Scanner();
00056
00057
00058
00059
00060 void useDefaultSeparators();
00061
00062
00063
00064
00065
00066
00067
00068 void useSeparators(string s);
00069 bool inSeparators(char c);
00070
00071 std::string next();
00072 std::string nextLine();
00073 int nextInt();
00074 long nextLong();
00075 float nextFloat();
00076 double nextDouble();
00077
00078 bool hasNext();
00079 bool hasNextLine();
00080 bool hasNextInt(){return true;}
00081 bool hasNextLong(){return true;}
00082 bool hasNextFloat(){return true;}
00083 bool hasNextDouble(){return true;}
00084
00085 void close();
00086 };
00087
00088 #endif