WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
RawFile.h
1#ifndef _WINC_RAWFILE
2#define _WINC_RAWFILE
3
4#include <WXP/Data.h>
5#include <WXP/Date.h>
6#include <WXP/Datum.h>
7#include <WXP/File.h>
8#include <WXP/RawField.h>
9#include <WXP/String.h>
10
11namespace WXP {
12 class RawFile {
13 static const int MAXFIELD = 75;
14 static const int MAXCHARS = 400;
15 int type;
16 int ver;
17 int access;
18 long pos;
19 int num; /* The seq number within the file */
20 int ind; /* The seq number for each station */
21 int cur_field; /* Current field number */
22 int cur_pos; /* Current position on line */
23 RawField field[MAXFIELD];
24 int num_field; /* Number of fields */
25 int field_off; /* Offset of data from ID, location */
26 char line[MAXCHARS];
27 int length;
28 char ident[20];
29 float x,y;
30 File file;
31 Date date;
32 char datim[50]; /* Date and time information */
33 char info[50]; /* Parameter information */
34 char ofmt[20]; // Output format
35 bool opened;
36
37 public:
38 enum Type { UNK, WXP };
39
40 RawFile();
41 RawFile( const char *filename );
42 RawFile( const char *filename, int access, int type );
43 ~RawFile();
44 int initClass();
45 int init();
46 int open( const char *filename, int access, int type );
47 int open( const char *filename, int access );
48 int open( const char *filename );
49 int rewind();
50 int close();
51 inline const char *getDatim(){ return datim; };
52 inline int getDate( Date &rdate ){ rdate = date; return 1; };
53 inline const char *getInfo(){ return info; };
54 const char *getInfo(int ind);
55 int read();
56 int read( Datum &data, int fnum );
57 int read( Datum &data );
58 int read( Data &data );
59 int read( const char *filename, Data &data );
60 int getData( const char *fld, Datum &data );
61 int decodeString( int fnum, const char *str, Datum &data );
62 int getIdent( String &id );
63 int getField( const char *str );
64
65 int setFormat( const char *str );
66 int write( Data &data );
67 int write( const char *filename, Data &data );
68 int print();
69
70 static int checkType( const char *filename );
71
72 static const int ALL = -2;
73 static const int KEY = -1;
74 };
75}
76#endif
This class is a repository for point data.
Definition Data.h:11
This class stores date and time information.
Definition Date.h:8
This class stores raw point data.
Definition Datum.h:7
This class accesses files.
Definition File.h:15
This class reads and writes raw point data.
Definition RawFile.h:12
This is a variable length string class.
Definition String.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct stores information on each field in file.
Definition RawField.h:7