Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ProxyParser.cpp

Go to the documentation of this file.
00001 #include "headers.h"
00002 
00003 ProxyParser::ProxyParser(CommandProcessor* cp) : CommandParser(cp)
00004 {}
00005 
00006 
00007 Command* 
00008 ProxyParser::parse(string input) {
00009     stringstream s(input);
00010 
00011         // read the GET/POST/etc...
00012     s >> m_method;
00013 
00014     // read the URL
00015     string hostUrl;
00016     s >> hostUrl;
00017 
00018     Command* command;
00019 
00020     // Check if it is a full URL, which would be the case for a proxy request
00021     if (hostUrl.find("://") < hostUrl.length()) {
00022         if (hostUrl.substr(0, 7) == "http://") {
00023                         // if it does start with http, it is a proxy request
00024             command = new ProxyRequestCommand();
00025             command->setArg(1, input);
00026             return command;
00027                 }
00028     }
00029     return NULL;
00030 } // fn parse

Generated at Thu Jul 11 13:31:51 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001