xref: /aoo41x/main/unoxml/source/rdf/CURI.cxx (revision e9cbe144)
1*e9cbe144SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*e9cbe144SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*e9cbe144SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*e9cbe144SAndrew Rist  * distributed with this work for additional information
6*e9cbe144SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*e9cbe144SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*e9cbe144SAndrew Rist  * "License"); you may not use this file except in compliance
9*e9cbe144SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e9cbe144SAndrew Rist  *
11*e9cbe144SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e9cbe144SAndrew Rist  *
13*e9cbe144SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*e9cbe144SAndrew Rist  * software distributed under the License is distributed on an
15*e9cbe144SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e9cbe144SAndrew Rist  * KIND, either express or implied.  See the License for the
17*e9cbe144SAndrew Rist  * specific language governing permissions and limitations
18*e9cbe144SAndrew Rist  * under the License.
19*e9cbe144SAndrew Rist  *
20*e9cbe144SAndrew Rist  *************************************************************/
21*e9cbe144SAndrew Rist 
22*e9cbe144SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "CNodes.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
27cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
28cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
29cdf0e10cSrcweir #include <com/sun/star/rdf/XURI.hpp>
30cdf0e10cSrcweir #include <com/sun/star/rdf/URIs.hpp>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <com/sun/star/lang/IllegalArgumentException.hpp>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir 
35cdf0e10cSrcweir /// anonymous implementation namespace
36cdf0e10cSrcweir namespace {
37cdf0e10cSrcweir 
38cdf0e10cSrcweir namespace css = ::com::sun::star;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir class CURI:
41cdf0e10cSrcweir     public ::cppu::WeakImplHelper3<
42cdf0e10cSrcweir         css::lang::XServiceInfo,
43cdf0e10cSrcweir         css::lang::XInitialization,
44cdf0e10cSrcweir         css::rdf::XURI>
45cdf0e10cSrcweir {
46cdf0e10cSrcweir public:
47cdf0e10cSrcweir     explicit CURI(css::uno::Reference< css::uno::XComponentContext > const & context);
~CURI()48cdf0e10cSrcweir     virtual ~CURI() {}
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     // ::com::sun::star::lang::XServiceInfo:
51cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException);
52cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException);
53cdf0e10cSrcweir     virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException);
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     // ::com::sun::star::lang::XInitialization:
56cdf0e10cSrcweir     virtual void SAL_CALL initialize(const css::uno::Sequence< ::com::sun::star::uno::Any > & aArguments) throw (css::uno::RuntimeException, css::uno::Exception);
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     // ::com::sun::star::rdf::XNode:
59cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getStringValue() throw (css::uno::RuntimeException);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     // ::com::sun::star::rdf::XURI:
62cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getLocalName() throw (css::uno::RuntimeException);
63cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getNamespace() throw (css::uno::RuntimeException);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir private:
66cdf0e10cSrcweir     CURI(const CURI &); // not defined
67cdf0e10cSrcweir     CURI& operator=(const CURI &); // not defined
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     /// handle css.rdf.URIs
70cdf0e10cSrcweir     void SAL_CALL initFromConstant(const sal_Int16 i_Constant);
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     css::uno::Reference< css::uno::XComponentContext > m_xContext;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     ::rtl::OUString m_Namespace;
75cdf0e10cSrcweir     ::rtl::OUString m_LocalName;
76cdf0e10cSrcweir };
77cdf0e10cSrcweir 
CURI(css::uno::Reference<css::uno::XComponentContext> const & context)78cdf0e10cSrcweir CURI::CURI(css::uno::Reference< css::uno::XComponentContext > const & context) :
79cdf0e10cSrcweir     m_xContext(context), m_Namespace(), m_LocalName()
80cdf0e10cSrcweir {}
81cdf0e10cSrcweir 
82cdf0e10cSrcweir // com.sun.star.uno.XServiceInfo:
getImplementationName()83cdf0e10cSrcweir ::rtl::OUString SAL_CALL CURI::getImplementationName() throw (css::uno::RuntimeException)
84cdf0e10cSrcweir {
85cdf0e10cSrcweir     return comp_CURI::_getImplementationName();
86cdf0e10cSrcweir }
87cdf0e10cSrcweir 
supportsService(::rtl::OUString const & serviceName)88cdf0e10cSrcweir ::sal_Bool SAL_CALL CURI::supportsService(::rtl::OUString const & serviceName) throw (css::uno::RuntimeException)
89cdf0e10cSrcweir {
90cdf0e10cSrcweir     css::uno::Sequence< ::rtl::OUString > serviceNames = comp_CURI::_getSupportedServiceNames();
91cdf0e10cSrcweir     for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
92cdf0e10cSrcweir         if (serviceNames[i] == serviceName)
93cdf0e10cSrcweir             return sal_True;
94cdf0e10cSrcweir     }
95cdf0e10cSrcweir     return sal_False;
96cdf0e10cSrcweir }
97cdf0e10cSrcweir 
getSupportedServiceNames()98cdf0e10cSrcweir css::uno::Sequence< ::rtl::OUString > SAL_CALL CURI::getSupportedServiceNames() throw (css::uno::RuntimeException)
99cdf0e10cSrcweir {
100cdf0e10cSrcweir     return comp_CURI::_getSupportedServiceNames();
101cdf0e10cSrcweir }
102cdf0e10cSrcweir 
103cdf0e10cSrcweir const char s_nsXS       [] = "http://www.w3.org/2001/XMLSchema#";
104cdf0e10cSrcweir const char s_nsXSD      [] = "http://www.w3.org/2001/XMLSchema-datatypes#";
105cdf0e10cSrcweir const char s_nsRDF      [] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
106cdf0e10cSrcweir const char s_nsRDFs     [] = "http://www.w3.org/2000/01/rdf-schema#";
107cdf0e10cSrcweir const char s_nsOWL      [] = "http://www.w3.org/2002/07/owl#";
108cdf0e10cSrcweir const char s_nsPkg      [] =
109cdf0e10cSrcweir     "http://docs.oasis-open.org/ns/office/1.2/meta/pkg#";
110cdf0e10cSrcweir const char s_nsODF      [] =
111cdf0e10cSrcweir     "http://docs.oasis-open.org/ns/office/1.2/meta/odf#";
112cdf0e10cSrcweir 
initFromConstant(const sal_Int16 i_Constant)113cdf0e10cSrcweir void SAL_CALL CURI::initFromConstant(const sal_Int16 i_Constant)
114cdf0e10cSrcweir {
115cdf0e10cSrcweir     const char *ns(0);
116cdf0e10cSrcweir     const char *ln(0);
117cdf0e10cSrcweir     switch (i_Constant)
118cdf0e10cSrcweir     {
119cdf0e10cSrcweir         case css::rdf::URIs::XSD_NCNAME:
120cdf0e10cSrcweir             ns = s_nsXSD;
121cdf0e10cSrcweir             ln = "NCName";
122cdf0e10cSrcweir             break;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir         case css::rdf::URIs::XSD_STRING:
125cdf0e10cSrcweir             ns = s_nsXSD;
126cdf0e10cSrcweir             ln = "string";
127cdf0e10cSrcweir             break;
128cdf0e10cSrcweir 
129cdf0e10cSrcweir         case css::rdf::URIs::XSD_NORMALIZEDSTRING:
130cdf0e10cSrcweir             ns = s_nsXSD;
131cdf0e10cSrcweir             ln = "normalizedString";
132cdf0e10cSrcweir             break;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir         case css::rdf::URIs::XSD_BOOLEAN:
135cdf0e10cSrcweir             ns = s_nsXSD;
136cdf0e10cSrcweir             ln = "boolean";
137cdf0e10cSrcweir             break;
138cdf0e10cSrcweir 
139cdf0e10cSrcweir         case css::rdf::URIs::XSD_DECIMAL:
140cdf0e10cSrcweir             ns = s_nsXSD;
141cdf0e10cSrcweir             ln = "decimal";
142cdf0e10cSrcweir             break;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir         case css::rdf::URIs::XSD_FLOAT:
145cdf0e10cSrcweir             ns = s_nsXSD;
146cdf0e10cSrcweir             ln = "float";
147cdf0e10cSrcweir             break;
148cdf0e10cSrcweir 
149cdf0e10cSrcweir         case css::rdf::URIs::XSD_DOUBLE:
150cdf0e10cSrcweir             ns = s_nsXSD;
151cdf0e10cSrcweir             ln = "double";
152cdf0e10cSrcweir             break;
153cdf0e10cSrcweir 
154cdf0e10cSrcweir         case css::rdf::URIs::XSD_INTEGER:
155cdf0e10cSrcweir             ns = s_nsXSD;
156cdf0e10cSrcweir             ln = "integer";
157cdf0e10cSrcweir             break;
158cdf0e10cSrcweir 
159cdf0e10cSrcweir         case css::rdf::URIs::XSD_NONNEGATIVEINTEGER:
160cdf0e10cSrcweir             ns = s_nsXSD;
161cdf0e10cSrcweir             ln = "nonNegativeInteger";
162cdf0e10cSrcweir             break;
163cdf0e10cSrcweir 
164cdf0e10cSrcweir         case css::rdf::URIs::XSD_POSITIVEINTEGER:
165cdf0e10cSrcweir             ns = s_nsXSD;
166cdf0e10cSrcweir             ln = "positiveInteger";
167cdf0e10cSrcweir             break;
168cdf0e10cSrcweir 
169cdf0e10cSrcweir         case css::rdf::URIs::XSD_NONPOSITIVEINTEGER:
170cdf0e10cSrcweir             ns = s_nsXSD;
171cdf0e10cSrcweir             ln = "nonPositiveInteger";
172cdf0e10cSrcweir             break;
173cdf0e10cSrcweir 
174cdf0e10cSrcweir         case css::rdf::URIs::XSD_NEGATIVEINTEGER:
175cdf0e10cSrcweir             ns = s_nsXSD;
176cdf0e10cSrcweir             ln = "negativeInteger";
177cdf0e10cSrcweir             break;
178cdf0e10cSrcweir 
179cdf0e10cSrcweir         case css::rdf::URIs::XSD_LONG:
180cdf0e10cSrcweir             ns = s_nsXSD;
181cdf0e10cSrcweir             ln = "long";
182cdf0e10cSrcweir             break;
183cdf0e10cSrcweir 
184cdf0e10cSrcweir         case css::rdf::URIs::XSD_INT:
185cdf0e10cSrcweir             ns = s_nsXSD;
186cdf0e10cSrcweir             ln = "int";
187cdf0e10cSrcweir             break;
188cdf0e10cSrcweir 
189cdf0e10cSrcweir         case css::rdf::URIs::XSD_SHORT:
190cdf0e10cSrcweir             ns = s_nsXSD;
191cdf0e10cSrcweir             ln = "short";
192cdf0e10cSrcweir             break;
193cdf0e10cSrcweir 
194cdf0e10cSrcweir         case css::rdf::URIs::XSD_BYTE:
195cdf0e10cSrcweir             ns = s_nsXSD;
196cdf0e10cSrcweir             ln = "byte";
197cdf0e10cSrcweir             break;
198cdf0e10cSrcweir 
199cdf0e10cSrcweir         case css::rdf::URIs::XSD_UNSIGNEDLONG:
200cdf0e10cSrcweir             ns = s_nsXSD;
201cdf0e10cSrcweir             ln = "unsignedLong";
202cdf0e10cSrcweir             break;
203cdf0e10cSrcweir 
204cdf0e10cSrcweir         case css::rdf::URIs::XSD_UNSIGNEDINT:
205cdf0e10cSrcweir             ns = s_nsXSD;
206cdf0e10cSrcweir             ln = "unsignedInt";
207cdf0e10cSrcweir             break;
208cdf0e10cSrcweir 
209cdf0e10cSrcweir         case css::rdf::URIs::XSD_UNSIGNEDSHORT:
210cdf0e10cSrcweir             ns = s_nsXSD;
211cdf0e10cSrcweir             ln = "unsignedShort";
212cdf0e10cSrcweir             break;
213cdf0e10cSrcweir 
214cdf0e10cSrcweir         case css::rdf::URIs::XSD_UNSIGNEDBYTE:
215cdf0e10cSrcweir             ns = s_nsXSD;
216cdf0e10cSrcweir             ln = "unsignedByte";
217cdf0e10cSrcweir             break;
218cdf0e10cSrcweir 
219cdf0e10cSrcweir         case css::rdf::URIs::XSD_HEXBINARY:
220cdf0e10cSrcweir             ns = s_nsXSD;
221cdf0e10cSrcweir             ln = "hexBinary";
222cdf0e10cSrcweir             break;
223cdf0e10cSrcweir 
224cdf0e10cSrcweir         case css::rdf::URIs::XSD_BASE64BINARY:
225cdf0e10cSrcweir             ns = s_nsXSD;
226cdf0e10cSrcweir             ln = "base64Binary";
227cdf0e10cSrcweir             break;
228cdf0e10cSrcweir 
229cdf0e10cSrcweir         case css::rdf::URIs::XSD_DATETIME:
230cdf0e10cSrcweir             ns = s_nsXSD;
231cdf0e10cSrcweir             ln = "dateTime";
232cdf0e10cSrcweir             break;
233cdf0e10cSrcweir 
234cdf0e10cSrcweir         case css::rdf::URIs::XSD_TIME:
235cdf0e10cSrcweir             ns = s_nsXSD;
236cdf0e10cSrcweir             ln = "time";
237cdf0e10cSrcweir             break;
238cdf0e10cSrcweir 
239cdf0e10cSrcweir         case css::rdf::URIs::XSD_DATE:
240cdf0e10cSrcweir             ns = s_nsXSD;
241cdf0e10cSrcweir             ln = "date";
242cdf0e10cSrcweir             break;
243cdf0e10cSrcweir 
244cdf0e10cSrcweir         case css::rdf::URIs::XSD_GYEARMONTH:
245cdf0e10cSrcweir             ns = s_nsXSD;
246cdf0e10cSrcweir             ln = "gYearMonth";
247cdf0e10cSrcweir             break;
248cdf0e10cSrcweir 
249cdf0e10cSrcweir         case css::rdf::URIs::XSD_GYEAR:
250cdf0e10cSrcweir             ns = s_nsXSD;
251cdf0e10cSrcweir             ln = "gYear";
252cdf0e10cSrcweir             break;
253cdf0e10cSrcweir 
254cdf0e10cSrcweir         case css::rdf::URIs::XSD_GMONTHDAY:
255cdf0e10cSrcweir             ns = s_nsXSD;
256cdf0e10cSrcweir             ln = "gMonthDay";
257cdf0e10cSrcweir             break;
258cdf0e10cSrcweir 
259cdf0e10cSrcweir         case css::rdf::URIs::XSD_GDAY:
260cdf0e10cSrcweir             ns = s_nsXSD;
261cdf0e10cSrcweir             ln = "gDay";
262cdf0e10cSrcweir             break;
263cdf0e10cSrcweir 
264cdf0e10cSrcweir         case css::rdf::URIs::XSD_GMONTH:
265cdf0e10cSrcweir             ns = s_nsXSD;
266cdf0e10cSrcweir             ln = "gMonth";
267cdf0e10cSrcweir             break;
268cdf0e10cSrcweir 
269cdf0e10cSrcweir         case css::rdf::URIs::XSD_ANYURI:
270cdf0e10cSrcweir             ns = s_nsXSD;
271cdf0e10cSrcweir             ln = "anyURI";
272cdf0e10cSrcweir             break;
273cdf0e10cSrcweir 
274cdf0e10cSrcweir         case css::rdf::URIs::XSD_TOKEN:
275cdf0e10cSrcweir             ns = s_nsXSD;
276cdf0e10cSrcweir             ln = "token";
277cdf0e10cSrcweir             break;
278cdf0e10cSrcweir 
279cdf0e10cSrcweir         case css::rdf::URIs::XSD_LANGUAGE:
280cdf0e10cSrcweir             ns = s_nsXSD;
281cdf0e10cSrcweir             ln = "language";
282cdf0e10cSrcweir             break;
283cdf0e10cSrcweir 
284cdf0e10cSrcweir         case css::rdf::URIs::XSD_NMTOKEN:
285cdf0e10cSrcweir             ns = s_nsXSD;
286cdf0e10cSrcweir             ln = "NMTOKEN";
287cdf0e10cSrcweir             break;
288cdf0e10cSrcweir 
289cdf0e10cSrcweir         case css::rdf::URIs::XSD_NAME:
290cdf0e10cSrcweir             ns = s_nsXSD;
291cdf0e10cSrcweir             ln = "Name";
292cdf0e10cSrcweir             break;
293cdf0e10cSrcweir 
294cdf0e10cSrcweir         case css::rdf::URIs::XSD_DURATION:
295cdf0e10cSrcweir             ns = s_nsXSD;
296cdf0e10cSrcweir             ln = "duration";
297cdf0e10cSrcweir             break;
298cdf0e10cSrcweir 
299cdf0e10cSrcweir         case css::rdf::URIs::XSD_QNAME:
300cdf0e10cSrcweir             ns = s_nsXSD;
301cdf0e10cSrcweir             ln = "QName";
302cdf0e10cSrcweir             break;
303cdf0e10cSrcweir 
304cdf0e10cSrcweir         case css::rdf::URIs::XSD_NOTATION:
305cdf0e10cSrcweir             ns = s_nsXSD;
306cdf0e10cSrcweir             ln = "NOTATION";
307cdf0e10cSrcweir             break;
308cdf0e10cSrcweir 
309cdf0e10cSrcweir         case css::rdf::URIs::XSD_NMTOKENS:
310cdf0e10cSrcweir             ns = s_nsXSD;
311cdf0e10cSrcweir             ln = "NMTOKENS";
312cdf0e10cSrcweir             break;
313cdf0e10cSrcweir 
314cdf0e10cSrcweir         case css::rdf::URIs::XSD_ID:
315cdf0e10cSrcweir             ns = s_nsXSD;
316cdf0e10cSrcweir             ln = "ID";
317cdf0e10cSrcweir             break;
318cdf0e10cSrcweir 
319cdf0e10cSrcweir         case css::rdf::URIs::XSD_IDREF:
320cdf0e10cSrcweir             ns = s_nsXSD;
321cdf0e10cSrcweir             ln = "IDREF";
322cdf0e10cSrcweir             break;
323cdf0e10cSrcweir 
324cdf0e10cSrcweir         case css::rdf::URIs::XSD_IDREFS:
325cdf0e10cSrcweir             ns = s_nsXSD;
326cdf0e10cSrcweir             ln = "IDREFS";
327cdf0e10cSrcweir             break;
328cdf0e10cSrcweir 
329cdf0e10cSrcweir         case css::rdf::URIs::XSD_ENTITY:
330cdf0e10cSrcweir             ns = s_nsXSD;
331cdf0e10cSrcweir             ln = "ENTITY";
332cdf0e10cSrcweir             break;
333cdf0e10cSrcweir 
334cdf0e10cSrcweir         case css::rdf::URIs::XSD_ENTITIES:
335cdf0e10cSrcweir             ns = s_nsXSD;
336cdf0e10cSrcweir             ln = "ENTITIES";
337cdf0e10cSrcweir             break;
338cdf0e10cSrcweir 
339cdf0e10cSrcweir         case css::rdf::URIs::RDF_TYPE:
340cdf0e10cSrcweir             ns = s_nsRDF;
341cdf0e10cSrcweir             ln = "type";
342cdf0e10cSrcweir             break;
343cdf0e10cSrcweir 
344cdf0e10cSrcweir         case css::rdf::URIs::RDF_SUBJECT:
345cdf0e10cSrcweir             ns = s_nsRDF;
346cdf0e10cSrcweir             ln = "subject";
347cdf0e10cSrcweir             break;
348cdf0e10cSrcweir 
349cdf0e10cSrcweir         case css::rdf::URIs::RDF_PREDICATE:
350cdf0e10cSrcweir             ns = s_nsRDF;
351cdf0e10cSrcweir             ln = "predicate";
352cdf0e10cSrcweir             break;
353cdf0e10cSrcweir 
354cdf0e10cSrcweir         case css::rdf::URIs::RDF_OBJECT:
355cdf0e10cSrcweir             ns = s_nsRDF;
356cdf0e10cSrcweir             ln = "object";
357cdf0e10cSrcweir             break;
358cdf0e10cSrcweir 
359cdf0e10cSrcweir         case css::rdf::URIs::RDF_PROPERTY:
360cdf0e10cSrcweir             ns = s_nsRDF;
361cdf0e10cSrcweir             ln = "Property";
362cdf0e10cSrcweir             break;
363cdf0e10cSrcweir 
364cdf0e10cSrcweir         case css::rdf::URIs::RDF_STATEMENT:
365cdf0e10cSrcweir             ns = s_nsRDF;
366cdf0e10cSrcweir             ln = "Statement";
367cdf0e10cSrcweir             break;
368cdf0e10cSrcweir 
369cdf0e10cSrcweir         case css::rdf::URIs::RDF_VALUE:
370cdf0e10cSrcweir             ns = s_nsRDF;
371cdf0e10cSrcweir             ln = "value";
372cdf0e10cSrcweir             break;
373cdf0e10cSrcweir 
374cdf0e10cSrcweir         case css::rdf::URIs::RDF_FIRST:
375cdf0e10cSrcweir             ns = s_nsRDF;
376cdf0e10cSrcweir             ln = "first";
377cdf0e10cSrcweir             break;
378cdf0e10cSrcweir 
379cdf0e10cSrcweir         case css::rdf::URIs::RDF_REST:
380cdf0e10cSrcweir             ns = s_nsRDF;
381cdf0e10cSrcweir             ln = "rest";
382cdf0e10cSrcweir             break;
383cdf0e10cSrcweir 
384cdf0e10cSrcweir         case css::rdf::URIs::RDF_NIL:
385cdf0e10cSrcweir             ns = s_nsRDF;
386cdf0e10cSrcweir             ln = "nil";
387cdf0e10cSrcweir             break;
388cdf0e10cSrcweir 
389cdf0e10cSrcweir         case css::rdf::URIs::RDF_XMLLITERAL:
390cdf0e10cSrcweir             ns = s_nsRDF;
391cdf0e10cSrcweir             ln = "XMLLiteral";
392cdf0e10cSrcweir             break;
393cdf0e10cSrcweir 
394cdf0e10cSrcweir         case css::rdf::URIs::RDF_ALT:
395cdf0e10cSrcweir             ns = s_nsRDF;
396cdf0e10cSrcweir             ln = "Alt";
397cdf0e10cSrcweir             break;
398cdf0e10cSrcweir 
399cdf0e10cSrcweir         case css::rdf::URIs::RDF_BAG:
400cdf0e10cSrcweir             ns = s_nsRDF;
401cdf0e10cSrcweir             ln = "Bag";
402cdf0e10cSrcweir             break;
403cdf0e10cSrcweir 
404cdf0e10cSrcweir         case css::rdf::URIs::RDF_LIST:
405cdf0e10cSrcweir             ns = s_nsRDF;
406cdf0e10cSrcweir             ln = "List";
407cdf0e10cSrcweir             break;
408cdf0e10cSrcweir 
409cdf0e10cSrcweir         case css::rdf::URIs::RDF_SEQ:
410cdf0e10cSrcweir             ns = s_nsRDF;
411cdf0e10cSrcweir             ln = "Seq";
412cdf0e10cSrcweir             break;
413cdf0e10cSrcweir 
414cdf0e10cSrcweir         case css::rdf::URIs::RDF_1:
415cdf0e10cSrcweir             ns = s_nsRDF;
416cdf0e10cSrcweir             ln = "_1";
417cdf0e10cSrcweir             break;
418cdf0e10cSrcweir 
419cdf0e10cSrcweir         case css::rdf::URIs::RDFS_COMMENT:
420cdf0e10cSrcweir             ns = s_nsRDFs;
421cdf0e10cSrcweir             ln = "comment";
422cdf0e10cSrcweir             break;
423cdf0e10cSrcweir 
424cdf0e10cSrcweir         case css::rdf::URIs::RDFS_LABEL:
425cdf0e10cSrcweir             ns = s_nsRDFs;
426cdf0e10cSrcweir             ln = "label";
427cdf0e10cSrcweir             break;
428cdf0e10cSrcweir 
429cdf0e10cSrcweir         case css::rdf::URIs::RDFS_DOMAIN:
430cdf0e10cSrcweir             ns = s_nsRDFs;
431cdf0e10cSrcweir             ln = "domain";
432cdf0e10cSrcweir             break;
433cdf0e10cSrcweir 
434cdf0e10cSrcweir         case css::rdf::URIs::RDFS_RANGE:
435cdf0e10cSrcweir             ns = s_nsRDFs;
436cdf0e10cSrcweir             ln = "range";
437cdf0e10cSrcweir             break;
438cdf0e10cSrcweir 
439cdf0e10cSrcweir         case css::rdf::URIs::RDFS_SUBCLASSOF:
440cdf0e10cSrcweir             ns = s_nsRDFs;
441cdf0e10cSrcweir             ln = "subClassOf";
442cdf0e10cSrcweir             break;
443cdf0e10cSrcweir 
444cdf0e10cSrcweir         case css::rdf::URIs::RDFS_LITERAL:
445cdf0e10cSrcweir             ns = s_nsRDFs;
446cdf0e10cSrcweir             ln = "Literal";
447cdf0e10cSrcweir             break;
448cdf0e10cSrcweir 
449cdf0e10cSrcweir         case css::rdf::URIs::OWL_CLASS:
450cdf0e10cSrcweir             ns = s_nsOWL;
451cdf0e10cSrcweir             ln = "Class";
452cdf0e10cSrcweir             break;
453cdf0e10cSrcweir 
454cdf0e10cSrcweir         case css::rdf::URIs::OWL_OBJECTPROPERTY:
455cdf0e10cSrcweir             ns = s_nsOWL;
456cdf0e10cSrcweir             ln = "ObjectProperty";
457cdf0e10cSrcweir             break;
458cdf0e10cSrcweir 
459cdf0e10cSrcweir         case css::rdf::URIs::OWL_DATATYPEPROPERTY:
460cdf0e10cSrcweir             ns = s_nsOWL;
461cdf0e10cSrcweir             ln = "DatatypeProperty";
462cdf0e10cSrcweir             break;
463cdf0e10cSrcweir 
464cdf0e10cSrcweir         case css::rdf::URIs::OWL_FUNCTIONALPROPERTY:
465cdf0e10cSrcweir             ns = s_nsOWL;
466cdf0e10cSrcweir             ln = "FunctionalProperty";
467cdf0e10cSrcweir             break;
468cdf0e10cSrcweir 
469cdf0e10cSrcweir         case css::rdf::URIs::OWL_THING:
470cdf0e10cSrcweir             ns = s_nsOWL;
471cdf0e10cSrcweir             ln = "Thing";
472cdf0e10cSrcweir             break;
473cdf0e10cSrcweir 
474cdf0e10cSrcweir         case css::rdf::URIs::OWL_NOTHING:
475cdf0e10cSrcweir             ns = s_nsOWL;
476cdf0e10cSrcweir             ln = "Nothing";
477cdf0e10cSrcweir             break;
478cdf0e10cSrcweir 
479cdf0e10cSrcweir         case css::rdf::URIs::OWL_INDIVIDUAL:
480cdf0e10cSrcweir             ns = s_nsOWL;
481cdf0e10cSrcweir             ln = "Individual";
482cdf0e10cSrcweir             break;
483cdf0e10cSrcweir 
484cdf0e10cSrcweir         case css::rdf::URIs::OWL_EQUIVALENTCLASS:
485cdf0e10cSrcweir             ns = s_nsOWL;
486cdf0e10cSrcweir             ln = "equivalentClass";
487cdf0e10cSrcweir             break;
488cdf0e10cSrcweir 
489cdf0e10cSrcweir         case css::rdf::URIs::OWL_EQUIVALENTPROPERTY:
490cdf0e10cSrcweir             ns = s_nsOWL;
491cdf0e10cSrcweir             ln = "equivalentProperty";
492cdf0e10cSrcweir             break;
493cdf0e10cSrcweir 
494cdf0e10cSrcweir         case css::rdf::URIs::OWL_SAMEAS:
495cdf0e10cSrcweir             ns = s_nsOWL;
496cdf0e10cSrcweir             ln = "sameAs";
497cdf0e10cSrcweir             break;
498cdf0e10cSrcweir 
499cdf0e10cSrcweir         case css::rdf::URIs::OWL_DIFFERENTFROM:
500cdf0e10cSrcweir             ns = s_nsOWL;
501cdf0e10cSrcweir             ln = "differentFrom";
502cdf0e10cSrcweir             break;
503cdf0e10cSrcweir 
504cdf0e10cSrcweir         case css::rdf::URIs::OWL_ALLDIFFERENT:
505cdf0e10cSrcweir             ns = s_nsOWL;
506cdf0e10cSrcweir             ln = "AllDifferent";
507cdf0e10cSrcweir             break;
508cdf0e10cSrcweir 
509cdf0e10cSrcweir         case css::rdf::URIs::OWL_DISTINCTMEMBERS:
510cdf0e10cSrcweir             ns = s_nsOWL;
511cdf0e10cSrcweir             ln = "distinctMembers";
512cdf0e10cSrcweir             break;
513cdf0e10cSrcweir 
514cdf0e10cSrcweir         case css::rdf::URIs::OWL_INVERSEOF:
515cdf0e10cSrcweir             ns = s_nsOWL;
516cdf0e10cSrcweir             ln = "inverseOf";
517cdf0e10cSrcweir             break;
518cdf0e10cSrcweir 
519cdf0e10cSrcweir         case css::rdf::URIs::OWL_TRANSITIVEPROPERTY:
520cdf0e10cSrcweir             ns = s_nsOWL;
521cdf0e10cSrcweir             ln = "TransitiveProperty";
522cdf0e10cSrcweir             break;
523cdf0e10cSrcweir 
524cdf0e10cSrcweir         case css::rdf::URIs::OWL_SYMMETRICPROPERTY:
525cdf0e10cSrcweir             ns = s_nsOWL;
526cdf0e10cSrcweir             ln = "SymmetricProperty";
527cdf0e10cSrcweir             break;
528cdf0e10cSrcweir 
529cdf0e10cSrcweir         case css::rdf::URIs::OWL_INVERSEFUNCTIONALPROPERTY:
530cdf0e10cSrcweir             ns = s_nsOWL;
531cdf0e10cSrcweir             ln = "InverseFunctionalProperty";
532cdf0e10cSrcweir             break;
533cdf0e10cSrcweir 
534cdf0e10cSrcweir         case css::rdf::URIs::OWL_RESTRICTION:
535cdf0e10cSrcweir             ns = s_nsOWL;
536cdf0e10cSrcweir             ln = "Restriction";
537cdf0e10cSrcweir             break;
538cdf0e10cSrcweir 
539cdf0e10cSrcweir         case css::rdf::URIs::OWL_ONPROPERTY:
540cdf0e10cSrcweir             ns = s_nsOWL;
541cdf0e10cSrcweir             ln = "onProperty";
542cdf0e10cSrcweir             break;
543cdf0e10cSrcweir 
544cdf0e10cSrcweir         case css::rdf::URIs::OWL_ALLVALUESFROM:
545cdf0e10cSrcweir             ns = s_nsOWL;
546cdf0e10cSrcweir             ln = "allValuesFrom";
547cdf0e10cSrcweir             break;
548cdf0e10cSrcweir 
549cdf0e10cSrcweir         case css::rdf::URIs::OWL_SOMEVALUESFROM:
550cdf0e10cSrcweir             ns = s_nsOWL;
551cdf0e10cSrcweir             ln = "someValuesFrom";
552cdf0e10cSrcweir             break;
553cdf0e10cSrcweir 
554cdf0e10cSrcweir         case css::rdf::URIs::OWL_MINCARDINALITY:
555cdf0e10cSrcweir             ns = s_nsOWL;
556cdf0e10cSrcweir             ln = "minCardinality";
557cdf0e10cSrcweir             break;
558cdf0e10cSrcweir 
559cdf0e10cSrcweir         case css::rdf::URIs::OWL_MAXCARDINALITY:
560cdf0e10cSrcweir             ns = s_nsOWL;
561cdf0e10cSrcweir             ln = "maxCardinality";
562cdf0e10cSrcweir             break;
563cdf0e10cSrcweir 
564cdf0e10cSrcweir         case css::rdf::URIs::OWL_CARDINALITY:
565cdf0e10cSrcweir             ns = s_nsOWL;
566cdf0e10cSrcweir             ln = "cardinality";
567cdf0e10cSrcweir             break;
568cdf0e10cSrcweir 
569cdf0e10cSrcweir         case css::rdf::URIs::OWL_ONTOLOGY:
570cdf0e10cSrcweir             ns = s_nsOWL;
571cdf0e10cSrcweir             ln = "Ontology";
572cdf0e10cSrcweir             break;
573cdf0e10cSrcweir 
574cdf0e10cSrcweir         case css::rdf::URIs::OWL_IMPORTS:
575cdf0e10cSrcweir             ns = s_nsOWL;
576cdf0e10cSrcweir             ln = "imports";
577cdf0e10cSrcweir             break;
578cdf0e10cSrcweir 
579cdf0e10cSrcweir         case css::rdf::URIs::OWL_VERSIONINFO:
580cdf0e10cSrcweir             ns = s_nsOWL;
581cdf0e10cSrcweir             ln = "versionInfo";
582cdf0e10cSrcweir             break;
583cdf0e10cSrcweir 
584cdf0e10cSrcweir         case css::rdf::URIs::OWL_PRIORVERSION:
585cdf0e10cSrcweir             ns = s_nsOWL;
586cdf0e10cSrcweir             ln = "priorVersion";
587cdf0e10cSrcweir             break;
588cdf0e10cSrcweir 
589cdf0e10cSrcweir         case css::rdf::URIs::OWL_BACKWARDCOMPATIBLEWITH:
590cdf0e10cSrcweir             ns = s_nsOWL;
591cdf0e10cSrcweir             ln = "backwardCompatibleWith";
592cdf0e10cSrcweir             break;
593cdf0e10cSrcweir 
594cdf0e10cSrcweir         case css::rdf::URIs::OWL_INCOMPATIBLEWITH:
595cdf0e10cSrcweir             ns = s_nsOWL;
596cdf0e10cSrcweir             ln = "incompatibleWith";
597cdf0e10cSrcweir             break;
598cdf0e10cSrcweir 
599cdf0e10cSrcweir         case css::rdf::URIs::OWL_DEPRECATEDCLASS:
600cdf0e10cSrcweir             ns = s_nsOWL;
601cdf0e10cSrcweir             ln = "DeprecatedClass";
602cdf0e10cSrcweir             break;
603cdf0e10cSrcweir 
604cdf0e10cSrcweir         case css::rdf::URIs::OWL_DEPRECATEDPROPERTY:
605cdf0e10cSrcweir             ns = s_nsOWL;
606cdf0e10cSrcweir             ln = "DeprecatedProperty";
607cdf0e10cSrcweir             break;
608cdf0e10cSrcweir 
609cdf0e10cSrcweir         case css::rdf::URIs::OWL_ANNOTATIONPROPERTY:
610cdf0e10cSrcweir             ns = s_nsOWL;
611cdf0e10cSrcweir             ln = "AnnotationProperty";
612cdf0e10cSrcweir             break;
613cdf0e10cSrcweir 
614cdf0e10cSrcweir         case css::rdf::URIs::OWL_ONTOLOGYPROPERTY:
615cdf0e10cSrcweir             ns = s_nsOWL;
616cdf0e10cSrcweir             ln = "OntologyProperty";
617cdf0e10cSrcweir             break;
618cdf0e10cSrcweir 
619cdf0e10cSrcweir         case css::rdf::URIs::OWL_ONEOF:
620cdf0e10cSrcweir             ns = s_nsOWL;
621cdf0e10cSrcweir             ln = "oneOf";
622cdf0e10cSrcweir             break;
623cdf0e10cSrcweir 
624cdf0e10cSrcweir         case css::rdf::URIs::OWL_DATARANGE:
625cdf0e10cSrcweir             ns = s_nsOWL;
626cdf0e10cSrcweir             ln = "dataRange";
627cdf0e10cSrcweir             break;
628cdf0e10cSrcweir 
629cdf0e10cSrcweir         case css::rdf::URIs::OWL_DISJOINTWITH:
630cdf0e10cSrcweir             ns = s_nsOWL;
631cdf0e10cSrcweir             ln = "disjointWith";
632cdf0e10cSrcweir             break;
633cdf0e10cSrcweir 
634cdf0e10cSrcweir         case css::rdf::URIs::OWL_UNIONOF:
635cdf0e10cSrcweir             ns = s_nsOWL;
636cdf0e10cSrcweir             ln = "unionOf";
637cdf0e10cSrcweir             break;
638cdf0e10cSrcweir 
639cdf0e10cSrcweir         case css::rdf::URIs::OWL_COMPLEMENTOF:
640cdf0e10cSrcweir             ns = s_nsOWL;
641cdf0e10cSrcweir             ln = "complementOf";
642cdf0e10cSrcweir             break;
643cdf0e10cSrcweir 
644cdf0e10cSrcweir         case css::rdf::URIs::OWL_INTERSECTIONOF:
645cdf0e10cSrcweir             ns = s_nsOWL;
646cdf0e10cSrcweir             ln = "intersectionOf";
647cdf0e10cSrcweir             break;
648cdf0e10cSrcweir 
649cdf0e10cSrcweir         case css::rdf::URIs::OWL_HASVALUE:
650cdf0e10cSrcweir             ns = s_nsOWL;
651cdf0e10cSrcweir             ln = "hasValue";
652cdf0e10cSrcweir             break;
653cdf0e10cSrcweir 
654cdf0e10cSrcweir 
655cdf0e10cSrcweir         case css::rdf::URIs::PKG_HASPART:
656cdf0e10cSrcweir             ns = s_nsPkg;
657cdf0e10cSrcweir             ln = "hasPart";
658cdf0e10cSrcweir             break;
659cdf0e10cSrcweir 
660cdf0e10cSrcweir /* REMOVED
661cdf0e10cSrcweir         case css::rdf::URIs::PKG_IDREF:
662cdf0e10cSrcweir             ns = s_nsPkg;
663cdf0e10cSrcweir             ln = "idref";
664cdf0e10cSrcweir             break;
665cdf0e10cSrcweir 
666cdf0e10cSrcweir         case css::rdf::URIs::PKG_PATH:
667cdf0e10cSrcweir             ns = s_nsPkg;
668cdf0e10cSrcweir             ln = "path";
669cdf0e10cSrcweir             break;
670cdf0e10cSrcweir */
671cdf0e10cSrcweir 
672cdf0e10cSrcweir         case css::rdf::URIs::PKG_MIMETYPE:
673cdf0e10cSrcweir             ns = s_nsPkg;
674cdf0e10cSrcweir             ln = "mimeType";
675cdf0e10cSrcweir             break;
676cdf0e10cSrcweir 
677cdf0e10cSrcweir         case css::rdf::URIs::PKG_PACKAGE:
678cdf0e10cSrcweir             ns = s_nsPkg;
679cdf0e10cSrcweir             ln = "Package";
680cdf0e10cSrcweir             break;
681cdf0e10cSrcweir 
682cdf0e10cSrcweir         case css::rdf::URIs::PKG_ELEMENT:
683cdf0e10cSrcweir             ns = s_nsPkg;
684cdf0e10cSrcweir             ln = "Element";
685cdf0e10cSrcweir             break;
686cdf0e10cSrcweir 
687cdf0e10cSrcweir         case css::rdf::URIs::PKG_FILE:
688cdf0e10cSrcweir             ns = s_nsPkg;
689cdf0e10cSrcweir             ln = "File";
690cdf0e10cSrcweir             break;
691cdf0e10cSrcweir 
692cdf0e10cSrcweir         case css::rdf::URIs::PKG_METADATAFILE:
693cdf0e10cSrcweir             ns = s_nsPkg;
694cdf0e10cSrcweir             ln = "MetadataFile";
695cdf0e10cSrcweir             break;
696cdf0e10cSrcweir 
697cdf0e10cSrcweir         case css::rdf::URIs::PKG_DOCUMENT:
698cdf0e10cSrcweir             ns = s_nsPkg;
699cdf0e10cSrcweir             ln = "Document";
700cdf0e10cSrcweir             break;
701cdf0e10cSrcweir 
702cdf0e10cSrcweir         case css::rdf::URIs::ODF_PREFIX:
703cdf0e10cSrcweir             ns = s_nsODF;
704cdf0e10cSrcweir             ln = "prefix";
705cdf0e10cSrcweir             break;
706cdf0e10cSrcweir 
707cdf0e10cSrcweir         case css::rdf::URIs::ODF_SUFFIX:
708cdf0e10cSrcweir             ns = s_nsODF;
709cdf0e10cSrcweir             ln = "suffix";
710cdf0e10cSrcweir             break;
711cdf0e10cSrcweir 
712cdf0e10cSrcweir         case css::rdf::URIs::ODF_ELEMENT:
713cdf0e10cSrcweir             ns = s_nsODF;
714cdf0e10cSrcweir             ln = "Element";
715cdf0e10cSrcweir             break;
716cdf0e10cSrcweir 
717cdf0e10cSrcweir         case css::rdf::URIs::ODF_CONTENTFILE:
718cdf0e10cSrcweir             ns = s_nsODF;
719cdf0e10cSrcweir             ln = "ContentFile";
720cdf0e10cSrcweir             break;
721cdf0e10cSrcweir 
722cdf0e10cSrcweir         case css::rdf::URIs::ODF_STYLESFILE:
723cdf0e10cSrcweir             ns = s_nsODF;
724cdf0e10cSrcweir             ln = "StylesFile";
725cdf0e10cSrcweir             break;
726cdf0e10cSrcweir 
727cdf0e10cSrcweir /* REMOVED
728cdf0e10cSrcweir         case css::rdf::URIs::ODF_METADATAFILE:
729cdf0e10cSrcweir             ns = s_nsODF;
730cdf0e10cSrcweir             ln = "MetadataFile";
731cdf0e10cSrcweir             break;
732cdf0e10cSrcweir */
733cdf0e10cSrcweir 
734cdf0e10cSrcweir         default:
735cdf0e10cSrcweir             throw css::lang::IllegalArgumentException(
736cdf0e10cSrcweir                 ::rtl::OUString::createFromAscii("CURI::initialize: "
737cdf0e10cSrcweir                     "invalid URIs constant argument"), *this, 0);
738cdf0e10cSrcweir     }
739cdf0e10cSrcweir     m_Namespace = ::rtl::OUString::createFromAscii(ns).intern();
740cdf0e10cSrcweir     m_LocalName = ::rtl::OUString::createFromAscii(ln).intern();
741cdf0e10cSrcweir     return;
742cdf0e10cSrcweir }
743cdf0e10cSrcweir 
744cdf0e10cSrcweir // ::com::sun::star::lang::XInitialization:
initialize(const css::uno::Sequence<::com::sun::star::uno::Any> & aArguments)745cdf0e10cSrcweir void SAL_CALL CURI::initialize(const css::uno::Sequence< ::com::sun::star::uno::Any > & aArguments) throw (css::uno::RuntimeException, css::uno::Exception)
746cdf0e10cSrcweir {
747cdf0e10cSrcweir     sal_Int32 len = aArguments.getLength();
748cdf0e10cSrcweir     if ((len < 1) || (len > 2)) {
749cdf0e10cSrcweir         throw css::lang::IllegalArgumentException(
750cdf0e10cSrcweir             ::rtl::OUString::createFromAscii("CURI::initialize: "
751cdf0e10cSrcweir                 "must give 1 or 2 argument(s)"), *this, 2);
752cdf0e10cSrcweir     }
753cdf0e10cSrcweir 
754cdf0e10cSrcweir     sal_Int16 arg(0);
755cdf0e10cSrcweir     ::rtl::OUString arg0;
756cdf0e10cSrcweir     ::rtl::OUString arg1;
757cdf0e10cSrcweir     if ((aArguments[0] >>= arg)) {
758cdf0e10cSrcweir         // integer argument: constant from rdf::URIs
759cdf0e10cSrcweir         if (len != 1) {
760cdf0e10cSrcweir             throw css::lang::IllegalArgumentException(
761cdf0e10cSrcweir                 ::rtl::OUString::createFromAscii("CURI::initialize: "
762cdf0e10cSrcweir                     "must give 1 int argument"), *this, 1);
763cdf0e10cSrcweir         }
764cdf0e10cSrcweir         initFromConstant(arg);
765cdf0e10cSrcweir         return;
766cdf0e10cSrcweir     }
767cdf0e10cSrcweir     if (!(aArguments[0] >>= arg0)) {
768cdf0e10cSrcweir         throw css::lang::IllegalArgumentException(
769cdf0e10cSrcweir             ::rtl::OUString::createFromAscii("CURI::initialize: "
770cdf0e10cSrcweir                 "argument must be string or short"), *this, 0);
771cdf0e10cSrcweir     }
772cdf0e10cSrcweir     if (len > 1) {
773cdf0e10cSrcweir         if (!(aArguments[1] >>= arg1)) {
774cdf0e10cSrcweir             throw css::lang::IllegalArgumentException(
775cdf0e10cSrcweir                 ::rtl::OUString::createFromAscii("CURI::initialize: "
776cdf0e10cSrcweir                     "argument must be string"), *this, 1);
777cdf0e10cSrcweir         }
778cdf0e10cSrcweir         // just append the parameters and then split them again; seems simplest
779cdf0e10cSrcweir         arg0 = arg0 + arg1;
780cdf0e10cSrcweir         arg1 = ::rtl::OUString();
781cdf0e10cSrcweir     }
782cdf0e10cSrcweir 
783cdf0e10cSrcweir     // split parameter
784cdf0e10cSrcweir     sal_Int32 idx;
785cdf0e10cSrcweir     if (    ((idx = arg0.indexOf    ('#')) >= 0)
786cdf0e10cSrcweir         ||  ((idx = arg0.lastIndexOf('/')) >= 0)
787cdf0e10cSrcweir         ||  ((idx = arg0.lastIndexOf(':')) >= 0))
788cdf0e10cSrcweir     {
789cdf0e10cSrcweir 
790cdf0e10cSrcweir         if (idx < arg0.getLength() - 1) {
791cdf0e10cSrcweir             arg1 = arg0.copy(idx+1);
792cdf0e10cSrcweir             arg0 = arg0.copy(0, idx+1);
793cdf0e10cSrcweir         }
794cdf0e10cSrcweir     } else {
795cdf0e10cSrcweir         throw css::lang::IllegalArgumentException(
796cdf0e10cSrcweir             ::rtl::OUString::createFromAscii("CURI::initialize: "
797cdf0e10cSrcweir                 "argument not splittable: no separator [#/:]"), *this, 0);
798cdf0e10cSrcweir     }
799cdf0e10cSrcweir 
800cdf0e10cSrcweir     //FIXME: what is legal?
801cdf0e10cSrcweir     if (arg0.getLength() > 0) {
802cdf0e10cSrcweir         m_Namespace = arg0;
803cdf0e10cSrcweir     } else {
804cdf0e10cSrcweir         throw css::lang::IllegalArgumentException(
805cdf0e10cSrcweir             ::rtl::OUString::createFromAscii("CURI::initialize: "
806cdf0e10cSrcweir                 "argument is not valid namespace"), *this, 0);
807cdf0e10cSrcweir     }
808cdf0e10cSrcweir     //FIXME: what is legal?
809cdf0e10cSrcweir     if (true) {
810cdf0e10cSrcweir         m_LocalName = arg1;
811cdf0e10cSrcweir     } else {
812cdf0e10cSrcweir         throw css::lang::IllegalArgumentException(
813cdf0e10cSrcweir             ::rtl::OUString::createFromAscii("CURI::initialize: "
814cdf0e10cSrcweir                 "argument is not valid local name"), *this, 1);
815cdf0e10cSrcweir     }
816cdf0e10cSrcweir }
817cdf0e10cSrcweir 
818cdf0e10cSrcweir // ::com::sun::star::rdf::XNode:
getStringValue()819cdf0e10cSrcweir ::rtl::OUString SAL_CALL CURI::getStringValue() throw (css::uno::RuntimeException)
820cdf0e10cSrcweir {
821cdf0e10cSrcweir     return m_Namespace + m_LocalName;
822cdf0e10cSrcweir }
823cdf0e10cSrcweir 
824cdf0e10cSrcweir // ::com::sun::star::rdf::XURI:
getNamespace()825cdf0e10cSrcweir ::rtl::OUString SAL_CALL CURI::getNamespace() throw (css::uno::RuntimeException)
826cdf0e10cSrcweir {
827cdf0e10cSrcweir     return m_Namespace;
828cdf0e10cSrcweir }
829cdf0e10cSrcweir 
getLocalName()830cdf0e10cSrcweir ::rtl::OUString SAL_CALL CURI::getLocalName() throw (css::uno::RuntimeException)
831cdf0e10cSrcweir {
832cdf0e10cSrcweir     return m_LocalName;
833cdf0e10cSrcweir }
834cdf0e10cSrcweir 
835cdf0e10cSrcweir } // closing anonymous implementation namespace
836cdf0e10cSrcweir 
837cdf0e10cSrcweir 
838cdf0e10cSrcweir 
839cdf0e10cSrcweir // component helper namespace
840cdf0e10cSrcweir namespace comp_CURI {
841cdf0e10cSrcweir 
_getImplementationName()842cdf0e10cSrcweir ::rtl::OUString SAL_CALL _getImplementationName() {
843cdf0e10cSrcweir     return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
844cdf0e10cSrcweir         "CURI"));
845cdf0e10cSrcweir }
846cdf0e10cSrcweir 
_getSupportedServiceNames()847cdf0e10cSrcweir css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
848cdf0e10cSrcweir {
849cdf0e10cSrcweir     css::uno::Sequence< ::rtl::OUString > s(1);
850cdf0e10cSrcweir     s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
851cdf0e10cSrcweir         "com.sun.star.rdf.URI"));
852cdf0e10cSrcweir     return s;
853cdf0e10cSrcweir }
854cdf0e10cSrcweir 
_create(const css::uno::Reference<css::uno::XComponentContext> & context)855cdf0e10cSrcweir css::uno::Reference< css::uno::XInterface > SAL_CALL _create(
856cdf0e10cSrcweir     const css::uno::Reference< css::uno::XComponentContext > & context)
857cdf0e10cSrcweir         SAL_THROW((css::uno::Exception))
858cdf0e10cSrcweir {
859cdf0e10cSrcweir     return static_cast< ::cppu::OWeakObject * >(new CURI(context));
860cdf0e10cSrcweir }
861cdf0e10cSrcweir 
862cdf0e10cSrcweir } // closing component helper namespace
863cdf0e10cSrcweir 
864