url.h

00001 /*
00002  * url.h
00003  * This file is part of dbPager Classes Library (DCL)
00004  *
00005  * Copyright (c) 2008 Dennis Prochko <wolfsoft@mail.ru>
00006  *
00007  * DCL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation version 3.
00010  *
00011  * DCL is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with DCL; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor,
00019  * Boston, MA  02110-1301  USA
00020  */
00021 
00022 #ifndef URL_H_
00023 #define URL_H_
00024 
00025 #include <string>
00026 
00027 #include <dcl/exception.h>
00028 
00029 namespace dbp {
00030 
00032 
00039 class url {
00040 public:
00042         std::string scheme;
00044         std::string user;
00046         std::string password;
00048         std::string host;
00050         int port;
00052         std::string path;
00054         std::string query;
00056         std::string fragment;
00058         std::string parameters;
00060         url();
00062 
00066         url(const std::string &value);
00068 
00072         url(const char *value);
00074 
00078         void parse(const std::string &value);
00080 
00083         void copy_from(const url &u);
00085         std::string get_full_path() const;
00087         /*
00088                 Expands URL from relative path to absolute path, eleminating all
00089                 '.', '..', '//' sequences.
00090         */
00091         void normalize(const std::string &base_path);
00093         std::string encode(const std::string &value) const;
00095         std::string decode(const std::string &value) const;
00097         std::string str() const;
00098 };
00099 
00100 }
00101 
00102 #endif /*URL_H_*/

 
Support This Project
SourceForge.net Logo