WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Resrc.h
1#ifndef _WINC_RESRC
2#define _WINC_RESRC
3
4#include <WXP/String.h>
5
6namespace WXP {
7 class Resrc {
8 struct ResrcItem {
9 char *name;
10 char *data;
11 int type;
12 ResrcItem *next;
13 };
14
15 ResrcItem *root;
16 ResrcItem *cur;
17 ResrcItem *last;
18
19 public:
20 Resrc( );
21 ~Resrc( );
22 int clear( );
23 int init( );
24 int add( const char *name, const char *data, int type );
25 int set( const char *name, const char *data );
26 int set( const char *name, const char *data, int type );
27 int set( const char *name, String &data );
28 int put( const char *name, const char *data );
29 int prepend( const char *name, const char *data, char delim = '\n' );
30 int append( const char *name, const char *data, char delim = '\n' );
31 const char *get( const char *name );
32 const char *get( const char *name, const char *def );
33 int getType( const char *name );
34 int getValues( String &name, String &value, int flag );
35 bool getBool( const char *name );
36 float get( const char *name, float val );
37 int get( const char *name, int val );
38 int scanf( const char *name, const char *form, ... );
39 int rewind();
40 const char *getNext();
41 int print( const char *name );
42 int printAll( );
43
44 enum ResrcType {
50 USER
51 };
52 };
53}
54#endif
This class stores a set of resources to be used to set parameters in various objects.
Definition Resrc.h:7
int getValues(String &name, String &value, int flag)
Definition Resrc.cc:347
int rewind()
Definition Resrc.cc:432
~Resrc()
Definition Resrc.cc:30
int printAll()
Definition Resrc.cc:467
int set(const char *name, const char *data)
Definition Resrc.cc:131
int scanf(const char *name, const char *form,...)
Definition Resrc.cc:414
int init()
Definition Resrc.cc:37
ResrcType
Definition Resrc.h:44
@ BASE
Definition Resrc.h:46
@ ENV
Definition Resrc.h:48
@ NONE
Definition Resrc.h:45
@ COMMAND
Definition Resrc.h:49
@ USER
Definition Resrc.h:50
@ FILE
Definition Resrc.h:47
int print(const char *name)
Definition Resrc.cc:453
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
Resrc()
Definition Resrc.cc:23
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
int prepend(const char *name, const char *data, char delim='\n')
Definition Resrc.cc:164
int clear()
Definition Resrc.cc:47
This is a variable length string class.
Definition String.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4