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 .
22 #include <rtl/ustring.hxx>
24 #include <connectivity/dbtoolsdllapi.hxx>
25 #include <unotools/resmgr.hxx>
27 namespace connectivity
31 typedef sal_uInt16 ResourceId
;
33 /** helper class for accessing resources shared by different libraries
34 in the connectivity module
36 class OOO_DLLPUBLIC_DBTOOLS SharedResources
42 /** loads a string from the shared resource file
44 the resource ID of the string
46 the string from the resource file
53 /** loads a string from the shared resource file, and replaces
54 a given ASCII pattern with a given string
57 the resource ID of the string to load
58 @param _pAsciiPatternToReplace
59 the ASCII string which is to search in the string. Must not be <NULL/>.
60 @param _rStringToSubstitute
61 the String which should substitute the ASCII pattern.
64 the string from the resource file, with applied string substitution
67 getResourceStringWithSubstitution(
69 const char* _pAsciiPatternToReplace
,
70 const OUString
& _rStringToSubstitute
73 /** loads a string from the shared resource file, and replaces
74 a given ASCII pattern with a given string
77 the resource ID of the string to load
78 @param _pAsciiPatternToReplace1
79 the ASCII string (1) which is to search in the string. Must not be <NULL/>.
80 @param _rStringToSubstitute1
81 the String which should substitute the ASCII pattern (1)
82 @param _pAsciiPatternToReplace2
83 the ASCII string (2) which is to search in the string. Must not be <NULL/>.
84 @param _rStringToSubstitute2
85 the String which should substitute the ASCII pattern (2)
88 the string from the resource file, with applied string substitution
91 getResourceStringWithSubstitution(
93 const char* _pAsciiPatternToReplace1
,
94 const OUString
& _rStringToSubstitute1
,
95 const char* _pAsciiPatternToReplace2
,
96 const OUString
& _rStringToSubstitute2
99 /** loads a string from the shared resource file, and replaces
100 a given ASCII pattern with a given string
103 the resource ID of the string to load
104 @param _pAsciiPatternToReplace1
105 the ASCII string (1) which is to search in the string. Must not be <NULL/>.
106 @param _rStringToSubstitute1
107 the String which should substitute the ASCII pattern (1)
108 @param _pAsciiPatternToReplace2
109 the ASCII string (2) which is to search in the string. Must not be <NULL/>.
110 @param _rStringToSubstitute2
111 the String which should substitute the ASCII pattern (2)
112 @param _pAsciiPatternToReplace3
113 the ASCII string (3) which is to search in the string. Must not be <NULL/>.
114 @param _rStringToSubstitute3
115 the String which should substitute the ASCII pattern (3)
118 the string from the resource file, with applied string substitution
121 getResourceStringWithSubstitution(
123 const char* _pAsciiPatternToReplace1
,
124 const OUString
& _rStringToSubstitute1
,
125 const char* _pAsciiPatternToReplace2
,
126 const OUString
& _rStringToSubstitute2
,
127 const char* _pAsciiPatternToReplace3
,
128 const OUString
& _rStringToSubstitute3
131 /** loads a string from the shared resource file, and replaces a given ASCII pattern with a given string
134 the resource ID of the string to load
135 @param _aStringToSubstitutes
136 A list of substitutions.
139 the string from the resource file, with applied string substitution
141 OUString
getResourceStringWithSubstitution( TranslateId pResId
,
142 const std::vector
< std::pair
<const char* , OUString
> >& _rStringToSubstitutes
) const;
146 } // namespace connectivity
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */