WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Wxp.h
1#ifndef _WINC_WXP
2#define _WINC_WXP
3
4#include <WXP/Const.h>
5#include <WXP/Convert.h>
6#include <WXP/Resrc.h>
7
8#undef NOFILE
9#ifdef MACOSXOLD
10typedef int socklen_t;
11#endif
12
13namespace WXP {
14 class Wxp : public Const, public Convert {
15 static int error;
16 static int message_mask;
17 static int init_time;
18 static int lic;
19 static int lic_gif;
20 static int lic_prodman;
21 static int lic_nldn;
22 static char *datapath;
23 static char progname[20];
24
25 static Resrc resrc;
26
27 public:
28
29 enum MessLevel {
30 NONE,
31 PRINT,
32 ERROR,
33 WARN,
34 MESS,
35 OUT1,
36 OUT2,
37 OUT3,
38 OUT4,
39 OUT5,
40 OUT6,
41 OUT7,
42 OUT8,
43 DEBUG1,
44 DEBUG2,
45 DEBUG3,
46 DEBUG4,
47 DEBUG5,
48 DEBUG6,
49 DEBUG7,
50 DEBUG8
51 };
52
53 /*
54 error return values
55 */
56 enum Error {
69 };
70
71 static bool isDebug();
72 static bool isDebug(int level);
73 static inline int setError( int val ){ error = val; return 1; };
74 static inline bool getError(){ return error; };
75 static int setMessageLevel( int val );
76 static int setMessageLevel( const char *str );
77 static inline int getMessageLevel(){ return message_mask; };
78 static int setProgramName( const char *str );
79 static const char *getProgramName();
80 static int setDatabasePath( const char *str );
81 static const char *getDatabasePath();
82 static bool validLicense();
83 static bool validLicense( const char *type );
84 static int pause();
85 static int sleep( float secs );
86 static bool checkMessage(int level);
87 static int outMessage( const char *mess, ... );
88 static int print( const char *mess );
89 static int outMessage( int level, const char *mess, ... );
90 static int outWarning( const char *mess, ... );
91 static int outError( const char *mess, ... );
92 static int outDebug( const char *mess, ... );
93 static int outDebug( int level, const char *mess, ... );
94 static double getTime();
95 static int getVirtMem();
96 static int exit( Error val );
97 static const char *getVersion();
98 static const char *getLicenseVersion();
99 static const char *getComputerName();
100
101 static inline int setInitTime( int val ){
102 init_time = val; return 1;
103 }
104
105 static inline int getInitTime(){
106 return init_time;
107 }
108
109 static inline const char *getResrc( const char *name ){
110 return resrc.get( name );
111 }
112 static inline bool getResrcBool( const char *name ){
113 return resrc.getBool( name );
114 }
115 static inline const char *getResrc( const char *name, const char *def ){
116 return resrc.get( name, def );
117 }
118 static inline float getResrc( const char *name, float val ){
119 return resrc.get( name, val );
120 }
121 static inline int getResrc( const char *name, int val ){
122 return resrc.get( name, val );
123 }
124 static inline int addResrc( const char *name, const char *data, int type ){
125 return resrc.add( name, data, type );
126 };
127 static inline int putResrc( const char *name, const char *data ){
128 return resrc.put( name, data );
129 };
130 static inline int setResrc( const char *name, const char *data ){
131 return resrc.set( name, data );
132 };
133 static inline int appendResrc( const char *name, const char *data ){
134 return resrc.append( name, data );
135 };
136 static inline int printAllResrc(){
137 return resrc.printAll();
138 }
139 static inline const char *nextResrc(){
140 return resrc.getNext();
141 }
142 static inline int rewindResrc(){
143 return resrc.rewind();
144 }
145 static inline int getResrcType( const char *name ){
146 return resrc.getType( name );
147 }
148
149 friend class ResrcDB;
150 friend class Prog;
151 };
152
153}
154#endif
This class defines constants used by WXP.
Definition Const.h:5
This defines some simple conversion factors.
Definition Convert.h:13
This class stores a set of resources to be used to set parameters in various objects.
Definition Resrc.h:7
int rewind()
Definition Resrc.cc:432
int printAll()
Definition Resrc.cc:467
int set(const char *name, const char *data)
Definition Resrc.cc:131
int add(const char *name, const char *data, int type)
Definition Resrc.cc:71
int append(const char *name, const char *data, char delim='\n')
Definition Resrc.cc:231
const char * get(const char *name)
Definition Resrc.cc:295
int put(const char *name, const char *data)
Definition Resrc.cc:153
const char * getNext()
Definition Resrc.cc:441
bool getBool(const char *name)
Definition Resrc.cc:367
This class defines basic information and methods used by WXP.
Definition Wxp.h:14
static const char * getDatabasePath()
Definition Wxp.cc:85
static const char * getProgramName()
Definition Wxp.cc:65
static bool isDebug()
Definition Wxp.cc:205
static const char * getVersion()
Definition Wxp.cc:366
static int exit(Error val)
Definition Wxp.cc:357
static int pause()
Definition Wxp.cc:93
static int outError(const char *mess,...)
Definition Wxp.cc:281
static double getTime()
Definition Wxp.cc:328
Error
Definition Wxp.h:56
@ NORUN
Definition Wxp.h:58
@ MISC
Definition Wxp.h:59
@ NOINPUT
Definition Wxp.h:66
@ NOMEMORY
Definition Wxp.h:60
@ NOGRAPH
Definition Wxp.h:61
@ BADPARAM
Definition Wxp.h:68
@ NOINIT
Definition Wxp.h:62
@ NODATA
Definition Wxp.h:67
@ NOERR
Definition Wxp.h:57
@ NODBASE
Definition Wxp.h:64
@ NOWRITE
Definition Wxp.h:65
@ NOFILE
Definition Wxp.h:63
static int sleep(float secs)
Definition Wxp.cc:102
static const char * getLicenseVersion()
Definition Wxp.cc:425
static int outWarning(const char *mess,...)
Definition Wxp.cc:262
static const char * getComputerName()
Definition Wxp.cc:437
static bool validLicense()
Definition Wxp.cc:37
static int print(const char *mess)
Definition Wxp.cc:236
static int outMessage(const char *mess,...)
Definition Wxp.cc:222
static bool checkMessage(int level)
Definition Wxp.cc:197
static int setProgramName(const char *str)
Definition Wxp.cc:56
static int setDatabasePath(const char *str)
Definition Wxp.cc:74
static int setMessageLevel(int val)
Definition Wxp.cc:111
static int outDebug(const char *mess,...)
Definition Wxp.cc:298
All WXP classes fall under the WXP namespace.
Definition Angle.h:4