xref: /trunk/main/stoc/source/uriproc/UriReference.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_stoc_source_uriproc_UriReference_hxx
25 #define INCLUDED_stoc_source_uriproc_UriReference_hxx
26 
27 #include "com/sun/star/uno/RuntimeException.hpp"
28 #include "osl/mutex.hxx"
29 #include "rtl/ustring.hxx"
30 #include "sal/types.h"
31 
32 namespace rtl { class OUStringBuffer; }
33 
34 namespace stoc { namespace uriproc {
35 
36 class UriReference {
37 public:
38     UriReference(
39         rtl::OUString const & scheme, bool isHierarchical, bool hasAuthority,
40         rtl::OUString const & authority, rtl::OUString const & path,
41         bool hasQuery, rtl::OUString const & query);
42 
43     ~UriReference();
44 
45     rtl::OUString getUriReference();
46 
47     sal_Bool isAbsolute();
48 
49     rtl::OUString getScheme();
50 
51     rtl::OUString getSchemeSpecificPart();
52 
53     sal_Bool isHierarchical();
54 
55     sal_Bool hasAuthority();
56 
57     rtl::OUString getAuthority();
58 
59     rtl::OUString getPath();
60 
61     sal_Bool hasRelativePath();
62 
63     sal_Int32 getPathSegmentCount();
64 
65     rtl::OUString getPathSegment(sal_Int32 index);
66 
67     sal_Bool hasQuery();
68 
69     rtl::OUString getQuery();
70 
71     sal_Bool hasFragment();
72 
73     rtl::OUString getFragment();
74 
75     void setFragment(rtl::OUString const & fragment);
76 
77     void clearFragment();
78 
79     osl::Mutex m_mutex;
80     rtl::OUString m_scheme;
81     rtl::OUString m_authority;
82     rtl::OUString m_path;
83     rtl::OUString m_query;
84     rtl::OUString m_fragment;
85     bool m_isHierarchical;
86     bool m_hasAuthority;
87     bool m_hasQuery;
88     bool m_hasFragment;
89 
90 private:
91     UriReference(UriReference &); // not implemented
92     void operator =(UriReference); // not implemented
93 
94     void appendSchemeSpecificPart(rtl::OUStringBuffer & buffer) const;
95 };
96 
97 } }
98 
99 #endif
100