1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
32 #include <rtl/ustring.hxx>
33 #include <DAVException.hxx>
38 #define DEFAULT_HTTP_PORT 80
39 #define DEFAULT_HTTPS_PORT 443
40 #define DEFAULT_FTP_PORT 21
42 // -------------------------------------------------------------------
44 // A URI implementation for use with the neon/expat library
45 // -------------------------------------------------------------------
50 ::rtl::OUString mScheme
;
51 ::rtl::OUString mUserInfo
;
52 ::rtl::OUString mHostName
;
54 ::rtl::OUString mPath
;
56 void init( const rtl::OString
& rUri
, const ne_uri
* pUri
);
60 NeonUri( const ::rtl::OUString
& inUri
) throw ( DAVException
);
61 NeonUri( const ne_uri
* inUri
) throw ( DAVException
);
64 bool operator== ( const NeonUri
& rOther
) const;
65 bool operator!= ( const NeonUri
& rOther
) const
66 { return !operator==( rOther
); }
68 const ::rtl::OUString
& GetURI( void ) const
70 const ::rtl::OUString
& GetScheme( void ) const
72 const ::rtl::OUString
& GetUserInfo( void ) const
73 { return mUserInfo
; };
74 const ::rtl::OUString
& GetHost( void ) const
75 { return mHostName
; };
76 sal_Int32
GetPort( void ) const
78 const ::rtl::OUString
& GetPath( void ) const
81 ::rtl::OUString
GetPathBaseName ( void ) const;
83 ::rtl::OUString
GetPathBaseNameUnescaped ( void ) const;
85 void SetScheme (const ::rtl::OUString
& scheme
)
86 { mScheme
= scheme
; calculateURI (); };
88 void AppendPath (const ::rtl::OUString
& rPath
);
90 static ::rtl::OUString
escapeSegment( const ::rtl::OUString
& segment
);
91 static ::rtl::OUString
unescape( const ::rtl::OUString
& string
);
93 // "host:port", omit ":port" for port 80 and 443
94 static rtl::OUString
makeConnectionEndPointString(
95 const rtl::OUString
& rHostName
,
97 rtl::OUString
makeConnectionEndPointString() const
98 { return makeConnectionEndPointString( GetHost(), GetPort() ); }
101 } // namespace webdav_ucp
103 #endif // _NEONURI_HXX_
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */