1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_RESOURCE_SHAREDRESOURCES_HXX
21 #define INCLUDED_CONNECTIVITY_SOURCE_INC_RESOURCE_SHAREDRESOURCES_HXX
23 #include <rtl/ustring.hxx>
25 #include <connectivity/dbtoolsdllapi.hxx>
28 namespace connectivity
32 typedef sal_uInt16 ResourceId
;
34 /** helper class for accessing resources shared by different libraries
35 in the connectivity module
37 class OOO_DLLPUBLIC_DBTOOLS SharedResources
43 /** loads a string from the shared resource file
45 the resource ID of the string
47 the string from the resource file
54 /** loads a string from the shared resource file, and replaces
55 a given ASCII pattern with a given string
58 the resource ID of the string to load
59 @param _pAsciiPatternToReplace
60 the ASCII string which is to search in the string. Must not be <NULL/>.
61 @param _rStringToSubstitute
62 the String which should substitute the ASCII pattern.
65 the string from the resource file, with applied string substitution
68 getResourceStringWithSubstitution(
70 const sal_Char
* _pAsciiPatternToReplace
,
71 const OUString
& _rStringToSubstitute
74 /** loads a string from the shared resource file, and replaces
75 a given ASCII pattern with a given string
78 the resource ID of the string to load
79 @param _pAsciiPatternToReplace1
80 the ASCII string (1) which is to search in the string. Must not be <NULL/>.
81 @param _rStringToSubstitute1
82 the String which should substitute the ASCII pattern (1)
83 @param _pAsciiPatternToReplace2
84 the ASCII string (2) which is to search in the string. Must not be <NULL/>.
85 @param _rStringToSubstitute2
86 the String which should substitute the ASCII pattern (2)
89 the string from the resource file, with applied string substitution
92 getResourceStringWithSubstitution(
94 const sal_Char
* _pAsciiPatternToReplace1
,
95 const OUString
& _rStringToSubstitute1
,
96 const sal_Char
* _pAsciiPatternToReplace2
,
97 const OUString
& _rStringToSubstitute2
100 /** loads a string from the shared resource file, and replaces
101 a given ASCII pattern with a given string
104 the resource ID of the string to load
105 @param _pAsciiPatternToReplace1
106 the ASCII string (1) which is to search in the string. Must not be <NULL/>.
107 @param _rStringToSubstitute1
108 the String which should substitute the ASCII pattern (1)
109 @param _pAsciiPatternToReplace2
110 the ASCII string (2) which is to search in the string. Must not be <NULL/>.
111 @param _rStringToSubstitute2
112 the String which should substitute the ASCII pattern (2)
113 @param _pAsciiPatternToReplace3
114 the ASCII string (3) which is to search in the string. Must not be <NULL/>.
115 @param _rStringToSubstitute3
116 the String which should substitute the ASCII pattern (3)
119 the string from the resource file, with applied string substitution
122 getResourceStringWithSubstitution(
124 const sal_Char
* _pAsciiPatternToReplace1
,
125 const OUString
& _rStringToSubstitute1
,
126 const sal_Char
* _pAsciiPatternToReplace2
,
127 const OUString
& _rStringToSubstitute2
,
128 const sal_Char
* _pAsciiPatternToReplace3
,
129 const OUString
& _rStringToSubstitute3
132 /** loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
135 the resource ID of the string to load
136 @param _aStringToSubstitutes
137 A list of substitutions.
140 the string from the resource file, with applied string substitution
142 OUString
getResourceStringWithSubstitution( ResourceId _nResId
,
143 const ::std::list
< ::std::pair
<const sal_Char
* , OUString
> >& _rStringToSubstitutes
) const;
147 } // namespace connectivity
150 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_RESOURCE_SHAREDRESOURCES_HXX
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */