open-source-search-engine/Mime.h

40 lines
804 B
C
Raw Normal View History

2013-08-03 00:12:24 +04:00
// Matt Wells, copyright Jun 2000
// . class to parse a standard MIME file
#ifndef _MIME_H_
#define _MIME_H_
#include <time.h> // time_t mktime()
#include "Url.h"
class Mime {
public:
// just sets m_mime/m_mimeLen
2014-11-11 01:45:11 +03:00
void set ( char *mime , int32_t mimeLen );
2013-08-03 00:12:24 +04:00
char *getLine ( char *line ,
2014-11-11 01:45:11 +03:00
char **field , int32_t *fieldLen ,
char **value , int32_t *valueLen ) ;
2013-08-03 00:12:24 +04:00
// . returns a ptr to next line
// . fills in your "field/value" pair of this line
// . skips empty and comment lines automatically
char *getLine ( char *line ,
2014-11-11 01:45:11 +03:00
char **field , int32_t fieldLen ,
char **value , int32_t valueLen );
2013-08-03 00:12:24 +04:00
// use this to get the value of a unique field
2014-11-11 01:45:11 +03:00
char *getValue ( char *field , int32_t *valueLen );
2013-08-03 00:12:24 +04:00
private:
char *m_mime;
2014-11-11 01:45:11 +03:00
int32_t m_mimeLen;
2013-08-03 00:12:24 +04:00
char *m_mimeEnd;
};
#endif