28#include <rtl/strbuf.hxx>
29#include <rtl/string.hxx>
30#include <rtl/ustring.hxx>
41 sal_Int32
nPos =
type.lastIndexOf( c );
50 OStringBuffer tmpBuf(
type.getLength()*2);
55 }
while(
nPos != -1 );
57 OString s(tmpBuf.makeStringAndClear());
58 if (ns_alias && s.startsWith(
"::com::sun::star::", &s))
72 "void",
"::sal_Bool",
"::sal_Int8",
"::sal_Int16",
"::sal_uInt16",
73 "::sal_Int32",
"::sal_uInt32",
"::sal_Int64",
"::sal_uInt64",
74 "float",
"double",
"::sal_Unicode",
"rtl::OUString",
75 "::css::uno::Type",
"::css::uno::Any" };
76 buf.append(cppTypes[
static_cast<int>(sort)]);
79 && nucleus ==
u"com.sun.star.uno.XInterface")
81 buf.append(
"::css::uno::XInterface");
84 buf.append(
u2b(nucleus));
87 return buf.makeStringAndClear();
91 OString
const & unoIdentifier, std::string_view prefix,
95 unoIdentifier ==
"asm"
96 || unoIdentifier ==
"auto"
97 || unoIdentifier ==
"bool"
98 || unoIdentifier ==
"break"
99 || unoIdentifier ==
"case"
100 || unoIdentifier ==
"catch"
101 || unoIdentifier ==
"char"
102 || unoIdentifier ==
"class"
103 || unoIdentifier ==
"const"
105 || unoIdentifier ==
"continue"
106 || unoIdentifier ==
"default"
107 || unoIdentifier ==
"delete"
108 || unoIdentifier ==
"do"
109 || unoIdentifier ==
"double"
111 || unoIdentifier ==
"else"
112 || unoIdentifier ==
"enum"
113 || unoIdentifier ==
"explicit"
114 || unoIdentifier ==
"export"
115 || unoIdentifier ==
"extern"
116 || unoIdentifier ==
"false"
117 || unoIdentifier ==
"float"
118 || unoIdentifier ==
"for"
119 || unoIdentifier ==
"friend"
120 || unoIdentifier ==
"goto"
121 || unoIdentifier ==
"if"
122 || unoIdentifier ==
"inline"
123 || unoIdentifier ==
"int"
124 || unoIdentifier ==
"long"
125 || unoIdentifier ==
"mutable"
126 || unoIdentifier ==
"namespace"
127 || unoIdentifier ==
"new"
128 || unoIdentifier ==
"operator"
129 || unoIdentifier ==
"private"
130 || unoIdentifier ==
"protected"
131 || unoIdentifier ==
"public"
132 || unoIdentifier ==
"register"
134 || unoIdentifier ==
"return"
135 || unoIdentifier ==
"short"
136 || unoIdentifier ==
"signed"
137 || unoIdentifier ==
"sizeof"
138 || unoIdentifier ==
"static"
140 || unoIdentifier ==
"struct"
141 || unoIdentifier ==
"switch"
142 || unoIdentifier ==
"template"
143 || unoIdentifier ==
"this"
144 || unoIdentifier ==
"throw"
145 || unoIdentifier ==
"true"
146 || unoIdentifier ==
"try"
147 || unoIdentifier ==
"typedef"
148 || unoIdentifier ==
"typeid"
149 || unoIdentifier ==
"typename"
150 || unoIdentifier ==
"union"
151 || unoIdentifier ==
"unsigned"
152 || unoIdentifier ==
"using"
153 || unoIdentifier ==
"virtual"
154 || unoIdentifier ==
"void"
155 || unoIdentifier ==
"volatile"
157 || unoIdentifier ==
"while"
159 || unoIdentifier ==
"and"
161 || unoIdentifier ==
"bitand"
162 || unoIdentifier ==
"bitor"
163 || unoIdentifier ==
"compl"
164 || unoIdentifier ==
"not"
166 || unoIdentifier ==
"or"
168 || unoIdentifier ==
"xor"
171 || (unoIdentifier ==
"BUFSIZ"
172 || unoIdentifier ==
"CLOCKS_PER_SEC"
173 || unoIdentifier ==
"EDOM"
174 || unoIdentifier ==
"EOF"
175 || unoIdentifier ==
"ERANGE"
176 || unoIdentifier ==
"EXIT_FAILURE"
177 || unoIdentifier ==
"EXIT_SUCCESS"
178 || unoIdentifier ==
"FILENAME_MAX"
179 || unoIdentifier ==
"FOPEN_MAX"
180 || unoIdentifier ==
"HUGE_VAL"
181 || unoIdentifier ==
"LC_ALL"
182 || unoIdentifier ==
"LC_COLLATE"
183 || unoIdentifier ==
"LC_CTYPE"
184 || unoIdentifier ==
"LC_MONETARY"
185 || unoIdentifier ==
"LC_NUMERIC"
186 || unoIdentifier ==
"LC_TIME"
187 || unoIdentifier ==
"L_tmpnam"
188 || unoIdentifier ==
"MB_CUR_MAX"
189 || unoIdentifier ==
"NULL"
190 || unoIdentifier ==
"RAND_MAX"
191 || unoIdentifier ==
"SEEK_CUR"
192 || unoIdentifier ==
"SEEK_END"
193 || unoIdentifier ==
"SEEK_SET"
194 || unoIdentifier ==
"SIGABRT"
195 || unoIdentifier ==
"SIGFPE"
196 || unoIdentifier ==
"SIGILL"
197 || unoIdentifier ==
"SIGINT"
198 || unoIdentifier ==
"SIGSEGV"
199 || unoIdentifier ==
"SIGTERM"
200 || unoIdentifier ==
"SIG_DFL"
201 || unoIdentifier ==
"SIG_ERR"
202 || unoIdentifier ==
"SIG_IGN"
203 || unoIdentifier ==
"TMP_MAX"
204 || unoIdentifier ==
"WCHAR_MAX"
205 || unoIdentifier ==
"WCHAR_MIN"
206 || unoIdentifier ==
"WEOF"
210 || unoIdentifier ==
"assert"
211 || unoIdentifier ==
"errno"
212 || unoIdentifier ==
"offsetof"
213 || unoIdentifier ==
"setjmp"
214 || unoIdentifier ==
"stderr"
215 || unoIdentifier ==
"stdin"
216 || unoIdentifier ==
"stdout"
221 || unoIdentifier ==
"CHAR_BIT"
222 || unoIdentifier ==
"CHAR_MAX"
223 || unoIdentifier ==
"CHAR_MIN"
224 || unoIdentifier ==
"DBL_DIG"
225 || unoIdentifier ==
"DBL_EPSILON"
226 || unoIdentifier ==
"DBL_MANT_DIG"
227 || unoIdentifier ==
"DBL_MAX"
228 || unoIdentifier ==
"DBL_MAX_10_EXP"
229 || unoIdentifier ==
"DBL_MAX_EXP"
230 || unoIdentifier ==
"DBL_MIN"
231 || unoIdentifier ==
"DBL_MIN_10_EXP"
232 || unoIdentifier ==
"DBL_MIN_EXP"
233 || unoIdentifier ==
"FLT_DIG"
234 || unoIdentifier ==
"FLT_EPSILON"
235 || unoIdentifier ==
"FLT_MANT_DIG"
236 || unoIdentifier ==
"FLT_MAX"
237 || unoIdentifier ==
"FLT_MAX_10_EXP"
238 || unoIdentifier ==
"FLT_MAX_EXP"
239 || unoIdentifier ==
"FLT_MIN"
240 || unoIdentifier ==
"FLT_MIN_10_EXP"
241 || unoIdentifier ==
"FLT_MIN_EXP"
242 || unoIdentifier ==
"FLT_RADIX"
243 || unoIdentifier ==
"FLT_ROUNDS"
244 || unoIdentifier ==
"INT_MAX"
245 || unoIdentifier ==
"INT_MIN"
246 || unoIdentifier ==
"LDBL_DIG"
247 || unoIdentifier ==
"LDBL_EPSILON"
248 || unoIdentifier ==
"LDBL_MANT_DIG"
249 || unoIdentifier ==
"LDBL_MAX"
250 || unoIdentifier ==
"LDBL_MAX_10_EXP"
251 || unoIdentifier ==
"LDBL_MAX_EXP"
252 || unoIdentifier ==
"LDBL_MIN"
253 || unoIdentifier ==
"LDBL_MIN_10_EXP"
254 || unoIdentifier ==
"LDBL_MIN_EXP"
255 || unoIdentifier ==
"LONG_MAX"
256 || unoIdentifier ==
"LONG_MIN"
257 || unoIdentifier ==
"MB_LEN_MAX"
258 || unoIdentifier ==
"SCHAR_MAX"
259 || unoIdentifier ==
"SCHAR_MIN"
260 || unoIdentifier ==
"SHRT_MAX"
261 || unoIdentifier ==
"SHRT_MIN"
262 || unoIdentifier ==
"UCHAR_MAX"
263 || unoIdentifier ==
"UINT_MAX"
264 || unoIdentifier ==
"ULONG_MAX"
265 || unoIdentifier ==
"USHRT_MAX")
270 unoIdentifier ==
"FILE"
273 || unoIdentifier ==
"lconv"
280 || unoIdentifier ==
"tm"
286 || unoIdentifier ==
"std"))
288 || unoIdentifier ==
"NDEBUG"
289 || (forbidden !=
nullptr && unoIdentifier == *forbidden) )
291 return OString::Concat(
prefix) +
"_" + unoIdentifier;
293 return unoIdentifier;
Sort
An enumeration of all the sorts of relevant UNOIDL entities.
IdentifierTranslationMode
OString translateUnoToCppIdentifier(OString const &unoIdentifier, std::string_view prefix, IdentifierTranslationMode transmode, OString const *forbidden)
OString translateUnoToCppType(codemaker::UnoType::Sort sort, std::u16string_view nucleus)
OString scopedCppName(OString const &type, bool ns_alias)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
OString u2b(std::u16string_view s)