|
a/src/utils/mimeparse.cpp |
|
b/src/utils/mimeparse.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.10 2006-01-23 13:32:28 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.11 2006-09-05 08:04:36 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
30 |
|
30 |
|
31 |
#ifndef NO_NAMESPACES
|
31 |
#ifndef NO_NAMESPACES
|
32 |
using namespace std;
|
32 |
using namespace std;
|
33 |
#endif /* NO_NAMESPACES */
|
33 |
#endif /* NO_NAMESPACES */
|
34 |
|
34 |
|
35 |
// Parsing a header value. Only content-type has parameters, but
|
35 |
// Parsing a header value. Only content-type and content-disposition
|
36 |
// others are compatible with content-type syntax, only, parameters
|
36 |
// have parameters, but others are compatible with content-type
|
37 |
// are not used. So we can parse all like content-type:
|
37 |
// syntax, only, parameters are not used. So we can parse all like
|
|
|
38 |
// content-type:
|
38 |
// headertype: value [; paramname=paramvalue] ...
|
39 |
// headertype: value [; paramname=paramvalue] ...
|
39 |
// Value and paramvalues can be quoted strings, and there can be
|
40 |
// Value and paramvalues can be quoted strings, and there can be
|
40 |
// comments in there
|
41 |
// comments too
|
41 |
|
42 |
// Ref: RFC2045/6/7 (MIME) RFC1806 (content-disposition)
|
42 |
|
|
|
43 |
|
43 |
|
44 |
// The lexical token returned by find_next_token
|
44 |
// The lexical token returned by find_next_token
|
45 |
class Lexical {
|
45 |
class Lexical {
|
46 |
public:
|
46 |
public:
|
47 |
enum kind {none, token, separator};
|
47 |
enum kind {none, token, separator};
|