convert codemaker::cpp::IdentifierTranslationMode to scoped enum
Change-Id: I17f7a2f8f89166c5a51be4ee15986d21f1cb24b3
This commit is contained in:
@@ -169,7 +169,7 @@ OString translateUnoToCppIdentifier(
|
|||||||
|| unoIdentifier == "xor"
|
|| unoIdentifier == "xor"
|
||||||
/* unoIdentifier == "xor_eq" */
|
/* unoIdentifier == "xor_eq" */
|
||||||
// Standard macros:
|
// Standard macros:
|
||||||
|| (transmode != ITM_KEYWORDSONLY
|
|| (transmode != IdentifierTranslationMode::KeywordsOnly
|
||||||
&& (unoIdentifier == "BUFSIZ"
|
&& (unoIdentifier == "BUFSIZ"
|
||||||
|| unoIdentifier == "CLOCKS_PER_SEC"
|
|| unoIdentifier == "CLOCKS_PER_SEC"
|
||||||
|| unoIdentifier == "EDOM"
|
|| unoIdentifier == "EDOM"
|
||||||
@@ -265,7 +265,7 @@ OString translateUnoToCppIdentifier(
|
|||||||
|| unoIdentifier == "UINT_MAX"
|
|| unoIdentifier == "UINT_MAX"
|
||||||
|| unoIdentifier == "ULONG_MAX"
|
|| unoIdentifier == "ULONG_MAX"
|
||||||
|| unoIdentifier == "USHRT_MAX"))
|
|| unoIdentifier == "USHRT_MAX"))
|
||||||
|| (transmode == ITM_GLOBAL
|
|| (transmode == IdentifierTranslationMode::Global
|
||||||
&& (// Standard types:
|
&& (// Standard types:
|
||||||
/* unoIdentifier == "clock_t" */
|
/* unoIdentifier == "clock_t" */
|
||||||
/* unoIdentifier == "div_t" */
|
/* unoIdentifier == "div_t" */
|
||||||
|
@@ -618,7 +618,7 @@ void CppuType::dumpLightGetCppuType(FileStream & out) {
|
|||||||
|
|
||||||
codemaker::cpp::IdentifierTranslationMode CppuType::isGlobal() const {
|
codemaker::cpp::IdentifierTranslationMode CppuType::isGlobal() const {
|
||||||
return name_.indexOf('.') == -1
|
return name_.indexOf('.') == -1
|
||||||
? codemaker::cpp::ITM_GLOBAL : codemaker::cpp::ITM_NONGLOBAL;
|
? codemaker::cpp::IdentifierTranslationMode::Global : codemaker::cpp::IdentifierTranslationMode::NonGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_uInt32 CppuType::getInheritedMemberCount()
|
sal_uInt32 CppuType::getInheritedMemberCount()
|
||||||
@@ -3518,7 +3518,7 @@ void ServiceType::dumpHppFile(
|
|||||||
o << indent() << "static ::css::uno::Reference< "
|
o << indent() << "static ::css::uno::Reference< "
|
||||||
<< scopedBaseName << " > "
|
<< scopedBaseName << " > "
|
||||||
<< codemaker::cpp::translateUnoToCppIdentifier(
|
<< codemaker::cpp::translateUnoToCppIdentifier(
|
||||||
"create", "method", codemaker::cpp::ITM_NONGLOBAL,
|
"create", "method", codemaker::cpp::IdentifierTranslationMode::NonGlobal,
|
||||||
&cppName)
|
&cppName)
|
||||||
<< ("(::css::uno::Reference< ::css::uno::XComponentContext > const &"
|
<< ("(::css::uno::Reference< ::css::uno::XComponentContext > const &"
|
||||||
" the_context) {\n");
|
" the_context) {\n");
|
||||||
@@ -3576,7 +3576,7 @@ void ServiceType::dumpHppFile(
|
|||||||
o << indent() << "static ::css::uno::Reference< "
|
o << indent() << "static ::css::uno::Reference< "
|
||||||
<< scopedBaseName << " > "
|
<< scopedBaseName << " > "
|
||||||
<< codemaker::cpp::translateUnoToCppIdentifier(
|
<< codemaker::cpp::translateUnoToCppIdentifier(
|
||||||
u2b(cons.name), "method", codemaker::cpp::ITM_NONGLOBAL,
|
u2b(cons.name), "method", codemaker::cpp::IdentifierTranslationMode::NonGlobal,
|
||||||
&cppName)
|
&cppName)
|
||||||
<< ("(::css::uno::Reference< ::css::uno::XComponentContext > const &"
|
<< ("(::css::uno::Reference< ::css::uno::XComponentContext > const &"
|
||||||
" the_context");
|
" the_context");
|
||||||
@@ -3595,7 +3595,7 @@ void ServiceType::dumpHppFile(
|
|||||||
dumpType(o, type, byRef, byRef);
|
dumpType(o, type, byRef, byRef);
|
||||||
o << " "
|
o << " "
|
||||||
<< codemaker::cpp::translateUnoToCppIdentifier(
|
<< codemaker::cpp::translateUnoToCppIdentifier(
|
||||||
u2b(param.name), "param", codemaker::cpp::ITM_NONGLOBAL);
|
u2b(param.name), "param", codemaker::cpp::IdentifierTranslationMode::NonGlobal);
|
||||||
}
|
}
|
||||||
o << ") {\n";
|
o << ") {\n";
|
||||||
inc();
|
inc();
|
||||||
@@ -3614,7 +3614,7 @@ void ServiceType::dumpHppFile(
|
|||||||
OString param(
|
OString param(
|
||||||
codemaker::cpp::translateUnoToCppIdentifier(
|
codemaker::cpp::translateUnoToCppIdentifier(
|
||||||
u2b(j.name), "param",
|
u2b(j.name), "param",
|
||||||
codemaker::cpp::ITM_NONGLOBAL));
|
codemaker::cpp::IdentifierTranslationMode::NonGlobal));
|
||||||
sal_Int32 rank;
|
sal_Int32 rank;
|
||||||
if (m_typeMgr->getSort(
|
if (m_typeMgr->getSort(
|
||||||
b2u(codemaker::UnoType::decompose(
|
b2u(codemaker::UnoType::decompose(
|
||||||
@@ -3664,7 +3664,7 @@ void ServiceType::dumpHppFile(
|
|||||||
if (rest) {
|
if (rest) {
|
||||||
o << codemaker::cpp::translateUnoToCppIdentifier(
|
o << codemaker::cpp::translateUnoToCppIdentifier(
|
||||||
u2b(cons.parameters.back().name), "param",
|
u2b(cons.parameters.back().name), "param",
|
||||||
codemaker::cpp::ITM_NONGLOBAL);
|
codemaker::cpp::IdentifierTranslationMode::NonGlobal);
|
||||||
} else if (cons.parameters.empty()) {
|
} else if (cons.parameters.empty()) {
|
||||||
o << "::css::uno::Sequence< ::css::uno::Any >()";
|
o << "::css::uno::Sequence< ::css::uno::Any >()";
|
||||||
} else {
|
} else {
|
||||||
@@ -3691,7 +3691,7 @@ void ServiceType::dumpHppFile(
|
|||||||
if (rest) {
|
if (rest) {
|
||||||
o << codemaker::cpp::translateUnoToCppIdentifier(
|
o << codemaker::cpp::translateUnoToCppIdentifier(
|
||||||
u2b(cons.parameters.back().name), "param",
|
u2b(cons.parameters.back().name), "param",
|
||||||
codemaker::cpp::ITM_NONGLOBAL);
|
codemaker::cpp::IdentifierTranslationMode::NonGlobal);
|
||||||
} else if (cons.parameters.empty()) {
|
} else if (cons.parameters.empty()) {
|
||||||
o << ("::css::uno::Sequence< ::css::uno::Any >()");
|
o << ("::css::uno::Sequence< ::css::uno::Any >()");
|
||||||
} else {
|
} else {
|
||||||
@@ -3815,7 +3815,7 @@ void SingletonType::dumpHppFile(
|
|||||||
o << indent() << "static ::css::uno::Reference< "
|
o << indent() << "static ::css::uno::Reference< "
|
||||||
<< scopedBaseName << " > "
|
<< scopedBaseName << " > "
|
||||||
<< codemaker::cpp::translateUnoToCppIdentifier(
|
<< codemaker::cpp::translateUnoToCppIdentifier(
|
||||||
"get", "method", codemaker::cpp::ITM_NONGLOBAL, &cppName)
|
"get", "method", codemaker::cpp::IdentifierTranslationMode::NonGlobal, &cppName)
|
||||||
<< ("(::css::uno::Reference<"
|
<< ("(::css::uno::Reference<"
|
||||||
" ::css::uno::XComponentContext > const & the_context)"
|
" ::css::uno::XComponentContext > const & the_context)"
|
||||||
" {\n");
|
" {\n");
|
||||||
|
@@ -45,15 +45,15 @@ rtl::OString scopedCppName(rtl::OString const & type, bool ns_alias=true);
|
|||||||
rtl::OString translateUnoToCppType(
|
rtl::OString translateUnoToCppType(
|
||||||
codemaker::UnoType::Sort sort, rtl::OUString const & nucleus);
|
codemaker::UnoType::Sort sort, rtl::OUString const & nucleus);
|
||||||
|
|
||||||
enum IdentifierTranslationMode {
|
enum class IdentifierTranslationMode {
|
||||||
ITM_GLOBAL,
|
Global,
|
||||||
ITM_NONGLOBAL,
|
NonGlobal,
|
||||||
ITM_KEYWORDSONLY
|
KeywordsOnly
|
||||||
};
|
};
|
||||||
|
|
||||||
rtl::OString translateUnoToCppIdentifier(
|
rtl::OString translateUnoToCppIdentifier(
|
||||||
rtl::OString const & identifier, rtl::OString const & prefix,
|
rtl::OString const & identifier, rtl::OString const & prefix,
|
||||||
IdentifierTranslationMode transmode = ITM_GLOBAL,
|
IdentifierTranslationMode transmode = IdentifierTranslationMode::Global,
|
||||||
rtl::OString const * forbidden = nullptr);
|
rtl::OString const * forbidden = nullptr);
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
Reference in New Issue
Block a user