WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Parse.h
1#ifndef _WINC_PARSE
2#define _WINC_PARSE
3
4#include <WXP/File.h>
5#include <WXP/Filename.h>
6#include <WXP/String.h>
7
8namespace WXP {
9 class Parse {
10 Filename filename;
11 int ind;
12 File file;
13 File hfile;
14 bool opened;
15
16 bool use_hfile;
17 bool use_awips;
18
19 char sheader[80];
20 char sawip[80];
21 char sid[80];
22
23 char header[80];
24 char awip[80];
25 char data[500]; // Temporary data needed for processing
26
27 int pline_status;
28 int line_status;
29 bool next_hdr; // Need to go to next header
30 bool new_prod; // Is this the beginning of a new product
31
32 int loc; // Location of beginning of current line
33 int hloc; // Location of current header in file
34
35 int found; // Is product found
36 int ifound; // Is requested Id found
37
38 int end_dollar;
39 int end_blank;
40
41 int lnum;
42
43 bool compare( const char *pattern );
44 int newFile();
45
46 public:
47 static const int START = 0x1;
48 static const int SEQ = 0x2;
49 static const int HEADER = 0x3;
50 static const int AWIP = 0x4;
51 static const int SDATA = 0x5;
52 static const int DATA = 0x10;
53 static const int BLANK = 0x11;
54 static const int DOLLAR = 0x12;
55 static const int LOCATE = 0x13;
56 static const int VTEC = 0x14;
57 static const int LATLON = 0x15;
58 static const int DESC = 0x16;
59
60 Parse();
61 Parse( const char *str );
62 int init();
63 int setParam( const char *str );
64 int open( Filename &filename );
65 int open( const char *filename );
66 bool isOpen();
67 int rewind();
68 int close();
72 inline int useHdrFile( bool val ){ use_hfile = val; return 1; };
73 inline int useAwipsHdr( bool val ){ use_awips = val; return 1; };
74 bool isNewProd();
75 int setHeader( const char *string );
76 int setId( const char *id );
77 const char *getHeader();
78 const char *getAwip();
79 inline int getLineStatus(){ return line_status; };
80 int tell();
81 int seek( int loc );
82 int getLoc();
83 int getHeaderLoc();
84 int getFileInd();
85 int setLoc( int byte );
86 int setLoc( int rind, int byte );
87 int getLine( char *string, int len );
88 int getLine( String &line );
89 bool isData();
90
91 static bool compare( const char *header, const char *awip, const char *pattern );
92 static bool checkZone( const char *line, const char *str );
93 enum Type { RAW, WXP };
94 };
95}
96#endif
This class accesses files.
Definition File.h:15
This class creates filenames.
Definition Filename.h:11
This class parses text files.
Definition Parse.h:9
int getHeaderLoc()
Definition Parse.cc:211
int useHdrFile(bool val)
Definition Parse.h:72
int getLoc()
Definition Parse.cc:203
int getLine(char *string, int len)
Definition Parse.cc:297
const char * getAwip()
Definition Parse.cc:183
int init()
Definition Parse.cc:40
int setId(const char *id)
Definition Parse.cc:166
int close()
Definition Parse.cc:136
int rewind()
Definition Parse.cc:124
int setHeader(const char *string)
Definition Parse.cc:157
bool isOpen()
Definition Parse.cc:117
bool isData()
Definition Parse.cc:652
bool isNewProd()
Definition Parse.cc:149
Parse()
Definition Parse.cc:24
int setLoc(int byte)
Definition Parse.cc:219
const char * getHeader()
Definition Parse.cc:175
int open(Filename &filename)
Definition Parse.cc:76
All WXP classes fall under the WXP namespace.
Definition Angle.h:4