LibreOffice
LibreOffice 4.4 SDK C/C++ API Reference
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
rtl
uri.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
5
* This Source Code Form is subject to the terms of the Mozilla Public
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
7
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
11
* Licensed to the Apache Software Foundation (ASF) under one or more
12
* contributor license agreements. See the NOTICE file distributed
13
* with this work for additional information regarding copyright
14
* ownership. The ASF licenses this file to you under the Apache
15
* License, Version 2.0 (the "License"); you may not use this file
16
* except in compliance with the License. You may obtain a copy of
17
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
*/
19
20
#ifndef INCLUDED_RTL_URI_HXX
21
#define INCLUDED_RTL_URI_HXX
22
23
#include <
rtl/malformeduriexception.hxx
>
24
#include <
rtl/uri.h
>
25
#include <
rtl/textenc.h
>
26
#include <
rtl/ustring.hxx
>
27
#include <
sal/types.h
>
28
29
namespace
rtl {
30
33
class
Uri
34
{
35
public
:
39
static
inline
rtl::OUString
encode
(
rtl::OUString
const
& rText,
40
sal_Bool
const
* pCharClass,
41
rtl_UriEncodeMechanism
eMechanism,
42
rtl_TextEncoding
eCharset);
43
47
static
inline
rtl::OUString
encode
(
rtl::OUString
const
& rText,
48
rtl_UriCharClass
eCharClass,
49
rtl_UriEncodeMechanism
eMechanism,
50
rtl_TextEncoding
eCharset);
51
54
static
inline
rtl::OUString
decode
(
rtl::OUString
const
& rText,
55
rtl_UriDecodeMechanism
eMechanism,
56
rtl_TextEncoding
eCharset);
57
64
static
inline
rtl::OUString
convertRelToAbs
(
65
rtl::OUString
const
& rBaseUriRef,
rtl::OUString
const
& rRelUriRef);
66
67
private
:
69
Uri
();
70
72
Uri
(
Uri
&);
73
75
~
Uri
();
76
78
void
operator =(
Uri
);
79
};
80
81
inline
rtl::OUString
Uri::encode
(
rtl::OUString
const
& rText,
82
sal_Bool
const
* pCharClass,
83
rtl_UriEncodeMechanism
eMechanism,
84
rtl_TextEncoding
eCharset)
85
{
86
rtl::OUString
aResult;
87
rtl_uriEncode
(const_cast< rtl::OUString & >(rText).pData,
88
pCharClass,
89
eMechanism,
90
eCharset,
91
&aResult.pData);
92
return
aResult;
93
}
94
95
inline
rtl::OUString
Uri::encode
(
rtl::OUString
const
& rText,
96
rtl_UriCharClass
eCharClass,
97
rtl_UriEncodeMechanism
eMechanism,
98
rtl_TextEncoding
eCharset)
99
{
100
rtl::OUString
aResult;
101
rtl_uriEncode
(const_cast< rtl::OUString & >(rText).pData,
102
rtl_getUriCharClass
(eCharClass),
103
eMechanism,
104
eCharset,
105
&aResult.pData);
106
return
aResult;
107
}
108
109
inline
rtl::OUString
Uri::decode
(
rtl::OUString
const
& rText,
110
rtl_UriDecodeMechanism
eMechanism,
111
rtl_TextEncoding
eCharset)
112
{
113
rtl::OUString
aResult;
114
rtl_uriDecode
(const_cast< rtl::OUString & >(rText).pData,
115
eMechanism,
116
eCharset,
117
&aResult.pData);
118
return
aResult;
119
}
120
121
inline
rtl::OUString
Uri::convertRelToAbs
(
rtl::OUString
const
& rBaseUriRef,
122
rtl::OUString
const
& rRelUriRef)
123
{
124
rtl::OUString
aResult;
125
rtl::OUString
aException;
126
if
(!
rtl_uriConvertRelToAbs
(
127
const_cast< rtl::OUString & >(rBaseUriRef).pData,
128
const_cast< rtl::OUString & >(rRelUriRef).pData, &aResult.pData,
129
&aException.pData))
130
throw
MalformedUriException
(aException);
131
return
aResult;
132
}
133
134
}
135
136
#endif // INCLUDED_RTL_URI_HXX
137
138
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Generated on Thu Oct 1 2015 21:39:50 for LibreOffice by
1.8.4