xref: /trunk/main/cppu/inc/cppu/EnvDcp.hxx (revision c059a6bf)
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_cppu_EnvDcp_hxx
25 #define INCLUDED_cppu_EnvDcp_hxx
26 
27 #include "rtl/ustring.hxx"
28 #include "uno/EnvDcp.h"
29 
30 
31 namespace cppu
32 {
33 namespace EnvDcp
34 {
35 /** Get the OBI type part of an environment descriptor.
36 	(https://wiki.openoffice.org/wiki/Uno/Cpp/Spec/Environment_Descriptor)
37 
38 	@param  rEnvDcp        the Environment Descriptor
39 	@return                the OBI type
40 	@since UDK 3.2.7
41 */
getTypeName(rtl::OUString const & rEnvDcp)42 inline rtl::OUString getTypeName(rtl::OUString const & rEnvDcp)
43 {
44 	rtl::OUString typeName;
45 
46 	uno_EnvDcp_getTypeName(rEnvDcp.pData, &typeName.pData);
47 
48 	return typeName;
49 }
50 
51 /** Get the purpose part of an environment descriptor.
52 	(https://wiki.openoffice.org/wiki/Uno/Binary/Spec/Environment_Descriptor)
53 
54 	@param  rEnvDcp        the Environment Descriptor
55 	@return                the purpose
56 	@since UDK 3.2.7
57 */
getPurpose(rtl::OUString const & rEnvDcp)58 inline rtl::OUString getPurpose(rtl::OUString const & rEnvDcp)
59 {
60 	rtl::OUString purpose;
61 
62 	uno_EnvDcp_getPurpose(rEnvDcp.pData, &purpose.pData);
63 
64 	return purpose;
65 }
66 
67 }
68 }
69 
70 #endif
71