3 //=============================================================================
5 * @file Parse_Headers.h
9 //=============================================================================
12 #ifndef PARSE_HEADERS_H
13 #define PARSE_HEADERS_H
15 #include "ace/config-all.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 class Headers_Map_Item
23 friend class Headers_Map
;
30 // operator const char * () const;
31 Headers_Map_Item
&operator= (char *);
32 Headers_Map_Item
&operator= (const char *);
33 Headers_Map_Item
&operator= (const Headers_Map_Item
&);
36 const char *header () const;
37 const char *value () const;
47 * @brief Map textual headings to header values (e.g. "Subject:" maps to
56 Headers_Map_Item
&operator[] (const char *const header
);
57 const Headers_Map_Item
&operator[] (const char *const header
) const;
64 int mapped (const char *const header
) const;
67 Headers_Map_Item
*find (const char *const header
) const;
68 Headers_Map_Item
*place (const char *const header
);
69 static int compare (const void *item1
, const void *item2
);
72 Headers_Map_Item map_
[MAX_HEADERS
];
73 Headers_Map_Item garbage_
;
81 * @brief A general mechanism to parse headers of Internet text headers.
83 * Allow interesting headers to be inserted and later associated
84 * with values. This implementation assumes the parsing of headers
85 * will be done from ACE_Message_Blocks.
93 void recognize (const char *const header
);
95 void parse_header_line (char *const header_line
);
98 * -1 -> end of line but not complete header line
99 * 0 -> no end of line marker
100 * 1 -> complete header line
102 int complete_header_line (char *const header_line
);
104 int end_of_headers () const;
108 MAX_HEADER_LINE_LENGTH
= 8192
111 Headers_Map_Item
&operator[] (const char *const header
);
112 const Headers_Map_Item
&operator[] (const char *const header
) const;
115 int end_of_line (char *&line
, int &offset
) const;
122 #endif /* PARSE_HEADERS_H */