#ifndef _GET_H_defined_ #define _GET_H_defined_ #include // What's on the other end of a URL. size gives the size of the resource in // bytes; data is a pointer to a chunk of storage containing the resource. If // size is zero, so is data. Remember that the data are not necessarily // null-byte terminated. struct resource { unsigned size; char * data; }; // Retrieve the given url and store the results in document. Return an empty // error string if everything went ok, otherwise return an non-empty error // message. The storage chunk referenced by document should be freed by the // caller. extern std::string get(const std::string & url, resource & document); // The parts of a url. The parts don't contain their punctuation: protocol // doesn't end with a colon, the host doesn't start with "//"; the port doesn't // start with a colon; and the directory doesn't start with a slash. struct url_parts { std::string protocol, host, port, directory; }; // Return the given url parsed into parts. extern url_parts parse_url(const std::string &); #endif // $Log: get.h,v $ // Revision 1.2 2003/09/20 21:33:32 rclayton // Define url_parts and declare parse_url(). // // Revision 1.1 2003/09/03 22:30:07 rclayton // Initial revision //