29#include <rtl/ustrbuf.hxx>
35#include <com/sun/star/i18n/NumberFormatIndex.hpp>
36#include <com/sun/star/xml/sax/XAttributeList.hpp>
39#define LOCALE_VERSION_DTD "2.0.3"
41typedef ::o3tl::sorted_vector< OUString >
NameSet;
42typedef ::o3tl::sorted_vector< sal_Int16 >
ValueSet;
44namespace cssi = ::com::sun::star::i18n;
71 while ( (pParent = pParent->
parent) !=
nullptr )
94 if (
name ==
"LC_INFO" )
96 if (
name ==
"LC_CTYPE" )
98 if (
name ==
"LC_FORMAT" )
100 if (
name ==
"LC_FORMAT_1" )
102 if (
name ==
"LC_CALENDAR" )
104 if (
name ==
"LC_CURRENCY" )
106 if (
name ==
"LC_TRANSLITERATION" )
108 if (
name ==
"LC_COLLATION" )
110 if (
name ==
"LC_INDEX" )
112 if (
name ==
"LC_SEARCH" )
114 if (
name ==
"LC_MISC" )
116 if (
name ==
"LC_NumberingLevel" )
118 if (
name ==
"LC_OutLineNumberingLevel" )
128#define OSTR(s) (OUStringToOString( (s), RTL_TEXTENCODING_UTF8).getStr())
136 fprintf( stderr,
"Error: Locale versionDTD is not %s, see comment in locale.dtd\n",
LOCALE_VERSION_DTD);
145 const char* pParameterName,
const LocaleNode* pNode,
146 sal_Int32 nMinLen, sal_Int32 nMaxLen )
const
151 else if (nMinLen >= 0)
154 fprintf( stderr,
"Error: node NULL pointer for parameter %s.\n",
159 sal_Int32 nLen = aVal.getLength();
163 fprintf( stderr,
"Error: less than %" SAL_PRIdINT32
" character%s (%" SAL_PRIdINT32
") in %s '%s'.\n",
164 nMinLen, (nMinLen > 1 ?
"s" :
""),
169 else if (nLen > nMaxLen && nMaxLen >= 0)
173 "Error: more than %" SAL_PRIdINT32
" character%s (%" SAL_PRIdINT32
") in %s '%s' not supported by application.\n",
174 nMaxLen, (nMaxLen > 1 ?
"s" :
""),
183 const char* pNodeName,
const char* pParameterName,
184 sal_Int32 nMinLen, sal_Int32 nMaxLen )
const
188 if (pNode || nMinLen < 0)
193 fprintf( stderr,
"Error: node %s not found.\n", pNodeName);
203 fprintf( stderr,
"Error: %s\n", pStr);
214 fprintf( stderr, pStr, nVal);
220 fprintf( stderr, pStr,
OSTR( rVal));
226 fprintf(stderr, pStr,
OSTR(rVal1),
OSTR(rVal2));
241 if (aLanguage.getLength() != 2 && aLanguage.getLength() != 3)
242 incErrorStr(
"Error: langID '%s' not 2-3 characters\n", aLanguage);
251 if (!(aCountry.isEmpty() || aCountry.getLength() == 2))
252 incErrorStr(
"Error: countryID '%s' not empty or more than 2 characters\n", aCountry);
261 const OUString& aVariant( variantNode->
getValue());
262 if (!(aVariant.isEmpty() || (aVariant.getLength() >= 7 && aVariant.indexOf(
'-') >= 2)))
263 incErrorStr(
"Error: invalid Variant '%s'\n", aVariant);
264 if (!(aVariant.isEmpty() || aLanguage ==
"qlt"))
265 incErrorStrStr(
"Error: Variant '%s' given but Language '%s' is not 'qlt'\n", aVariant, aLanguage);
270 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr LCInfoArray[] = {\n");
288 if (!useLocale.isEmpty()) {
289 useLocale = useLocale.replace(
'-',
'_');
303 OUString aDecSepAlt =
307 OUString aTime100Sep =
314 sepNode =
findNode(
"LongDateDayOfWeekSeparator");
318 fprintf( stderr,
"Warning: %s\n",
319 "LongDateDayOfWeekSeparator is only a comma not followed by a space. Usually this is not the case and may lead to concatenated display names like \"Wednesday,May 9, 2007\".");
321 sepNode =
findNode(
"LongDateDaySeparator");
324 if (aLDS ==
"," || aLDS ==
".")
325 fprintf( stderr,
"Warning: %s\n",
326 "LongDateDaySeparator is only a comma or dot not followed by a space. Usually this is not the case and may lead to concatenated display names like \"Wednesday, May 9,2007\".");
328 sepNode =
findNode(
"LongDateMonthSeparator");
332 fprintf( stderr,
"Warning: %s\n",
333 "LongDateMonthSeparator is empty. Usually this is not the case and may lead to concatenated display names like \"Wednesday, May9, 2007\".");
335 sepNode =
findNode(
"LongDateYearSeparator");
339 fprintf( stderr,
"Warning: %s\n",
340 "LongDateYearSeparator is empty. Usually this is not the case and may lead to concatenated display names like \"Wednesday, 2007May 9\".");
345 incError(
"DateSeparator equals TimeSeparator.");
347 incError(
"DecimalSeparator equals ThousandSeparator.");
348 if (aDecSepAlt == aThoSep)
349 incError(
"DecimalSeparatorAlternative equals ThousandSeparator.");
351 incError(
"DecimalSeparatorAlternative equals DecimalSeparator, it must not be specified then.");
352 if ( aThoSep ==
" " )
353 incError(
"ThousandSeparator is an ' ' ordinary space, this should be a non-breaking space U+00A0 instead.");
355 fprintf( stderr,
"Warning: %s\n",
356 "ListSeparator equals DecimalSeparator.");
357 if (aListSep == aThoSep)
358 fprintf( stderr,
"Warning: %s\n",
359 "ListSeparator equals ThousandSeparator.");
360 if (aListSep.getLength() != 1 || aListSep[0] !=
';')
362 incError(
"ListSeparator not ';' semicolon. Strongly recommended. Currently required.");
365 if (aTimeSep == aTime100Sep)
368 fprintf( stderr,
"Warning: %s\n",
369 "Time100SecSeparator equals TimeSeparator, this is probably an error.");
374 fprintf( stderr,
"Warning: %s\n",
375 "Time100SecSeparator is different from DecimalSeparator, this may be correct or not. Intended?");
377 if (nSavErr !=
nError || nWarn)
378 fprintf( stderr,
"Warning: %s\n",
379 "Don't forget to adapt corresponding FormatCode elements when changing separators.");
381 OUString aQuoteStart =
385 OUString aDoubleQuoteStart =
387 OUString aDoubleQuoteEnd =
390 if (aQuoteStart.toChar() <= 127 && aQuoteEnd.toChar() > 127)
391 fprintf( stderr,
"Warning: %s\n",
392 "QuotationStart is an ASCII character but QuotationEnd is not.");
393 if (aQuoteEnd.toChar() <= 127 && aQuoteStart.toChar() > 127)
394 fprintf( stderr,
"Warning: %s\n",
395 "QuotationEnd is an ASCII character but QuotationStart is not.");
396 if (aDoubleQuoteStart.toChar() <= 127 && aDoubleQuoteEnd.toChar() > 127)
397 fprintf( stderr,
"Warning: %s\n",
398 "DoubleQuotationStart is an ASCII character but DoubleQuotationEnd is not.");
399 if (aDoubleQuoteEnd.toChar() <= 127 && aDoubleQuoteStart.toChar() > 127)
400 fprintf( stderr,
"Warning: %s\n",
401 "DoubleQuotationEnd is an ASCII character but DoubleQuotationStart is not.");
402 if (aQuoteStart.toChar() <= 127 && aQuoteEnd.toChar() <= 127)
403 fprintf( stderr,
"Warning: %s\n",
404 "QuotationStart and QuotationEnd are both ASCII characters. Not necessarily an issue, but unusual.");
405 if (aDoubleQuoteStart.toChar() <= 127 && aDoubleQuoteEnd.toChar() <= 127)
406 fprintf( stderr,
"Warning: %s\n",
407 "DoubleQuotationStart and DoubleQuotationEnd are both ASCII characters. Not necessarily an issue, but unusual.");
408 if (aQuoteStart == aQuoteEnd)
409 fprintf( stderr,
"Warning: %s\n",
410 "QuotationStart equals QuotationEnd. Not necessarily an issue, but unusual.");
411 if (aDoubleQuoteStart == aDoubleQuoteEnd)
412 fprintf( stderr,
"Warning: %s\n",
413 "DoubleQuotationStart equals DoubleQuotationEnd. Not necessarily an issue, but unusual.");
416 if (aQuoteStart == aDoubleQuoteStart)
417 fprintf( stderr,
"Warning: %s\n",
418 "QuotationStart equals DoubleQuotationStart. Not necessarily an issue, but unusual.");
419 if (aQuoteEnd == aDoubleQuoteEnd)
420 fprintf( stderr,
"Warning: %s\n",
421 "QuotationEnd equals DoubleQuotationEnd. Not necessarily an issue, but unusual.");
423 switch (
int ic = aQuoteStart.toChar())
434 fprintf( stderr,
"Warning: %s U+%04X %s\n",
435 "QuotationStart may be wrong:", ic,
OSTR( aQuoteStart));
437 switch (
int ic = aQuoteEnd.toChar())
448 fprintf( stderr,
"Warning: %s U+%04X %s\n",
449 "QuotationEnd may be wrong:", ic,
OSTR( aQuoteEnd));
451 switch (
int ic = aDoubleQuoteStart.toChar())
462 fprintf( stderr,
"Warning: %s U+%04X %s\n",
463 "DoubleQuotationStart may be wrong:", ic,
OSTR( aDoubleQuoteStart));
465 switch (
int ic = aDoubleQuoteEnd.toChar())
476 fprintf( stderr,
"Warning: %s U+%04X %s\n",
477 "DoubleQuotationEnd may be wrong:", ic,
OSTR( aDoubleQuoteEnd));
482 sepNode =
findNode(
"MeasurementSystem");
485 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr LCType[] = {\n");
520 incError(
"more than 2 LC_FORMAT sections");
522 ::std::vector< OUString > theDateAcceptancePatterns;
524 OUString useLocale(
getAttr().getValueByName(
"ref"));
527 OUString strFrom(
getAttr().getValueByName(
"replaceFrom"));
528 if (useLocale.isEmpty())
533 if (!strFrom.isEmpty() && str.isEmpty())
534 incErrorStr(
"replaceFrom=\"%s\" replaceTo=\"\" is empty replacement.\n", strFrom);
536 if (str.endsWithIgnoreAsciiCase(
"-FFFF]"))
537 incErrorStr(
"replaceTo=\"%s\" needs FFFF to be adapted to the real LangID value.\n", str);
540 if ( strFrom ==
"[CURRENCY]" )
543 if (str.startsWith(
"[$" ))
545 sal_Int32 nHyphen = str.indexOf(
'-');
552 if (!useLocale.isEmpty())
554 if (!strFrom.isEmpty() && strFrom !=
"[CURRENCY]")
557 "Error: non-empty replaceFrom=\"%s\" with non-empty ref=\"%s\".",
560 useLocale = useLocale.replace(
'-',
'_');
579 bool bCtypeIsRef =
false;
580 bool bHaveEngineering =
false;
581 bool bShowNextFreeFormatIndex =
false;
586 if ( currNode->
getName() ==
"DateAcceptancePattern" )
589 incError(
"DateAcceptancePattern only handled in LC_FORMAT, not LC_FORMAT_1");
591 theDateAcceptancePatterns.push_back( currNode->
getValue());
595 if ( currNode->
getName() !=
"FormatElement" )
604 OUString aFormatIndex;
610 if (!aMsgIdSet.
insert( str).second)
611 incErrorStr(
"Error: Duplicated msgid=\"%s\" in FormatElement.\n", str);
615 bool bDefault = str ==
"true";
625 sal_Int16 formatindex =
static_cast<sal_Int16
>(aFormatIndex.toInt32());
630 incErrorInt(
"Error: Reserved formatindex=\"%d\" in FormatElement.\n", formatindex);
631 bShowNextFreeFormatIndex =
true;
633 if (!aFormatIndexSet.insert( formatindex).second)
635 incErrorInt(
"Error: Duplicated formatindex=\"%d\" in FormatElement.\n", formatindex);
636 bShowNextFreeFormatIndex =
true;
643 OUString aKey( aUsage +
"," + aType);
644 if (!aDefaultsSet.
insert( aKey).second)
646 OUString
aStr =
"Duplicated default for usage=\"" + aUsage +
"\" type=\"" + aType +
"\": formatindex=\"" + aFormatIndex +
"\".";
659 case cssi::NumberFormatIndex::DATE_SYS_DDMMYYYY :
662 case cssi::NumberFormatIndex::NUMBER_1000DEC2 :
663 case cssi::NumberFormatIndex::TIME_MMSS00 :
664 case cssi::NumberFormatIndex::TIME_HH_MMSS00 :
668 incError(
"No root for FormatCode.");
671 pCtype = pRoot->
findNode(
"LC_CTYPE");
673 incError(
"No LC_CTYPE found for FormatCode.");
679 aRef = aRef.replace(
'-',
'_');
682 "Warning: Can't check separators used in FormatCode due to LC_CTYPE ref=\"%s\".\n"
683 "If these two locales use identical format codes, you should consider to use the ref= mechanism also for the LC_FORMAT element, together with replaceFrom= and replaceTo= for the currency.\n",
692 case cssi::NumberFormatIndex::CURRENCY_1000DEC2 :
697 sal_Int32 nStart =
n->getValue().indexOf(
"[$");
700 const OUString& aCode(
n->getValue());
701 sal_Int32 nHyphen = aCode.indexOf(
'-', nStart);
702 if (nHyphen >= nStart + 3)
708 case cssi::NumberFormatIndex::CURRENCY_1000INT :
709 case cssi::NumberFormatIndex::CURRENCY_1000INT_RED :
710 case cssi::NumberFormatIndex::CURRENCY_1000DEC2_RED :
711 case cssi::NumberFormatIndex::CURRENCY_1000DEC2_CCC :
712 case cssi::NumberFormatIndex::CURRENCY_1000DEC2_DASHED :
715 if (strcmp( of.
getLocale(),
"en_US") != 0)
717 const OUString& aCode(
n->getValue());
718 if (aCode.indexOf(
"0)" ) > 0 || aCode.indexOf(
"-)" ) > 0 ||
719 aCode.indexOf(
" )" ) > 0 || aCode.indexOf(
"])" ) > 0)
720 fprintf( stderr,
"Warning: FormatCode formatindex=\"%d\" for currency uses parentheses for negative amounts, which probably is not correct for locales not based on en_US.\n", formatindex);
725 const OUString& aCode(
n->getValue());
726 if (aCode.indexOf(
"[CURRENCY]" ) >= 0)
727 incErrorInt(
"Error: [CURRENCY] replaceTo not found for formatindex=\"%d\".\n", formatindex);
731 if (aUsage ==
"SCIENTIFIC_NUMBER")
734 const OUString& aCode(
n->getValue());
738 sal_Int32 nInt = aCode.indexOf(
"##0");
739 sal_Int32 nDec = (nInt < 0 ? -1 : aCode.indexOf(
"00E+00", nInt));
740 if (nInt >= 0 && nDec == nInt+4)
741 bHaveEngineering =
true;
748 const OUString& aCode(
n->getValue());
749 if (formatindex == cssi::NumberFormatIndex::NUMBER_1000DEC2)
755 incError(
"No DecimalSeparator found for FormatCode.");
758 nDec = aCode.indexOf( pSep->
getValue());
760 incErrorInt(
"Error: DecimalSeparator not present in FormatCode formatindex=\"%d\".\n",
763 pSep = pCtype->
findNode(
"ThousandSeparator");
765 incError(
"No ThousandSeparator found for FormatCode.");
768 nGrp = aCode.indexOf( pSep->
getValue());
770 incErrorInt(
"Error: ThousandSeparator not present in FormatCode formatindex=\"%d\".\n",
773 if (nDec >= 0 && nGrp >= 0 && nDec <= nGrp)
774 incErrorInt(
"Error: Ordering of ThousandSeparator and DecimalSeparator not correct in formatindex=\"%d\".\n",
777 if (formatindex == cssi::NumberFormatIndex::TIME_MMSS00 ||
778 formatindex == cssi::NumberFormatIndex::TIME_HH_MMSS00)
780 sal_Int32 nTime = -1;
781 sal_Int32 n100s = -1;
784 incError(
"No TimeSeparator found for FormatCode.");
787 nTime = aCode.indexOf( pSep->
getValue());
789 incErrorInt(
"Error: TimeSeparator not present in FormatCode formatindex=\"%d\".\n",
792 pSep = pCtype->
findNode(
"Time100SecSeparator");
794 incError(
"No Time100SecSeparator found for FormatCode.");
797 n100s = aCode.indexOf( pSep->
getValue());
799 incErrorInt(
"Error: Time100SecSeparator not present in FormatCode formatindex=\"%d\".\n",
801 n100s = aCode.indexOf( Concat2View(pSep->
getValue() +
"00"));
803 incErrorInt(
"Error: Time100SecSeparator+00 not present in FormatCode formatindex=\"%d\".\n",
806 if (n100s >= 0 && nTime >= 0 && n100s <= nTime)
807 incErrorInt(
"Error: Ordering of Time100SecSeparator and TimeSeparator not correct in formatindex=\"%d\".\n",
812 "Warning: formatindex=\"%d\",\"%d\",\"%d\" are the only FormatCode elements checked for separator usage, there may be others that have errors.\n",
813 int(cssi::NumberFormatIndex::NUMBER_1000DEC2),
814 int(cssi::NumberFormatIndex::TIME_MMSS00),
815 int(cssi::NumberFormatIndex::TIME_HH_MMSS00));
820 incError(
"No FormatCode in FormatElement.");
829 if (bShowNextFreeFormatIndex)
832 auto it = aFormatIndexSet.find( nNext);
833 if (it != aFormatIndexSet.end())
840 while (++it != aFormatIndexSet.end() && *it == nNext);
842 fprintf( stderr,
"Hint: Next free formatindex is %d.\n",
static_cast<int>(nNext));
850 if (theDateAcceptancePatterns.empty())
851 incError(
"No DateAcceptancePattern present.\n");
854 bool bHaveAbbr =
false;
855 for (
auto const& elem : theDateAcceptancePatterns)
857 if (elem.indexOf(
'D') > -1 && elem.indexOf(
'M') > -1 && elem.indexOf(
'Y') <= -1)
864 incError(
"No abbreviated DateAcceptancePattern present. For example M/D or D.M.\n");
870 for (sal_Int16 nNext = cssi::NumberFormatIndex::NUMBER_START;
873 sal_Int16 nHere = ::std::min( (aIter != aFormatIndexSet.end() ? *aIter :
876 if (aIter != aFormatIndexSet.end()) ++aIter;
877 for ( ; nNext < nHere; ++nNext)
881 case cssi::NumberFormatIndex::FRACTION_1 :
882 case cssi::NumberFormatIndex::FRACTION_2 :
883 case cssi::NumberFormatIndex::BOOLEAN :
884 case cssi::NumberFormatIndex::TEXT :
888 incErrorInt(
"Error: FormatElement formatindex=\"%d\" not present.\n", nNext);
893 case cssi::NumberFormatIndex::FRACTION_1 :
894 incErrorInt(
"Error: FormatElement formatindex=\"%d\" reserved for internal ``# ?/?''.\n", nNext);
896 case cssi::NumberFormatIndex::FRACTION_2 :
897 incErrorInt(
"Error: FormatElement formatindex=\"%d\" reserved for internal ``# ?\?/?\?''.\n", nNext);
899 case cssi::NumberFormatIndex::BOOLEAN :
900 incErrorInt(
"Error: FormatElement formatindex=\"%d\" reserved for internal ``BOOLEAN''.\n", nNext);
902 case cssi::NumberFormatIndex::TEXT :
903 incErrorInt(
"Error: FormatElement formatindex=\"%d\" reserved for internal ``@'' (TEXT).\n", nNext);
910 if (!bHaveEngineering)
911 incError(
"Engineering notation format not present, e.g. ##0.00E+00 or ##0,00E+00 for usage=\"SCIENTIFIC_NUMBER\"\n");
966 of.
writeOUStringFunction(
"getAllFormats0_",
"FormatElementsCount0",
"FormatElementsArray0",
"replaceFrom0",
"replaceTo0");
969 of.
writeOUStringFunction(
"getAllFormats1_",
"FormatElementsCount1",
"FormatElementsArray1",
"replaceFrom1",
"replaceTo1");
984 sal_uInt32 cDateSep = (
aDateSep.isEmpty()
986 sal_uInt32 cDateSep2 = cDateSep;
988 OUStringBuffer aPatternBuf(5);
989 OUStringBuffer aPatternBuf2(5);
991 bool bInModifier =
false;
992 bool bQuoted =
false;
1012 if (!(nDetected & 4))
1014 aPatternBuf.append(
'Y');
1015 if (!aPatternBuf2.isEmpty())
1016 aPatternBuf2.append(
'Y');
1022 if (!(nDetected & 2))
1024 aPatternBuf.append(
'M');
1025 if (!aPatternBuf2.isEmpty())
1026 aPatternBuf2.append(
'M');
1032 if (!(nDetected & 1))
1034 aPatternBuf.append(
'D');
1035 if (!aPatternBuf2.isEmpty())
1036 aPatternBuf2.append(
'D');
1066 if (cDateSep != cDateSep2 && aPatternBuf2.isEmpty())
1067 aPatternBuf2 = aPatternBuf;
1068 if (cChar == cDateSep || cChar == cDateSep2)
1069 aPatternBuf.append( OUString( &cDateSep, 1));
1070 if (cChar == cDateSep2 && !aPatternBuf2.isEmpty())
1071 aPatternBuf2.append( OUString( &cDateSep2, 1));
1075 if (((nDetected & 7) == 3) || ((nDetected & 7) == 0))
1081 aPatternBuf.append(
'Y');
1082 if (!aPatternBuf2.isEmpty())
1083 aPatternBuf2.append(
'Y');
1088 if (((nDetected & 7) == 0) || ((nDetected & 7) == 6))
1092 aPatternBuf.append(
'D');
1093 if (!aPatternBuf2.isEmpty())
1094 aPatternBuf2.append(
'D');
1097 else if ((nDetected & 7) == 3)
1101 aPatternBuf.append(
'Y');
1102 if (!aPatternBuf2.isEmpty())
1103 aPatternBuf2.append(
'Y');
1108 if ((nDetected & 7) == 0)
1111 aPatternBuf.append(
'D');
1112 if (!aPatternBuf2.isEmpty())
1113 aPatternBuf2.append(
'D');
1118 if ((nDetected & 7) == 0)
1121 aPatternBuf.append(
'D');
1122 if (!aPatternBuf2.isEmpty())
1123 aPatternBuf2.append(
'D');
1128 if ((nDetected & 7) == 0)
1131 aPatternBuf.append(
'D');
1132 if (!aPatternBuf2.isEmpty())
1133 aPatternBuf2.append(
'D');
1138 if ((nDetected & 7) == 1)
1141 aPatternBuf.append(
'M');
1142 if (!aPatternBuf2.isEmpty())
1143 aPatternBuf2.append(
'M');
1148 if ((nDetected & 7) == 3)
1151 aPatternBuf.append(
'Y');
1152 if (!aPatternBuf2.isEmpty())
1153 aPatternBuf2.append(
'Y');
1159 OUString aPattern( aPatternBuf.makeStringAndClear());
1160 if (((nDetected & 7) != 7) || aPattern.getLength() < 5)
1162 incErrorStr(
"Error: failed to extract full date acceptance pattern: %s\n", aPattern);
1163 fprintf( stderr,
" with DateSeparator '%s' from FormatCode '%s' (formatindex=\"%d\")\n",
1165 int(cssi::NumberFormatIndex::DATE_SYS_DDMMYYYY));
1169 fprintf( stderr,
"Generated date acceptance pattern: '%s' from '%s' (formatindex=\"%d\" and defined DateSeparator '%s')\n",
1171 int(cssi::NumberFormatIndex::DATE_SYS_DDMMYYYY),
1172 OSTR( OUString(&cDateSep, 1)));
1174 theDateAcceptancePatterns.insert( theDateAcceptancePatterns.begin(), aPattern);
1176 if (!aPatternBuf2.isEmpty())
1178 OUString aPattern2( aPatternBuf2.makeStringAndClear());
1179 if (aPattern2.getLength() < 5)
1181 incErrorStr(
"Error: failed to extract 2nd date acceptance pattern: %s\n", aPattern2);
1182 fprintf( stderr,
" with DateSeparator '%s' from FormatCode '%s' (formatindex=\"%d\")\n",
1184 int(cssi::NumberFormatIndex::DATE_SYS_DDMMYYYY));
1188 fprintf( stderr,
"Generated 2nd acceptance pattern: '%s' from '%s' (formatindex=\"%d\")\n",
1190 int(cssi::NumberFormatIndex::DATE_SYS_DDMMYYYY));
1191 theDateAcceptancePatterns.insert( theDateAcceptancePatterns.begin(), aPattern2);
1200 for (
auto const& elem : theDateAcceptancePatterns)
1202 if (elem.getLength() == (cDecSep <= 0xffff ? 3 : 4))
1204 if (elem.iterateCodePoints( &
o3tl::temporary(sal_Int32(1))) == cDecSep)
1207 fprintf( stderr,
"Error: Date acceptance pattern '%s' matches decimal number '#%s#'\n",
1215 for (std::vector<OUString>::const_iterator aIt = theDateAcceptancePatterns.begin();
1216 aIt != theDateAcceptancePatterns.end(); ++aIt)
1218 for (std::vector<OUString>::iterator aComp = theDateAcceptancePatterns.begin();
1219 aComp != theDateAcceptancePatterns.end(); )
1221 if (aIt != aComp && *aIt == *aComp)
1223 incErrorStr(
"Error: Duplicated DateAcceptancePattern: %s\n", *aComp);
1224 aComp = theDateAcceptancePatterns.erase( aComp);
1231 sal_Int16 nbOfDateAcceptancePatterns =
static_cast<sal_Int16
>(theDateAcceptancePatterns.size());
1233 for (sal_Int16
i = 0;
i < nbOfDateAcceptancePatterns; ++
i)
1238 of.
writeAsciiString(
"static const sal_Int16 DateAcceptancePatternsCount = ");
1239 of.
writeInt( nbOfDateAcceptancePatterns);
1242 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr DateAcceptancePatternsArray[] = {\n");
1243 for (sal_Int16
i = 0;
i < nbOfDateAcceptancePatterns; ++
i)
1252 of.
writeOUStringFunction(
"getDateAcceptancePatterns_",
"DateAcceptancePatternsCount",
"DateAcceptancePatternsArray");
1261 if (!useLocale.isEmpty()) {
1262 useLocale = useLocale.replace(
'-',
'_');
1267 sal_Int16 nbOfCollations = 0;
1268 sal_Int16 nbOfCollationOptions = 0;
1272 if( currNode->
getName() ==
"Collator" )
1285 if( currNode->
getName() ==
"CollationOptions" )
1288 nbOfCollationOptions = sal::static_int_cast<sal_Int16>( pCollationOptions->
getNumberOfChildren() );
1289 for( sal_Int16
i=0;
i<nbOfCollationOptions;
i++ )
1295 of.
writeInt( nbOfCollationOptions );
1303 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr LCCollatorArray[] = {\n");
1304 for(sal_Int16 j = 0; j < nbOfCollations; j++) {
1319 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr collationOptions[] = {");
1320 for( sal_Int16 j=0; j<nbOfCollationOptions; j++ )
1335 if (!useLocale.isEmpty()) {
1336 useLocale = useLocale.replace(
'-',
'_');
1345 stderr,
"Error: LC_SEARCH: more than 1 child: %" SAL_PRIdINT32
"\n",
1351 for(
i=0;
i<nSearchOptions;
i++ )
1357 of.
writeInt( sal::static_int_cast<sal_Int16>( nSearchOptions ) );
1360 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr searchOptions[] = {");
1361 for(
i=0;
i<nSearchOptions;
i++ )
1366 of.
writeInt( sal::static_int_cast<sal_Int16>(
i) );
1375 if (!useLocale.isEmpty()) {
1376 useLocale = useLocale.replace(
'-',
'_');
1382 sal_Int16 nbOfIndexs = 0;
1383 sal_Int16 nbOfUnicodeScripts = 0;
1384 sal_Int16 nbOfPageWords = 0;
1387 if( currNode->
getName() ==
"IndexKey" )
1404 if( currNode->
getName() ==
"UnicodeScript" )
1407 nbOfUnicodeScripts++;
1410 if( currNode->
getName() ==
"FollowPageWord" )
1420 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr IndexArray[] = {\n");
1421 for(sal_Int16
i = 0;
i < nbOfIndexs;
i++) {
1448 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr UnicodeScriptArray[] = {");
1449 for( sal_Int16
i=0;
i<nbOfUnicodeScripts;
i++ )
1463 if (nbOfPageWords == 0)
1467 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr FollowPageWordArray[] = { unicodeScript0 };\n\n");
1471 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr FollowPageWordArray[] = {\n");
1472 for(sal_Int16
i = 0;
i < nbOfPageWords;
i++) {
1487 const char* elementTag, sal_Int16 i, sal_Int16 j )
1493 if (
p &&
p->getName() ==
"DefaultNarrowName" )
1494 aNarrName =
p->getValue();
1497 sal_uInt32 nChar = aFullName.iterateCodePoints( &
o3tl::temporary(sal_Int32(0)));
1498 aNarrName = OUString( &nChar, 1);
1513 const char* pTag,
const char* pStr, sal_Int16 i, sal_Int16 j )
1520 const char* elementTag, sal_Int16 i,
bool bNarrow )
1531 for (sal_Int16 j = 0; j <
nCount; j++)
1543 const LocaleNode* pNode, sal_Int16 nChild, std::u16string_view rCalendarID )
const
1553 if (bFound && (!pNode || pNode->
getName() != rName))
1556 incErrorStrStr(
"Error: <%s> element expected in calendar '%s'\n", rName, rCalendarID);
1563 if (!useLocale.isEmpty()) {
1564 useLocale = useLocale.replace(
'-',
'_');
1570 std::unique_ptr<sal_Int16[]> nbOfDays(
new sal_Int16[nbOfCalendars] );
1571 std::unique_ptr<sal_Int16[]> nbOfMonths(
new sal_Int16[nbOfCalendars] );
1572 std::unique_ptr<sal_Int16[]> nbOfGenitiveMonths(
new sal_Int16[nbOfCalendars] );
1573 std::unique_ptr<sal_Int16[]> nbOfPartitiveMonths(
new sal_Int16[nbOfCalendars] );
1574 std::unique_ptr<sal_Int16[]> nbOfEras(
new sal_Int16[nbOfCalendars] );
1579 std::map< OUString, bool > aCalendars;
1580 aCalendars[
"buddhist"] =
false;
1581 aCalendars[
"gengou"] =
false;
1582 aCalendars[
"gregorian"] =
false;
1583 aCalendars[
"hanja"] =
false;
1584 aCalendars[
"hanja_yoil"] =
false;
1585 aCalendars[
"hijri"] =
false;
1586 aCalendars[
"jewish"] =
false;
1587 aCalendars[
"ROC"] =
false;
1589 aCalendars[
"dangi"] =
false;
1590 aCalendars[
"persian"] =
false;
1594 bool bHasGregorian =
false;
1597 for (
i = 0;
i < nbOfCalendars;
i++) {
1601 bool bGregorian = calendarID ==
"gregorian";
1603 bHasGregorian = bGregorian;
1604 auto calIt = aCalendars.find(calendarID);
1605 if (calIt == aCalendars.end())
1606 incErrorStr(
"Error: unknown Calendar unoid: %s\n", calendarID);
1607 else if (calIt->second)
1608 incErrorStr(
"Error: duplicate Calendar unoid: %s\n", calendarID);
1610 calIt->second =
true;
1614 sal_Int16 nChild = 0;
1617 const char *elementTag;
1620 ref_name = ref_name.replace(
'-',
'_');
1621 if (!ref_name.isEmpty() &&
i > 0) {
1622 for (j = 0; j <
i; j++) {
1624 if (str == ref_name)
1628 if (!ref_name.isEmpty() && daysNode ==
nullptr) {
1633 if (daysNode ==
nullptr)
1636 if (bGregorian && nbOfDays[
i] != 7)
1637 incErrorInt(
"Error: A Gregorian calendar must have 7 days per week, this one has %d\n", nbOfDays[
i]);
1639 for (j = 0; j < nbOfDays[
i]; j++) {
1643 if ( j == 0 && bGregorian && dayID !=
"sun" )
1644 incError(
"First day of a week of a Gregorian calendar must be <DayID>sun</DayID>");
1653 ref_name = ref_name.replace(
'-',
'_');
1654 if (!ref_name.isEmpty() &&
i > 0) {
1655 for (j = 0; j <
i; j++) {
1657 if (str == ref_name)
1661 if (!ref_name.isEmpty() && monthsNode ==
nullptr) {
1666 if (monthsNode ==
nullptr)
1669 if (bGregorian && nbOfMonths[
i] != 12)
1670 incErrorInt(
"Error: A Gregorian calendar must have 12 months, this one has %d\n", nbOfMonths[
i]);
1671 elementTag =
"month";
1672 for (j = 0; j < nbOfMonths[
i]; j++) {
1676 if ( j == 0 && bGregorian && monthID !=
"jan" )
1677 incError(
"First month of a year of a Gregorian calendar must be <MonthID>jan</MonthID>");
1689 ref_name = ref_name.replace(
'-',
'_');
1690 if (!ref_name.isEmpty() &&
i > 0) {
1691 for (j = 0; j <
i; j++) {
1693 if (str == ref_name)
1697 if (!ref_name.isEmpty() && genitiveMonthsNode ==
nullptr) {
1700 nbOfGenitiveMonths[
i] = 0;
1702 if (genitiveMonthsNode ==
nullptr)
1703 genitiveMonthsNode = calNode ->
getChildAt(nChild);
1704 nbOfGenitiveMonths[
i] = sal::static_int_cast<sal_Int16>( genitiveMonthsNode->
getNumberOfChildren() );
1705 if (bGregorian && nbOfGenitiveMonths[
i] != 12)
1706 incErrorInt(
"Error: A Gregorian calendar must have 12 genitive months, this one has %d\n", nbOfGenitiveMonths[
i]);
1707 elementTag =
"genitiveMonth";
1708 for (j = 0; j < nbOfGenitiveMonths[
i]; j++) {
1712 if ( j == 0 && bGregorian && genitiveMonthID !=
"jan" )
1713 incError(
"First genitive month of a year of a Gregorian calendar must be <MonthID>jan</MonthID>");
1726 ref_name = ref_name.replace(
'-',
'_');
1727 if (!ref_name.isEmpty() &&
i > 0) {
1728 for (j = 0; j <
i; j++) {
1730 if (str == ref_name)
1734 if (!ref_name.isEmpty() && partitiveMonthsNode ==
nullptr) {
1737 nbOfPartitiveMonths[
i] = 0;
1739 if (partitiveMonthsNode ==
nullptr)
1740 partitiveMonthsNode = calNode ->
getChildAt(nChild);
1741 nbOfPartitiveMonths[
i] = sal::static_int_cast<sal_Int16>( partitiveMonthsNode->
getNumberOfChildren() );
1742 if (bGregorian && nbOfPartitiveMonths[
i] != 12)
1743 incErrorInt(
"Error: A Gregorian calendar must have 12 partitive months, this one has %d\n", nbOfPartitiveMonths[
i]);
1744 elementTag =
"partitiveMonth";
1745 for (j = 0; j < nbOfPartitiveMonths[
i]; j++) {
1749 if ( j == 0 && bGregorian && partitiveMonthID !=
"jan" )
1750 incError(
"First partitive month of a year of a Gregorian calendar must be <MonthID>jan</MonthID>");
1759 ref_name = ref_name.replace(
'-',
'_');
1760 if (!ref_name.isEmpty() &&
i > 0) {
1761 for (j = 0; j <
i; j++) {
1763 if (str == ref_name)
1767 if (!ref_name.isEmpty() && erasNode ==
nullptr) {
1772 if (erasNode ==
nullptr)
1781 if (bGregorian && nbOfEras[
i] != 2)
1782 incErrorInt(
"Error: A Gregorian calendar must have 2 eras, this one has %d\n", nbOfEras[
i]);
1784 for (j = 0; j < nbOfEras[
i]; j++) {
1792 if ( j == 0 && bGregorian && eraID !=
"bc" )
1793 incError(
"First era of a Gregorian calendar must be <EraID>bc</EraID>");
1794 if ( j == 1 && bGregorian && eraID !=
"ad" )
1795 incError(
"Second era of a Gregorian calendar must be <EraID>ad</EraID>");
1809 for (j = 0; j < nbOfDays[
i]; j++)
1816 if (j >= nbOfDays[
i])
1817 incErrorStr(
"Error: <StartDayOfWeek> <DayID> must be one of the <DaysOfWeek>, but is: %s\n", str);
1826 sal_Int16 nDays = sal::static_int_cast<sal_Int16>( str.toInt32() );
1827 if (nDays < 1 || (0 < nbOfDays[
i] && nbOfDays[
i] < nDays))
1828 incErrorInt(
"Error: Bad value of MinimalDaysInFirstWeek: %d, must be 1 <= value <= days_in_week\n",
1834 fprintf( stderr,
"Warning: %s\n",
"No Gregorian calendar defined, are you sure?");
1841 for(
i = 0;
i < nbOfCalendars;
i++) {
1848 for(
i = 0;
i < nbOfCalendars;
i++) {
1854 of.
writeAsciiString(
"static constexpr OUStringLiteral nbOfGenitiveMonths = u\"");
1855 for(
i = 0;
i < nbOfCalendars;
i++) {
1861 of.
writeAsciiString(
"static constexpr OUStringLiteral nbOfPartitiveMonths = u\"");
1862 for(
i = 0;
i < nbOfCalendars;
i++) {
1869 for(
i = 0;
i < nbOfCalendars;
i++) {
1876 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr calendars[] = {\n");
1882 for(
i = 0;
i < nbOfCalendars;
i++) {
1905 return rStr.getLength() == 3
1906 &&
'A' <=
p[0] &&
p[0] <=
'Z'
1907 &&
'A' <=
p[1] &&
p[1] <=
'Z'
1908 &&
'A' <=
p[2] &&
p[2] <=
'Z'
1915 if (!useLocale.isEmpty()) {
1916 useLocale = useLocale.replace(
'-',
'_');
1920 sal_Int16 nbOfCurrencies = 0;
1923 bool bTheDefault=
false;
1924 bool bTheCompatible =
false;
1933 if (bLegacy && (bDefault || bCompatible))
1934 incError(
"Currency: if legacyOnly==true, both 'default' and 'usedInCompatibleFormatCodes' must be false.");
1938 incError(
"Currency: more than one default currency.");
1944 incError(
"Currency: more than one currency flagged as usedInCompatibleFormatCodes.");
1945 bTheCompatible =
true;
1951 incError(
"CurrencyID is not ISO 4217");
1965 incError(
"BankSymbol is not ISO 4217");
1969 sal_Int16 nDecimalPlaces =
static_cast<sal_Int16
>(str.toInt32());
1975 incError(
"Currency: no default currency.");
1976 if (!bTheCompatible)
1977 incError(
"Currency: no currency flagged as usedInCompatibleFormatCodes.");
1982 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr currencies[] = {\n");
1983 for(sal_Int16
i = 0;
i < nbOfCurrencies;
i++) {
2016 if (!useLocale.isEmpty()) {
2017 useLocale = useLocale.replace(
'-',
'_');
2021 sal_Int16 nbOfModules = 0;
2033 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr LCTransliterationsArray[] = {\n");
2034 for( sal_Int16
i = 0;
i < nbOfModules;
i++) {
2040 of.
writeOUStringFunction(
"getTransliterations_",
"nbOfTransliterations",
"LCTransliterationsArray");
2045struct NameValuePair {
2053 {
"trueWord",
"true" },
2054 {
"falseWord",
"false" },
2055 {
"quarter1Word",
"1st quarter" },
2056 {
"quarter2Word",
"2nd quarter" },
2057 {
"quarter3Word",
"3rd quarter" },
2058 {
"quarter4Word",
"4th quarter" },
2059 {
"aboveWord",
"above" },
2060 {
"belowWord",
"below" },
2061 {
"quarter1Abbreviation",
"Q1" },
2062 {
"quarter2Abbreviation",
"Q2" },
2063 {
"quarter3Abbreviation",
"Q3" },
2064 {
"quarter4Abbreviation",
"Q4" }
2070 if (!useLocale.isEmpty()) {
2071 useLocale = useLocale.replace(
'-',
'_');
2079 incError(
"No ReservedWords element.");
2083 bool bEnglishLocale = (strncmp( of.
getLocale(),
"en_", 3) == 0);
2085 sal_Int16 nbOfWords = 0;
2094 "Warning: No %s in ReservedWords, using en_US default: \"%s\".\n",
2100 fprintf( stderr,
"Error: No content for ReservedWords %s.\n",
ReserveWord[
i].
name);
2104 if (!bEnglishLocale && curNode &&
i <= 7 &&
2108 "Warning: ReservedWord %s seems to be untranslated \"%s\".\n",
2115 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr LCReservedWordsArray[] = {\n");
2116 for(
i = 0;
i < nbOfWords;
i++) {
2133 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr LCForbiddenCharactersArray[] = {\n");
2153 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr LCBreakIteratorRulesArray[] = {\n");
2168 if (!useLocale.isEmpty()) {
2169 useLocale = useLocale.replace(
'-',
'_');
2176 const char* attr[
nAttributes ] = {
"Prefix",
"NumType",
"Suffix",
"Transliteration",
"NatNum" };
2183 for(
i = 0;
i < nStyles; ++
i )
2188 const char*
name = attr[j];
2196 of.
writeInt( sal::static_int_cast<sal_Int16>( nStyles ) );
2198 of.
writeAsciiString(
"static const sal_Int16 continuousNbOfAttributesPerStyle = ");
2203 for(
i=0;
i<nStyles;
i++ )
2205 of.
writeAsciiString(
"\nstatic constexpr rtl::OUStringConstExpr continuousStyle" );
2206 of.
writeInt( sal::static_int_cast<sal_Int16>(
i) );
2213 of.
writeInt(sal::static_int_cast<sal_Int16>(
i));
2221 of.
writeAsciiString(
"static const rtl::OUStringConstExpr* LCContinuousNumberingLevelsArray[] = {\n" );
2222 for(
i=0;
i<nStyles;
i++ )
2226 of.
writeInt( sal::static_int_cast<sal_Int16>(
i) );
2231 "continuousNbOfAttributesPerStyle",
"LCContinuousNumberingLevelsArray");
2239 if (!useLocale.isEmpty()) {
2240 useLocale = useLocale.replace(
'-',
'_');
2256 "SymbolTextDistance",
2266 std::vector<sal_Int32> nLevels;
2267 for( sal_Int32
i = 0;
i < nStyles;
i++ )
2270 nLevels.push_back(
p->getNumberOfChildren() );
2271 for( sal_Int32 j=0; j<nLevels.back(); j++ )
2273 const Attr& q =
p->getChildAt( j )->getAttr();
2276 const char*
name = attr[k];
2279 sal::static_int_cast<sal_Int16>(
i),
2280 sal::static_int_cast<sal_Int16>(j) );
2286 for(
size_t i=0;
i<nLevels.size();
i++ )
2288 if( nLevels[0] != nLevels[
i] )
2290 incError(
"Numbering levels don't match.");
2296 of.
writeInt( sal::static_int_cast<sal_Int16>( nStyles ) );
2298 of.
writeAsciiString(
"static const sal_Int16 outlineNbOfLevelsPerStyle = ");
2299 of.
writeInt( sal::static_int_cast<sal_Int16>( nLevels.back() ) );
2301 of.
writeAsciiString(
"static const sal_Int16 outlineNbOfAttributesPerLevel = ");
2315 for( sal_Int32
i=0;
i<nStyles;
i++ )
2317 for( sal_Int32 j=0; j<nLevels.back(); j++ )
2321 of.
writeInt( sal::static_int_cast<sal_Int16>(
i) );
2323 of.
writeInt( sal::static_int_cast<sal_Int16>(j) );
2330 of.
writeInt( sal::static_int_cast<sal_Int16>(
i) );
2331 of.
writeInt( sal::static_int_cast<sal_Int16>(j) );
2341 for( sal_Int32
i=0;
i<nStyles;
i++ )
2343 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr const * outlineStyle" );
2344 of.
writeInt( sal::static_int_cast<sal_Int16>(
i) );
2347 for( sal_Int32 j=0; j<nLevels.back(); j++ )
2350 of.
writeInt( sal::static_int_cast<sal_Int16>(
i) );
2352 of.
writeInt( sal::static_int_cast<sal_Int16>(j) );
2359 of.
writeAsciiString(
"static constexpr rtl::OUStringConstExpr const * const * LCOutlineNumberingLevelsArray[] = {\n" );
2360 for( sal_Int32
i=0;
i<nStyles;
i++ )
2364 of.
writeInt( sal::static_int_cast<sal_Int16>(
i) );
2368 of.
writeOUStringFunction3(
"getOutlineNumberingLevels_",
"outlineNbOfStyles",
"outlineNbOfLevelsPerStyle",
2369 "outlineNbOfAttributesPerLevel",
"LCOutlineNumberingLevelsArray");
2373 sal_Int16 len = attr->getLength();
2376 value.realloc (len);
2377 auto pValue =
value.getArray();
2378 for (sal_Int16
i =0;
i< len;
i++) {
2379 pName[
i] = attr->getNameByIndex(
i);
2385 auto pName = std::find_if(std::cbegin(
name), std::cend(
name),
2386 [&str](
const OUString& rName) {
return rName.equalsAscii(str); });
2389 auto i =
static_cast<sal_Int32
>(std::distance(std::cbegin(
name),
pName));
static bool isIso4217(const OUString &rStr)
::o3tl::sorted_vector< sal_Int16 > ValueSet
static OUString sTheCurrencyReplaceTo
const NameValuePair ReserveWord[]
static OUString sTheDateEditFormat
static void lcl_writeAbbrFullNarrArrays(const OFileWriter &of, sal_Int16 nCount, const char *elementTag, sal_Int16 i, bool bNarrow)
static void lcl_writeAbbrFullNarrNames(const OFileWriter &of, const LocaleNode *currNode, const char *elementTag, sal_Int16 i, sal_Int16 j)
#define LOCALE_VERSION_DTD
::o3tl::sorted_vector< OUString > NameSet
static void lcl_writeTabTagString(const OFileWriter &of, const char *pTag, const char *pStr)
static OUString sTheCompatibleCurrency
static void lcl_writeTabTagStringNums(const OFileWriter &of, const char *pTag, const char *pStr, sal_Int16 i, sal_Int16 j)
Sequence< OUString > name
const OUString & getValueByIndex(sal_Int32 idx) const
OUString getValueByName(const char *str) const
Sequence< OUString > value
Attr(const Reference< XAttributeList > &attr)
virtual void generateCode(const OFileWriter &of) const override
bool expectedCalendarElement(std::u16string_view rName, const LocaleNode *pNode, sal_Int16 nChild, std::u16string_view rCalendarID) const
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
virtual void generateCode(const OFileWriter &of) const override
void incErrorStrStr(const char *pStr, std::u16string_view rVal1, std::u16string_view rVal2) const
void addChild(LocaleNode *node)
const OUString & getName() const
void incErrorInt(const char *pStr, int nVal) const
const OUString & getValue() const
sal_Int32 getNumberOfChildren() const
const LocaleNode * getRoot() const
static LocaleNode * createNode(const OUString &name, const Reference< XAttributeList > &attr)
OUString writeOUStringLiteralParameterCheckLen(const OFileWriter &of, const char *pParameterName, const LocaleNode *pNode, sal_Int32 nMinLen, sal_Int32 nMaxLen) const
const Attr & getAttr() const
const LocaleNode * findNode(const char *name) const
LocaleNode * getChildAt(sal_Int32 idx) const
void incError(const char *pStr) const
LocaleNode(OUString name, const Reference< XAttributeList > &attr)
virtual void generateCode(const OFileWriter &of) const
std::vector< std::unique_ptr< LocaleNode > > children
void incErrorStr(const char *pStr, std::u16string_view rVal) const
void writeOUStringRefFunction(const char *func, std::u16string_view useLocale) const
void writeOUStringFunction3(const char *func, const char *style, const char *levels, const char *attr, const char *array) const
void writeOUStringFunction2(const char *func, const char *style, const char *attr, const char *array) const
void writeOUStringLiteralIntParameter(const char *pAsciiStr, const sal_Int16 count, sal_Int16 val) const
bool writeOUStringLiteralDefaultParameter(const char *pAsciiStr, std::u16string_view str, sal_Int16 count) const
void writeOUStringLiteralParameter(const char *pAsciiStr, std::u16string_view aChars) const
void writeOUStringRefFunction3(const char *func, std::u16string_view useLocale) const
void writeOUStringFunction(const char *func, const char *count, const char *array) const
const char * getLocale() const
Return the locale string, something like en_US or de_DE.
void writeAsciiString(const char *str) const
void writeInt(sal_Int16 nb) const
void writeParameter(const char *pAsciiStr, std::u16string_view aChars, sal_Int16 count) const
void writeHexInt(sal_Int16 nb) const
void writeOUStringRefFunction2(const char *func, std::u16string_view useLocale) const
std::vector< Value >::const_iterator const_iterator
std::pair< const_iterator, bool > insert(Value &&x)
#define SAL_N_ELEMENTS(arr)
constexpr sal_Int16 nFirstFreeFormatIndex
The number of reserved (with defined meaning) built-in format code indices, additional locale data fo...
constexpr sal_Int16 nStopPredefinedFormatIndex
The number of predefined format code indices that must be defined by locale data, except BOOLEAN and ...
constexpr T & temporary(T &&x)