|
latest version v1.9 - last update 24 Nov 2005 |
|
#include <ltiURL.h>
Inheritance diagram for lti::url:


Public Types | |
| enum | serviceType |
| enum | dataType |
Public Member Functions | |
| url (const std::string &n) | |
| ~url () | |
| bool | isOk () |
| virtual bool | setParameters (const parameters &theParam) |
| const parameters & | getParameters () const |
| bool | get (std::string &data) |
| bool | get (vector< ubyte > &data) |
| bool | get (ioObject &data, dataType fmt) |
| bool | getPNGImage (image &data) |
| bool | getJPGImage (image &data) |
| bool | getBMPImage (image &data) |
| bool | put (const std::string &data) |
| bool | put (const vector< ubyte > &data) |
| bool | put (const ioObject &data, dataType fmt) |
| bool | putPNGImage (const image &data) |
| std::istream & | getInputStream () |
| std::ostream & | getOutputStream () |
| const std::string & | getPath () const |
| const char * | getStatusString () const |
Protected Member Functions | |
| void | setStatusString (const char *msg, const char *msg2=0) |
Classes | |
| class | parameters |
| parameters for the url-object More... | |
| class | serviceHandler |
| This is an abstract base class for handling a kind of data service. More... | |
| class | urlFields |
| This class is used to split a URL into its separate fields. More... | |
You simply give it an URL and call the appropriate get method (PUT's are not yet supported. For instance:
lti::url doc("http://tintas/axiom/axicon.png"); if (doc.isOk()) { doc.getPNGImage(tmp); viewer view; view.show(tmp); getchar(); } else { std::cerr << doc.getStatusString() << std::endl; }
Unfortunately, I have no idea how to implement http client code for Windows. Therefore, this class currently only exists for libs compiled for Linux.
Ws2_32.lib is linked (you may need to specify its library in Project..Settings..Link..Object/Library Modules.)
|
|
The kind of data type that is expected for reading and writing ioObjects.
|
|
|
The type of service that is associated with the URL.
|
|
|
Constructor. Creates a new connection to the URL given as argument. If the connection could be created, the function isOk returns true. Otherwise, it returns false. If the connection failed, the cause can be inquired by calling getStatusString. |
|
|
Destructor. Closes the network connection and deletes all allocated data structures. |
|
||||||||||||
|
not implemented yet
|
|
|
Retrieves the URL as binary Data written in data.
|
|
|
Retrieves the URL as text document. This only works if the document is of MIME type "text/...".
|
|
|
Retrieves the URL as binary Data written in data.
|
|
|
Returns the input stream that is used for reading the document. (linux only) |
|
|
Retrieves the URL as binary Data written in data.
|
|
|
Returns the output stream that is used for writing the document. (linux only) |
|
|
returns the current parameters
|
|
|
Returns the path component of this URL.
|
|
|
Retrieves the URL as binary Data written in data.
|
|
|
return the last message set with setStatusString(). This will never return 0. If no status-string has been set yet an empty string (pointer to a string with only the char(0)) will be returned. |
|
|
Returns true if so far all operations have been successful.
|
|
||||||||||||
|
Not implemented yet.
|
|
|
Not implemented yet.
|
|
|
Not implemented yet.
|
|
|
Not implemented yet.
|
|
|
set url's parameters. This member makes a copy of theParam: the url will keep its own copy of the parameters!
|
|
||||||||||||
|
set a status string.
|