3 //=============================================================================
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
9 //=============================================================================
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 * @brief An abstract base class that defines an iterator.
26 * Subclasses of this base class can define what strings
27 * to return from <next>. This class decouples higher-level
28 * software from the details of whatever type of URL header or
29 * body we're iterating over.
34 /// "virtual" destructor.
35 virtual int destroy ();
37 // = Iterator methods.
38 /// Pass back the next <string> that hasn't been seen yet. Returns 0
39 /// when all items have been seen, else 1.
40 virtual int next (ACE_CString
&string
) = 0;
44 virtual ~URL_Iterator ();
48 * @class HTML_Body_Iterator
50 * @brief An iterator that returns URLs embedded in HTML files.
52 class HTML_Body_Iterator
: public URL_Iterator
56 HTML_Body_Iterator (URL
&url
);
58 // = Iterator methods.
60 * Pass back the next <url> that hasn't been seen in the
61 * memory-mapped file. Returns 0 when all items have been seen,
64 virtual int next (ACE_CString
&url
);
67 /// HTTP URL that we're iterating over.
72 * @class HTTP_Header_Iterator
74 * @brief An iterator that iterates over the HTTP header.
76 class HTTP_Header_Iterator
: public URL_Iterator
80 HTTP_Header_Iterator (URL
&url
);
82 // = Iterator methods.
84 * Pass back the next <line> that hasn't been seen in the
85 * memory-mapped file header. Returns 0 when we've reached the end
86 * of the header. seen, else 1.
88 virtual int next (ACE_CString
&line
);
91 /// HTTP URL that we're iterating over.
94 /// We've found the end of the header, which means this iterator is
100 * @class URL_Download_Iterator
102 * @brief An iterator that iterates over the contents of an entire URL,
103 * i.e., both header and body, and returns it in <BUFSIZ>
106 class URL_Download_Iterator
: public URL_Iterator
110 URL_Download_Iterator (URL
&url
);
112 // = Iterator methods.
114 * Pass back the next <buffer> data from the stream, where
115 * <buffer.size> <= <BUFSIZ> . Returns 0 when we've reached the end
116 * of the header, else 1.
118 virtual int next (ACE_CString
&buffer
);
121 /// HTTP URL that we're iterating over.
125 #endif /* _ITERATORS_H */