WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
NameConv.h
1#ifndef _WINC_NAMECONV
2#define _WINC_NAMECONV
3
4#include <sys/types.h>
5
6#include <WXP/Date.h>
7#include <WXP/DateVal.h>
8#include <WXP/NameConvFile.h>
9#include <WXP/String.h>
10
11namespace WXP {
12 class NameConv {
13 char file[80];
14 char hdr[80];
15 String path;
16 char ext[30];
17 char key[20];
18 char keyval[20][30];
19 int numkey;
20 off_t min_size;
21 int min_time;
22 char type[20];
23 char param[50];
24 int off;
25 Date date; // Actual date of file
26 DateVal fix_date; // Hard code date components ie using only 12Z data
27 Date late_date; // Start date to be used for searching files
28 int fore_time;
29 bool output;
30 int limit;
31 int cpath;
32 int npath;
33 bool pexist;
34
35 int parsePath( const char *path, const char *conv );
36
37 public:
38 NameConv( const char *type );
39 NameConv();
40 ~NameConv();
41 int initParam();
42 int init();
43 int set( const char *type );
44 int setOutput( bool val );
45 int setFixDate( const char *str );
46 int setFixDate( DateVal &rdate );
47 inline int getFixDate( DateVal &rdate ){ rdate = fix_date; return 1; };
48 int setLateLimit( int val );
49 int setLateDate( Date rdate );
51 inline int setOffset( int val ){ off = val; return 1; };
53 inline int getOffset(){ return off; };
55 inline int getMinSize(){ return min_size; };
57 inline int getMinTime(){ return min_time; };
58 inline const char *getType(){ return type; };
60 inline int setForeTime( int val ){ fore_time = val; return 1; };
61 inline int getForeTime(){ return fore_time; };
62 const char *getFile();
63 int setExt( const char *str );
64 const char *getExt();
65 int setKey( char ch, const char *str );
66 const char *getKey( char ch );
67 int setPath( const char *path );
68 int setPath( String &path );
69 const char *getPath();
70 inline int getNumPath(){ return npath; };
71 inline int setPathNum( int ind ){ cpath = ind; return 1; };
72 int encode( Date &rdate, int flag, String &filename );
73 int encodeFile( Date &rdate, String &filename );
74 int encodeHdr( Date &rdate, String &filename );
75 int decode( const char *filename );
76 int setLatest( const char *str, NameConvFile &file );
77 int setFile( Date &rdate, NameConvFile &file );
78 int getDate( Date &rdate );
79 int print();
80
81 static int setOffset( const char *file );
82
83 enum Type {
85 HEADER
86 };
87 };
88}
89#endif
This class stores date and time information.
Definition Date.h:8
This class creates a name convention used to create filenames.
Definition NameConv.h:12
int setKey(char ch, const char *str)
Definition NameConv.cc:261
int encode(Date &rdate, int flag, String &filename)
Definition NameConv.cc:535
int getOffset()
Definition NameConv.h:53
int setLateDate(Date rdate)
Definition NameConv.cc:182
int setForeTime(int val)
Definition NameConv.h:60
Type
Definition NameConv.h:83
@ HEADER
Definition NameConv.h:85
@ FILENAME
Definition NameConv.h:84
int getDate(Date &rdate)
Definition NameConv.cc:1597
int init()
Definition NameConv.cc:40
int setExt(const char *str)
Definition NameConv.cc:243
int set(const char *type)
Definition NameConv.cc:288
int setLatest(const char *str, NameConvFile &file)
Definition NameConv.cc:902
NameConv()
Definition NameConv.cc:64
int setOutput(bool val)
Definition NameConv.cc:89
const char * getFile()
Definition NameConv.cc:235
int getMinTime()
Definition NameConv.h:57
int decode(const char *filename)
Definition NameConv.cc:1209
int setPath(const char *path)
Definition NameConv.cc:191
int getMinSize()
Definition NameConv.h:55
int encodeFile(Date &rdate, String &filename)
Definition NameConv.cc:884
int setOffset(int val)
Definition NameConv.h:51
const char * getPath()
Definition NameConv.cc:227
~NameConv()
Definition NameConv.cc:81
int setLateLimit(int val)
Definition NameConv.cc:172
int initParam()
Definition NameConv.cc:30
const char * getKey(char ch)
Definition NameConv.cc:275
int setFile(Date &rdate, NameConvFile &file)
Definition NameConv.cc:1565
const char * getExt()
Definition NameConv.cc:252
int encodeHdr(Date &rdate, String &filename)
Definition NameConv.cc:893
int setFixDate(const char *str)
Definition NameConv.cc:109
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 defines basic date values.
Definition DateVal.h:5