00001
00002
00003
00004
00005 #ifndef dsWordSource_h
00006 #define dsWordSource_h
00007
00008 #ifdef HAVE_CONFIG_H
00009 # include <config.h>
00010 #endif
00011
00012
00013 #include <stdio.h>
00014 #include <string.h>
00015 #include <ctype.h>
00016 #include <string.h>
00017
00018 #include <dsSmartException.h>
00019
00020 DECLARE_EXCEPTION(ws);
00021
00027 class dsWordSource
00028 {
00029 public:
00030 unsigned wordcnt;
00031 unsigned linecnt;
00032 const char *delems;
00033
00040 dsWordSource(const char *filename, const char *dlm = " $@#%&*.,<>?!~;':\"[]{}\\/|+=_-()\t\r\n");
00041
00042 ~dsWordSource();
00043
00049 const char *next();
00050
00054 void reset();
00055
00056 private:
00057 int isword(int ch);
00058 void fillbuf();
00059 void nextalpha();
00060 FILE *fp;
00061 char buffer[256];
00062 char *p, *q;
00063 int done;
00064 };
00065
00066 #endif