WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Filename.h
1#ifndef _WINC_FILENAME
2#define _WINC_FILENAME
3
4#include <WXP/Date.h>
5#include <WXP/DateVal.h>
6#include <WXP/NameConv.h>
7#include <WXP/String.h>
8#include <WXP/Strings.h>
9
10namespace WXP {
11 class Filename {
12 bool is_set;
13 bool fixed;
14 char type[30];
15 String name;
16 String hdr;
17 char param[50];
18 Date date; // Actual date of file
19 Date base_date; // Base date for latest data (time of latest file)
20 // used for multiple files
21 NameConv conv;
22 Strings files;
23 int num_file;
24 int num_off;
25 int num_type;
26 int num_dir;
27 int file_off;
28
29 public:
30 int initParam();
31 int init();
32
33 Filename( const char *nameconv, const char *str );
34 Filename( const char *nameconv, Date &rdate );
35 Filename( const char *filename );
36 Filename();
37 ~Filename();
38
39 int set( const char *nameconv, const char *str );
40 int set( const char *nameconv, Date &rdate );
41 int set( const char *filename );
42 bool isSet();
43
44 int setNameConv( const char *nameconv );
45 int setPath( const char *path );
46
47 int setDate( Date &rdate );
48 int getDate( Date &rdate );
50 int getOffset();
51
52 int setFixDate( DateVal &rdate );
53 int setFixDate( const char *str );
54
55 int setType( const char *rtype );
56 const char *getType();
57
58 inline int setForeTime( int time ){ conv.setForeTime( time ); return 1; };
59 inline int getForeTime(){ return conv.getForeTime(); };
60
61 inline int setKey( char ch, const char *str ){ return conv.setKey(ch, str); };
62 inline const char *getExt(){ return conv.getExt(); };
63 inline const char *getKey( char ch ){ return conv.getKey(ch); };
64
65 int setName( const char *rname );
66 const char *getName();
67 const char *getName( int ind );
68
69 int setHeader( const char *rname );
70 const char *getHeader();
71 bool validHeader();
72
73 int addOutPath( const char *path );
74
75 bool isFixed();
76
77 int setNumFiles( int val );
78 int setNumFiles( const char *str );
79 int getNumFiles();
80 inline int getNumType(){ return num_type; };
81
82 int setOutput( bool val );
83 int setLateLimit( int val );
84 int setLateDate( Date rdate );
85 int setBaseDate( Date &rdate );
86
87 int checkFile( const char *file );
88
89 int setFile( Date &rdate );
90 int setFile( Date &rdate, const char *param );
91 int setFile( const char *file );
92 int setFile();
93 bool exist();
94 int setFile( int ind );
95
96 int listFile();
97 int print();
98 int printConv();
99
100 static const int UNK = 0;
101 static const int HOURS = 1;
102 static const int FILES = 2;
103 };
104}
105#endif
This class stores date and time information.
Definition Date.h:8
This class creates filenames.
Definition Filename.h:11
int setType(const char *rtype)
Definition Filename.cc:279
int print()
Definition Filename.cc:1107
int setOutput(bool val)
Definition Filename.cc:355
int setFile()
Definition Filename.cc:622
Filename()
Definition Filename.cc:51
int setLateLimit(int val)
Definition Filename.cc:363
DateVal getDateval()
Definition Filename.cc:253
~Filename()
Definition Filename.cc:88
int setNumFiles(int val)
Definition Filename.cc:380
const char * getType()
Definition Filename.cc:288
int getNumFiles()
Definition Filename.cc:454
int setPath(const char *path)
Definition Filename.cc:179
int setName(const char *rname)
Definition Filename.cc:296
static const int FILES
Definition Filename.h:102
bool validHeader()
Definition Filename.cc:342
static const int HOURS
Definition Filename.h:101
int setNameConv(const char *nameconv)
Definition Filename.cc:168
int getDate(Date &rdate)
Definition Filename.cc:240
int setBaseDate(Date &rdate)
Definition Filename.cc:735
int init()
Definition Filename.cc:38
int setLateDate(Date rdate)
Definition Filename.cc:372
const char * getName()
Definition Filename.cc:306
int setDate(Date &rdate)
Definition Filename.cc:145
const char * getHeader()
Definition Filename.cc:334
int setHeader(const char *rname)
Definition Filename.cc:325
int set(const char *nameconv, const char *str)
Definition Filename.cc:96
static const int UNK
Definition Filename.h:100
int checkFile(const char *file)
Definition Filename.cc:462
int listFile()
Definition Filename.cc:755
int initParam()
Definition Filename.cc:31
int setFixDate(DateVal &rdate)
Definition Filename.cc:262
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 setForeTime(int val)
Definition NameConv.h:60
const char * getKey(char ch)
Definition NameConv.cc:275
const char * getExt()
Definition NameConv.cc:252
This is a variable length string class.
Definition String.h:5
This class creates a list of strings.
Definition Strings.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct defines basic date values.
Definition DateVal.h:5