2010-09-01 10:37:10 +00:00
|
|
|
#ifndef Dict_h
|
|
|
|
#define Dict_h
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2003-05-06 21:52:58 +00:00
|
|
|
#include <AppKit/AppKit.h>
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 08:35:25 +00:00
|
|
|
#include "Storage.h"
|
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
typedef struct {
|
|
|
|
char *key;
|
|
|
|
char *value;
|
2003-03-18 19:48:24 +00:00
|
|
|
} dict_t;
|
|
|
|
|
2010-09-11 16:41:18 +00:00
|
|
|
@interface Dict:Storage
|
|
|
|
{
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-initFromFile:(FILE *) fp;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
-(id) parseMultipleFrom:(const char *) value;
|
|
|
|
-(int) getValueUnits:(const char *) key;
|
|
|
|
-delString:(const char *)string fromValue:(const char *) key;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
-addString:(const char *)string toValue:(const char *) key;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-(char *) convertListToString:(id) list;
|
2010-09-27 18:01:07 +00:00
|
|
|
- (const char *) getStringFor:(const char *) name;
|
2010-09-28 09:41:38 +00:00
|
|
|
-removeKeyword:(const char *) key;
|
|
|
|
-(unsigned int) getValueFor:(const char *) name;
|
|
|
|
-changeStringFor:(const char *)key to:(const char *) value;
|
2010-09-11 10:06:04 +00:00
|
|
|
|
2010-09-28 09:41:38 +00:00
|
|
|
-(dict_t *) findKeyword:(const char *) key;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-writeBlockTo:(FILE *) fp;
|
2010-09-28 09:41:38 +00:00
|
|
|
-writeFile:(const char *) path;
|
2010-09-11 10:06:04 +00:00
|
|
|
|
|
|
|
// INTERNAL
|
|
|
|
-init;
|
|
|
|
-(id) parseBraceBlock:(FILE *) fp;
|
2010-09-28 09:41:38 +00:00
|
|
|
-setupMultiple:(const char *) value;
|
2010-09-11 10:06:04 +00:00
|
|
|
-(char *) getNextParameter;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 16:41:18 +00:00
|
|
|
@end
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 16:41:18 +00:00
|
|
|
int GetNextChar (FILE * fp);
|
|
|
|
void CopyUntilWhitespc (FILE * fp, char *buffer);
|
|
|
|
void CopyUntilQuote (FILE * fp, char *buffer);
|
|
|
|
int FindBrace (FILE * fp);
|
|
|
|
int FindQuote (FILE * fp);
|
|
|
|
int FindWhitespc (FILE * fp);
|
|
|
|
int FindNonwhitespc (FILE * fp);
|
|
|
|
|
|
|
|
char *FindWhitespcInBuffer (char *buffer);
|
|
|
|
char *FindNonwhitespcInBuffer (char *buffer);
|
2010-09-01 10:37:10 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
#endif // Dict_h
|