Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

base.URI.h

00001 /*----------------------------------------------------------------------------
00002   SWORD 2000 - Software With Objects for Rapid Development
00003   Copyright (C) 2003 Eric NICOLAS
00004   ----------------------------------------------------------------------------
00005   SWORD is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU Lesser General Public License as published by
00007   the Free Software Foundation; either version 2 of the License, or
00008   (at your option) any later version.
00009 
00010   SWORD is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU Lesser General Public License for more details.
00014 
00015   You should have received a copy of the GNU Lesser General Public License
00016   along with SWORD; if not, write to the Free Software
00017   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018   --------------------------------------------------------------------------*/
00019 #ifndef _SWORD_BASE_URI_
00020 #define _SWORD_BASE_URI_
00021 
00022 #include "sword/base.URIScheme.h"
00023 
00024 namespace sword {
00025 
00027 
00062         class SWORDDECL URI {
00063         public:
00065                 URI();
00066 
00068                 URI(const std::string &uri);
00069 
00071                 URI(const URI &uri);
00072 
00073                 ~URI();
00074 
00076                 URI &operator=(const URI &uri);
00077 
00079                 URI &operator=(const std::string &uri);
00080 
00082                 friend URI operator+(const URI &lhs, const std::string &rhs);
00083 
00085                 URI &operator+=(const std::string &rhs);
00086 
00088                 std::string toString() const;
00089 
00091                 bool empty() const;
00092 
00094                 const URIScheme &scheme() const;
00095 
00097                 const std::string &pathname() const;
00098 
00100                 std::string path() const;
00101 
00103                 std::string filename() const;
00104 
00105         private:
00106                 PURIScheme  scheme_;
00107                 std::string pathname_;
00108 
00109                 void parse_   (const std::string &str);
00110                 void navigate_(const std::string &str);
00111     void canonize_();
00112         };
00113 
00114         class InvalidURIException : public Exception {};
00115 
00116 } // namespace sword
00117 
00118 #include "sword.private/base.URI.inl"
00119 
00120 #endif // _SWORD_BASE_URI_

Generated on Tue Dec 23 20:08:56 2003 for SWORD by doxygen1.3-rc2