LibreOffice Module svl (master) 1
|
#include <zforfind.hxx>
Public Member Functions | |
ImpSvNumberInputScan (SvNumberFormatter *pFormatter) | |
~ImpSvNumberInputScan () | |
void | ChangeIntl () |
MUST be called if International/Locale is changed. More... | |
void | ChangeNullDate (const sal_uInt16 nDay, const sal_uInt16 nMonth, const sal_Int16 nYear) |
set reference date for offset calculation More... | |
bool | IsNumberFormat (const OUString &rString, SvNumFormatType &F_Type, double &fOutNumber, const SvNumberformat *pFormat, SvNumInputOptions eInputOptions) |
convert input string to number More... | |
short | GetDecPos () const |
after IsNumberFormat: get decimal position More... | |
sal_uInt16 | GetNumericsCount () const |
after IsNumberFormat: get count of numeric substrings in input string More... | |
void | SetYear2000 (sal_uInt16 nVal) |
set threshold of two-digit year input More... | |
sal_uInt16 | GetYear2000 () const |
get threshold of two-digit year input More... | |
bool | CanForceToIso8601 (DateOrder eDateOrder) |
Whether input can be forced to ISO 8601 format. More... | |
void | InvalidateDateAcceptancePatterns () |
bool | HasIso8601Tsep () const |
Whether 'T' separator was detected in an ISO 8601 date+time format. More... | |
Private Member Functions | |
ImpSvNumberInputScan (const ImpSvNumberInputScan &)=delete | |
ImpSvNumberInputScan & | operator= (const ImpSvNumberInputScan &)=delete |
void | Reset () |
void | InitText () |
Initialize uppercase months and weekdays. More... | |
bool | SkipThousands (const sal_Unicode *&pStr, OUString &rSymbol) const |
void | NumberStringDivision (const OUString &rString) |
bool | StringContainsWord (const OUString &rWhat, const OUString &rString, sal_Int32 nPos) const |
Whether rString contains word (!) rWhat at nPos. More... | |
bool | GetThousandSep (std::u16string_view rString, sal_Int32 &nPos, sal_uInt16 nStringPos) const |
Recognizes exactly ,111 in {3} and {3,2} or ,11 in {3,2} grouping. More... | |
short | GetLogical (std::u16string_view rString) const |
Conversion of text to logical value "true" => 1: "false"=> -1: else => 0: More... | |
short | GetMonth (const OUString &rString, sal_Int32 &nPos) |
Converts a string containing a month name (JAN, January) at nPos into the month number (negative if abbreviated), returns 0 if nothing found. More... | |
int | GetDayOfWeek (const OUString &rString, sal_Int32 &nPos) |
Converts a string containing a DayOfWeek name (Mon, Monday) at nPos into the DayOfWeek number + 1 (negative if abbreviated), returns 0 if nothing found. More... | |
bool | GetCurrency (const OUString &rString, sal_Int32 &nPos) |
Reading a currency symbol '$' => true else => false. More... | |
bool | GetTimeAmPm (const OUString &rString, sal_Int32 &nPos) |
Reading the time period specifier (AM/PM) for the 12 hour clock. More... | |
bool | GetDecSep (std::u16string_view rString, sal_Int32 &nPos) const |
Read a decimal separator (',') ',' => true else => false. More... | |
bool | GetTime100SecSep (std::u16string_view rString, sal_Int32 &nPos) const |
Reading a hundredth seconds separator. More... | |
int | GetSign (std::u16string_view rString, sal_Int32 &nPos) |
Read a sign including brackets '+' => 1 '-' => -1 u'−' => -1 '(' => -1, bNegCheck = 1 else => 0. More... | |
bool | GetNextNumber (sal_uInt16 &i, sal_uInt16 &j) const |
i counts string portions, j counts numbers thereof. More... | |
bool | GetTimeRef (double &fOutNumber, sal_uInt16 nIndex, sal_uInt16 nCnt, SvNumInputOptions eInputOptions) const |
Converts time -> double (only decimals) More... | |
sal_uInt16 | ImplGetDay (sal_uInt16 nIndex) const |
sal_uInt16 | ImplGetMonth (sal_uInt16 nIndex) const |
sal_uInt16 | ImplGetYear (sal_uInt16 nIndex) |
30 -> 1930, 29 -> 2029, or 56 -> 1756, 55 -> 1855, ... More... | |
bool | GetDateRef (double &fDays, sal_uInt16 &nCounter) |
bool | ScanStartString (const OUString &rString) |
Analyze first string All gone => true else => false. More... | |
bool | ScanMidString (const OUString &rString, sal_uInt16 nStringPos, sal_uInt16 nCurNumCount) |
Analyze string in the middle All gone => true else => false. More... | |
bool | ScanEndString (const OUString &rString) |
Analyze the end All gone => true else => false. More... | |
bool | ScanStringNumFor (const OUString &rString, sal_Int32 nPos, sal_uInt16 nString, bool bDontDetectNegation=false) |
bool | MatchedReturn () |
Return true or false depending on the nMatched... state and remember usage. More... | |
bool | IsNumberFormatMain (const OUString &rString, const SvNumberformat *pFormat) |
Be sure that the string to be analyzed is already converted to upper case and if it contained native number digits that they are already converted to ASCII. More... | |
bool | IsAcceptedDatePattern (sal_uInt16 nStartPatternAt) |
Whether input matches locale dependent date acceptance pattern. More... | |
bool | SkipDatePatternSeparator (sal_uInt16 nParticle, sal_Int32 &rPos, bool &rSignedYear) |
Sets (not advances!) rPos to sStrArray[nParticle].getLength() if string matches separator in pattern at nParticle. More... | |
sal_uInt16 | GetDatePatternNumbers () |
Returns count of numbers in accepted date pattern. More... | |
bool | IsDatePatternNumberOfType (sal_uInt16 nNumber, sal_Unicode cType) |
Whether numeric string nNumber is of type cType in accepted date pattern, 'Y', 'M' or 'D'. More... | |
sal_uInt32 | GetDatePatternOrder () |
Obtain order of accepted date pattern coded as, for example, ('D'<<16)|('M'<<8)|'Y'. More... | |
DateOrder | GetDateOrder (bool bFromFormatIfNoPattern=false) |
Obtain date format order, from accepted date pattern if available or otherwise the locale's default order. More... | |
bool | MayBeIso8601 () |
Whether input may be an ISO 8601 date format, yyyy-mm-dd... More... | |
bool | MayBeMonthDate () |
Whether input may be a dd-month-yy format, with month name, not number. More... | |
bool | IsAcceptableIso8601 () |
Whether input is acceptable as ISO 8601 date format in the current NfEvalDateFormat setting. More... | |
LongDateOrder | GetMiddleMonthLongDateOrder (bool bFormatTurn, const LocaleDataWrapper *pLoc, DateOrder eDateOrder) |
If month name in the middle was parsed, get the corresponding LongDateOrder in GetDateRef(). More... | |
Static Private Member Functions | |
static double | StringToDouble (std::u16string_view aStr, bool bForceFraction=false) |
Only simple unsigned floating point values without any error detection, decimal separator has to be '. More... | |
static bool | NextNumberStringSymbol (const sal_Unicode *&pStr, OUString &rSymbol) |
static bool | StringContains (const OUString &rWhat, const OUString &rString, sal_Int32 nPos) |
static bool | StringPtrContains (const OUString &rWhat, const sal_Unicode *pString, sal_Int32 nPos) |
static bool | StringContainsImpl (const OUString &rWhat, const OUString &rString, sal_Int32 nPos) |
DO NOT use directly. More... | |
static bool | StringPtrContainsImpl (const OUString &rWhat, const sal_Unicode *pString, sal_Int32 nPos) |
DO NOT use directly. More... | |
static bool | SkipChar (sal_Unicode c, std::u16string_view rString, sal_Int32 &nPos) |
Skips the supplied char. More... | |
static bool | SkipBlanks (const OUString &rString, sal_Int32 &nPos) |
Skips blanks. More... | |
static bool | SkipString (const OUString &rWhat, const OUString &rString, sal_Int32 &nPos) |
jump over rWhat in rString at nPos More... | |
static short | GetESign (std::u16string_view rString, sal_Int32 &nPos) |
Read a sign with an exponent '+' => 1 '-' => -1 else => 0. More... | |
Private Attributes | |
SvNumberFormatter * | pFormatter |
const SvNumberformat * | mpFormat |
std::unique_ptr< OUString[]> | pUpperMonthText |
std::unique_ptr< OUString[]> | pUpperAbbrevMonthText |
std::unique_ptr< OUString[]> | pUpperGenitiveMonthText |
std::unique_ptr< OUString[]> | pUpperGenitiveAbbrevMonthText |
std::unique_ptr< OUString[]> | pUpperPartitiveMonthText |
std::unique_ptr< OUString[]> | pUpperPartitiveAbbrevMonthText |
std::unique_ptr< OUString[]> | pUpperDayText |
std::unique_ptr< OUString[]> | pUpperAbbrevDayText |
OUString | aUpperCurrSymbol |
bool | bTextInitialized |
bool | bScanGenitiveMonths |
bool | bScanPartitiveMonths |
std::optional< Date > | moNullDate |
OUString | sStrArray [SV_MAX_COUNT_INPUT_STRINGS] |
bool | IsNum [SV_MAX_COUNT_INPUT_STRINGS] |
sal_uInt16 | nNums [SV_MAX_COUNT_INPUT_STRINGS] |
sal_uInt16 | nStringsCnt |
sal_uInt16 | nNumericsCnt |
bool | bDecSepInDateSeps |
sal_uInt8 | nMatchedAllStrings |
int | nSign |
int | nMonth |
short | nMonthPos |
int | nDayOfWeek |
sal_uInt16 | nTimePos |
short | nDecPos |
bool | bNegCheck |
short | nESign |
short | nAmPm |
short | nLogical |
bool | mbEraCE |
sal_uInt16 | nThousand |
sal_uInt16 | nPosThousandString |
SvNumFormatType | eScannedType |
SvNumFormatType | eSetType |
sal_uInt16 | nStringScanNumFor |
short | nStringScanSign |
sal_uInt16 | nYear2000 |
sal_uInt8 | nMayBeIso8601 |
State of ISO 8601 detection. More... | |
bool | bIso8601Tsep |
Whether the 'T' time separator was detected in an ISO 8601 string. More... | |
sal_uInt8 | nMayBeMonthDate |
State of dd-month-yy or yy-month-dd detection, with month name. More... | |
sal_Int32 | nAcceptedDatePattern |
Input matched this locale dependent date acceptance pattern. More... | |
css::uno::Sequence< OUString > | sDateAcceptancePatterns |
sal_uInt16 | nDatePatternStart |
If input matched a date acceptance pattern that starts at input particle sStrArray[nDatePatternStart]. More... | |
sal_uInt16 | nDatePatternNumbers |
Count of numbers that matched the accepted pattern, if any, else 0. More... | |
Static Private Attributes | |
static const sal_uInt8 | nMatchedEndString = 0x01 |
static const sal_uInt8 | nMatchedMidString = 0x02 |
static const sal_uInt8 | nMatchedStartString = 0x04 |
static const sal_uInt8 | nMatchedVirgin = 0x08 |
static const sal_uInt8 | nMatchedUsedAsReturn = 0x10 |
Definition at line 36 of file zforfind.hxx.
|
explicit |
Definition at line 75 of file zforfind.cxx.
References ChangeIntl(), SvNumberFormatter::GetYear2000Default(), moNullDate, nYear2000, pFormatter, Reset(), and UNDEFINED.
ImpSvNumberInputScan::~ImpSvNumberInputScan | ( | ) |
Definition at line 91 of file zforfind.cxx.
|
privatedelete |
bool ImpSvNumberInputScan::CanForceToIso8601 | ( | DateOrder | eDateOrder | ) |
Whether input can be forced to ISO 8601 format.
Depends on locale's date separator and a specific date format order.
Definition at line 1146 of file zforfind.cxx.
References GetDateOrder(), GetDatePatternNumbers(), IsDatePatternNumberOfType(), MayBeIso8601(), n, nMayBeIso8601, nNumericsCnt, nNums, and sStrArray.
Referenced by GetDateRef(), and IsAcceptableIso8601().
void ImpSvNumberInputScan::ChangeIntl | ( | ) |
MUST be called if International/Locale is changed.
Definition at line 3808 of file zforfind.cxx.
References aUpperCurrSymbol, bDecSepInDateSeps, bTextInitialized, SvNumberFormatter::GetDateSep(), SvNumberFormatter::GetNumDecimalSep(), SvNumberFormatter::GetNumDecimalSepAlt(), InvalidateDateAcceptancePatterns(), and pFormatter.
Referenced by ImpSvNumberInputScan().
void ImpSvNumberInputScan::ChangeNullDate | ( | const sal_uInt16 | nDay, |
const sal_uInt16 | nMonth, | ||
const sal_Int16 | nYear | ||
) |
set reference date for offset calculation
Definition at line 3833 of file zforfind.cxx.
References Day, moNullDate, and Year.
|
private |
Reading a currency symbol '$' => true else => false.
Definition at line 774 of file zforfind.cxx.
References aUpperCurrSymbol, SvNumberFormatter::GetCharClass(), SvNumberFormatter::GetCurrencyEntry(), SvNumberformat::GetLanguage(), LocaleDataWrapper::getLanguageTag(), LanguageTag::getLanguageType(), SvNumberFormatter::GetLocaleData(), SvNumberformat::GetNewCurrencySymbol(), mpFormat, nPos, pFormatter, StringContains(), and CharClass::uppercase().
Referenced by ScanEndString(), and ScanStartString().
|
private |
Obtain date format order, from accepted date pattern if available or otherwise the locale's default order.
bFromFormatIfNoPattern | If <TRUE> and no pattern was matched, obtain date order from format if available, instead from format's or current locale. |
Definition at line 1646 of file zforfind.cxx.
References LocaleDataWrapper::getDateOrder(), SvNumberformat::GetDateOrder(), GetDatePatternOrder(), SvNumberFormatter::GetLocaleData(), mpFormat, pFormatter, and SAL_WARN.
Referenced by CanForceToIso8601(), GetDateRef(), and IsAcceptableIso8601().
|
private |
Returns count of numbers in accepted date pattern.
Definition at line 1587 of file zforfind.cxx.
References IsAcceptedDatePattern(), nDatePatternNumbers, nNumericsCnt, and nNums.
Referenced by CanForceToIso8601(), IsDatePatternNumberOfType(), and IsNumberFormat().
|
private |
Obtain order of accepted date pattern coded as, for example, ('D'<<16)|('M'<<8)|'Y'.
Definition at line 1622 of file zforfind.cxx.
References IsAcceptedDatePattern(), nAcceptedDatePattern, nNumericsCnt, nNums, and sDateAcceptancePatterns.
Referenced by GetDateOrder(), and GetDateRef().
|
private |
Definition at line 1769 of file zforfind.cxx.
References CanForceToIso8601(), DATE, SvNumberFormatter::GetCalendar(), SvNumberformat::GetDateOrder(), GetDateOrder(), GetDatePatternOrder(), CalendarWrapper::getEpochStart(), SvNumberFormatter::GetEvalDateFormat(), SvNumberformat::GetExactDateOrder(), LocaleDataWrapper::getLanguageTag(), CalendarWrapper::getLocalDateTime(), LanguageTag::getLocale(), SvNumberFormatter::GetLocaleData(), LocaleDataWrapper::getLongDateOrder(), GetMiddleMonthLongDateOrder(), SvNumberformat::GetType(), ImplGetDay(), ImplGetMonth(), ImplGetYear(), IsAcceptedDatePattern(), CalendarWrapper::isValid(), kDefaultEra, CalendarWrapper::loadCalendar(), mbEraCE, moNullDate, mpFormat, NF_EVALDATEFORMAT_FORMAT, NF_EVALDATEFORMAT_FORMAT_INTL, NF_EVALDATEFORMAT_INTL, NF_EVALDATEFORMAT_INTL_FORMAT, nMatchedAllStrings, nMonth, nMonthPos, nNumericsCnt, nNums, nStringScanNumFor, nTimePos, p, pFormatter, SAL_WARN, SAL_WARN_IF, CalendarWrapper::setGregorianDateTime(), CalendarWrapper::setValue(), DateTime::Sub(), SvNumberformat::SwitchToOtherCalendar(), and Date::SYSTEM.
Referenced by IsNumberFormat().
|
private |
Converts a string containing a DayOfWeek name (Mon, Monday) at nPos into the DayOfWeek number + 1 (negative if abbreviated), returns 0 if nothing found.
Definition at line 737 of file zforfind.cxx.
References bTextInitialized, SvNumberFormatter::GetCalendar(), CalendarWrapper::getNumberOfDaysInWeek(), i, InitText(), nPos, pFormatter, pUpperAbbrevDayText, pUpperDayText, and StringContainsWord().
Referenced by ScanEndString(), and ScanStartString().
|
inline |
after IsNumberFormat: get decimal position
Definition at line 57 of file zforfind.hxx.
References nDecPos.
|
inlineprivate |
Read a decimal separator (',') ',' => true else => false.
Definition at line 854 of file zforfind.cxx.
References SvNumberFormatter::GetNumDecimalSep(), SvNumberFormatter::GetNumDecimalSepAlt(), nPos, pFormatter, and o3tl::starts_with().
Referenced by ScanEndString(), ScanMidString(), and ScanStartString().
|
staticprivate |
Read a sign with an exponent '+' => 1 '-' => -1 else => 0.
Definition at line 943 of file zforfind.cxx.
References nPos.
Referenced by ScanMidString().
|
private |
Conversion of text to logical value "true" => 1: "false"=> -1: else => 0:
Definition at line 579 of file zforfind.cxx.
References ImpSvNumberformatScan::GetFalseString(), SvNumberFormatter::GetFormatScanner(), ImpSvNumberformatScan::GetTrueString(), and pFormatter.
Referenced by IsNumberFormatMain().
|
private |
If month name in the middle was parsed, get the corresponding LongDateOrder in GetDateRef().
Definition at line 1723 of file zforfind.cxx.
References SvNumberformat::GetExactDateOrder(), LocaleDataWrapper::getLongDateOrder(), ImplGetDay(), MayBeMonthDate(), mpFormat, and nMayBeMonthDate.
Referenced by GetDateRef().
|
private |
Converts a string containing a month name (JAN, January) at nPos into the month number (negative if abbreviated), returns 0 if nothing found.
Definition at line 604 of file zforfind.cxx.
References bScanGenitiveMonths, bScanPartitiveMonths, bTextInitialized, SvNumberFormatter::GetCalendar(), LanguageTag::getCountry(), LanguageTag::getLanguage(), SvNumberFormatter::GetLanguageTag(), CalendarWrapper::getNumberOfMonthsInYear(), i, InitText(), nPos, pFormatter, pUpperAbbrevMonthText, pUpperGenitiveAbbrevMonthText, pUpperGenitiveMonthText, pUpperMonthText, pUpperPartitiveAbbrevMonthText, pUpperPartitiveMonthText, StringContainsWord(), and u.
Referenced by ScanEndString(), ScanMidString(), and ScanStartString().
|
inlineprivate |
i counts string portions, j counts numbers thereof.
It should had been called SkipNumber instead.
Definition at line 967 of file zforfind.cxx.
References i, IsNum, and nStringsCnt.
Referenced by IsNumberFormatMain().
|
inline |
after IsNumberFormat: get count of numeric substrings in input string
Definition at line 59 of file zforfind.hxx.
References nNumericsCnt.
|
private |
Read a sign including brackets '+' => 1 '-' => -1 u'−' => -1 '(' => -1, bNegCheck = 1 else => 0.
Definition at line 913 of file zforfind.cxx.
References bNegCheck, nPos, and u.
Referenced by ScanEndString(), and ScanStartString().
|
inlineprivate |
Recognizes exactly ,111 in {3} and {3,2} or ,11 in {3,2} grouping.
Definition at line 538 of file zforfind.cxx.
References utl::DigitGroupingIterator::advance(), cNarrowNoBreakSpace, cNoBreakSpace, utl::DigitGroupingIterator::get(), LocaleDataWrapper::getDigitGrouping(), SvNumberFormatter::GetLocaleData(), SvNumberFormatter::GetNumThousandSep(), IsNum, nPos, nPosThousandString, nStringsCnt, pFormatter, sStrArray, and u.
Referenced by ScanMidString().
|
inlineprivate |
Reading a hundredth seconds separator.
Definition at line 878 of file zforfind.cxx.
References bIso8601Tsep, SvNumberFormatter::GetLocaleData(), LocaleDataWrapper::getTime100SecSep(), nPos, pFormatter, and o3tl::starts_with().
Referenced by ScanMidString().
|
private |
Reading the time period specifier (AM/PM) for the 12 hour clock.
Returns: "AM" or "PM" => true else => false
nAmPos: "AM" => 1 "PM" => -1 else => 0
Definition at line 824 of file zforfind.cxx.
References SvNumberFormatter::GetCharClass(), SvNumberFormatter::GetLocaleData(), LocaleDataWrapper::getTimeAM(), LocaleDataWrapper::getTimePM(), nAmPm, nPos, pFormatter, StringContains(), and CharClass::uppercase().
Referenced by ScanEndString().
|
private |
Converts time -> double (only decimals)
Definition at line 979 of file zforfind.cxx.
References SvNumberformat::IsMinuteSecondFormat(), LAX_TIME, mpFormat, nAmPm, nDecPos, nIndex, nNums, SAL_WARN, sStrArray, and StringToDouble().
Referenced by IsNumberFormat().
|
inline |
get threshold of two-digit year input
Definition at line 64 of file zforfind.hxx.
References nYear2000.
|
inline |
Whether 'T' separator was detected in an ISO 8601 date+time format.
Definition at line 76 of file zforfind.hxx.
References bIso8601Tsep.
|
private |
Definition at line 1060 of file zforfind.cxx.
References getLength(), nIndex, nNums, and sStrArray.
Referenced by GetDateRef(), and GetMiddleMonthLongDateOrder().
|
private |
Definition at line 1077 of file zforfind.cxx.
References SvNumberFormatter::GetCalendar(), getLength(), CalendarWrapper::getNumberOfMonthsInYear(), nIndex, nNums, pFormatter, and sStrArray.
Referenced by GetDateRef().
|
private |
30 -> 1930, 29 -> 2029, or 56 -> 1756, 55 -> 1855, ...
Definition at line 1098 of file zforfind.cxx.
References SvNumberFormatter::ExpandTwoDigitYear(), kDefaultEra, mbEraCE, nIndex, nNums, nYear2000, and sStrArray.
Referenced by GetDateRef().
|
private |
Initialize uppercase months and weekdays.
Definition at line 3733 of file zforfind.cxx.
References bScanGenitiveMonths, bScanPartitiveMonths, bTextInitialized, FullName, SvNumberFormatter::GetCalendar(), SvNumberFormatter::GetCharClass(), CalendarWrapper::getDays(), CalendarWrapper::getGenitiveMonths(), CalendarWrapper::getMonths(), CalendarWrapper::getPartitiveMonths(), pFormatter, pUpperAbbrevDayText, pUpperAbbrevMonthText, pUpperDayText, pUpperGenitiveAbbrevMonthText, pUpperGenitiveMonthText, pUpperMonthText, pUpperPartitiveAbbrevMonthText, pUpperPartitiveMonthText, and CharClass::uppercase().
Referenced by GetDayOfWeek(), and GetMonth().
void ImpSvNumberInputScan::InvalidateDateAcceptancePatterns | ( | ) |
Definition at line 3824 of file zforfind.cxx.
References sDateAcceptancePatterns.
Referenced by ChangeIntl().
|
private |
Whether input is acceptable as ISO 8601 date format in the current NfEvalDateFormat setting.
Definition at line 1197 of file zforfind.cxx.
References CanForceToIso8601(), DATE, SvNumberformat::GetDateOrder(), GetDateOrder(), SvNumberFormatter::GetEvalDateFormat(), SvNumberformat::GetType(), mpFormat, NF_EVALDATEFORMAT_FORMAT, NF_EVALDATEFORMAT_INTL, and pFormatter.
Referenced by IsNumberFormat().
|
private |
Whether input matches locale dependent date acceptance pattern.
nStartPatternAt | The pattern matching starts at input particle sStrArray[nStartPatternAt]. |
NOTE: once called the result is remembered, subsequent calls with different parameters do not check for a match and do not lead to a different result.
Definition at line 1297 of file zforfind.cxx.
References aBuf, OnDemandLocaleDataWrapper::changeLocale(), comphelper::concatSequences(), SvNumberFormatter::GetCalendar(), LocaleDataWrapper::getDateAcceptancePatterns(), SvNumberFormatter::GetEvalDateFormat(), SvNumberFormatter::GetLanguage(), SvNumberformat::GetLanguage(), LocaleDataWrapper::getLanguageTag(), LanguageTag::getLanguageType(), getLength(), SvNumberFormatter::GetLocaleData(), CalendarWrapper::getNumberOfMonthsInYear(), LocaleDataWrapper::getNumDecimalSep(), LocaleDataWrapper::getNumDecimalSepAlt(), SvNumberFormatter::GetOnDemandLocaleDataWrapper(), IsNum, lcl_getPatternSeparatorLength(), lcl_IsSignedYearSep(), mpFormat, nAcceptedDatePattern, nDatePatternNumbers, nDatePatternStart, NF_EVALDATEFORMAT_FORMAT, NF_EVALDATEFORMAT_FORMAT_INTL, NF_EVALDATEFORMAT_INTL, NF_EVALDATEFORMAT_INTL_FORMAT, nNumericsCnt, nPos, nStringsCnt, padToLength(), pFormatter, SAL_WARN, SAL_WARN_IF, sDateAcceptancePatterns, SkipBlanks(), and sStrArray.
Referenced by GetDatePatternNumbers(), GetDatePatternOrder(), GetDateRef(), IsNumberFormat(), ScanStartString(), and SkipDatePatternSeparator().
|
private |
Whether numeric string nNumber is of type cType in accepted date pattern, 'Y', 'M' or 'D'.
Definition at line 1598 of file zforfind.cxx.
References GetDatePatternNumbers(), nAcceptedDatePattern, and sDateAcceptancePatterns.
Referenced by CanForceToIso8601(), and IsNumberFormat().
bool ImpSvNumberInputScan::IsNumberFormat | ( | const OUString & | rString, |
SvNumFormatType & | F_Type, | ||
double & | fOutNumber, | ||
const SvNumberformat * | pFormat, | ||
SvNumInputOptions | eInputOptions | ||
) |
convert input string to number
Does rString represent a number (also date, time et al)
F_Type | input string |
fOutNumber | format type (in + out) |
pFormat | value determined (out) |
eInputOptions | number format to which compare against |
Definition at line 3844 of file zforfind.cxx.
References bNegCheck, CURRENCY, DATE, DATETIME, DEFINED, eScannedType, eSetType, FRACTION, SvNumberFormatter::GetCharClass(), GetDatePatternNumbers(), GetDateRef(), getLength(), GetTimeRef(), IsAcceptableIso8601(), IsAcceptedDatePattern(), IsDatePatternNumberOfType(), IsNumberFormatMain(), kDefaultEra, LOGICAL, MayBeIso8601(), mbEraCE, nDayOfWeek, nDecPos, nESign, nLogical, nMatchedAllStrings, nMonth, nMonthPos, nNumericsCnt, nNums, nSign, nStringScanSign, nThousand, NUMBER, PERCENT, pFormatter, SAL_WARN, SCIENTIFIC, sStrArray, StringToDouble(), TEXT, TIME, TransformInput(), and CharClass::uppercase().
Referenced by SvNumberformat::SvNumberformat().
|
private |
Be sure that the string to be analyzed is already converted to upper case and if it contained native number digits that they are already converted to ASCII.
Recognizes types of number, exponential, fraction, percent, currency, date, time.
Else text => return false
Definition at line 3391 of file zforfind.cxx.
References bNegCheck, DATE, DEFINED, eScannedType, eSetType, FRACTION, GetLogical(), GetNextNumber(), SvNumberformat::GetNumForInfoScannedType(), i, SvNumberFormatter::IsDecimalSep(), SvNumberformat::IsNumForStringElementCountEqual(), LOGICAL, mpFormat, nDecPos, nLogical, nMatchedAllStrings, nMatchedUsedAsReturn, nNumericsCnt, nSign, nStringScanNumFor, nStringsCnt, nThousand, NUMBER, NumberStringDivision(), pFormatter, Reset(), ScanEndString(), ScanMidString(), ScanStartString(), SCIENTIFIC, sStrArray, comphelper::string::strip(), SV_MAX_COUNT_INPUT_STRINGS, TIME, and UNDEFINED.
Referenced by IsNumberFormat().
|
private |
Return true or false depending on the nMatched... state and remember usage.
Definition at line 3719 of file zforfind.cxx.
References nMatchedAllStrings, nMatchedUsedAsReturn, and nMatchedVirgin.
Referenced by ScanEndString(), ScanMidString(), and ScanStartString().
|
private |
Whether input may be an ISO 8601 date format, yyyy-mm-dd...
Checks if input has at least 3 numbers for yyyy-mm-dd and the separator is '-', and 1<=mm<=12 and 1<=dd<=31.
Definition at line 1121 of file zforfind.cxx.
References getLength(), n, nMayBeIso8601, nNumericsCnt, nNums, nStringsCnt, sStrArray, and toInt32().
Referenced by CanForceToIso8601(), IsNumberFormat(), ScanEndString(), and ScanMidString().
|
private |
Whether input may be a dd-month-yy format, with month name, not number.
Definition at line 1215 of file zforfind.cxx.
References n, nMayBeMonthDate, nNumericsCnt, nNums, nStringsCnt, and sStrArray.
Referenced by GetMiddleMonthLongDateOrder(), ScanEndString(), and ScanMidString().
|
staticprivate |
Definition at line 214 of file zforfind.cxx.
References isNumber.
Referenced by NumberStringDivision().
|
private |
Definition at line 357 of file zforfind.cxx.
References IsNum, NextNumberStringSymbol(), nNumericsCnt, nNums, nPosThousandString, nStringsCnt, SkipThousands(), sStrArray, and SV_MAX_COUNT_INPUT_STRINGS.
Referenced by IsNumberFormatMain().
|
privatedelete |
|
private |
Definition at line 96 of file zforfind.cxx.
References bIso8601Tsep, bNegCheck, eScannedType, i, IsNum, kDefaultEra, mbEraCE, mpFormat, nAcceptedDatePattern, nAmPm, nDatePatternNumbers, nDatePatternStart, nDayOfWeek, nDecPos, nESign, nLogical, nMatchedAllStrings, nMatchedVirgin, nMayBeIso8601, nMayBeMonthDate, nMonth, nMonthPos, nNumericsCnt, nNums, nPosThousandString, nSign, nStringScanNumFor, nStringScanSign, nStringsCnt, nThousand, nTimePos, SV_MAX_COUNT_INPUT_STRINGS, and UNDEFINED.
Referenced by ImpSvNumberInputScan(), and IsNumberFormatMain().
|
private |
Analyze the end All gone => true else => false.
? catch time too?
Definition at line 2959 of file zforfind.cxx.
References bDecSepInDateSeps, bNegCheck, CURRENCY, DATE, DATETIME, eScannedType, GetCurrency(), SvNumberFormatter::GetDateSep(), GetDayOfWeek(), GetDecSep(), SvNumberFormatter::GetLocaleData(), LocaleDataWrapper::getLongDateDayOfWeekSep(), GetMonth(), GetSign(), GetTimeAmPm(), LocaleDataWrapper::getTimeSep(), MatchedReturn(), MayBeIso8601(), MayBeMonthDate(), nDecPos, nMatchedAllStrings, nMatchedEndString, nMonth, nMonthPos, nNumericsCnt, nPos, nSign, nStringsCnt, nTimePos, PERCENT, pFormatter, ScanStringNumFor(), SkipBlanks(), SkipChar(), SkipDatePatternSeparator(), SkipString(), StringContains(), TIME, and UNDEFINED.
Referenced by IsNumberFormatMain().
|
private |
Analyze string in the middle All gone => true else => false.
Definition at line 2564 of file zforfind.cxx.
References bDecSepInDateSeps, bIso8601Tsep, CURRENCY, DATE, DATETIME, eScannedType, eSetType, FRACTION, SvNumberFormatter::GetDateSep(), GetDecSep(), GetESign(), SvNumberformat::GetExactDateOrder(), SvNumberFormatter::GetLocaleData(), LocaleDataWrapper::getLongDateDaySep(), LocaleDataWrapper::getLongDateMonthSep(), LocaleDataWrapper::getLongDateOrder(), GetMonth(), GetThousandSep(), GetTime100SecSep(), LocaleDataWrapper::getTimeSep(), SvNumberformat::GetType(), kDefaultEra, MatchedReturn(), MayBeIso8601(), MayBeMonthDate(), mbEraCE, mpFormat, nDecPos, nESign, nMatchedAllStrings, nMatchedMidString, nMatchedVirgin, nMonth, nMonthPos, nNumericsCnt, nPos, nSign, nStringsCnt, nThousand, nTimePos, pFormatter, ScanStringNumFor(), SCIENTIFIC, SkipBlanks(), SkipChar(), SkipDatePatternSeparator(), SkipString(), sStrArray, TIME, and UNDEFINED.
Referenced by IsNumberFormatMain().
|
private |
Analyze first string All gone => true else => false.
Definition at line 2371 of file zforfind.cxx.
References CURRENCY, DATE, eScannedType, GetCurrency(), GetDayOfWeek(), GetDecSep(), SvNumberFormatter::GetLocaleData(), LocaleDataWrapper::getLongDateDayOfWeekSep(), GetMonth(), GetSign(), IsAcceptedDatePattern(), MatchedReturn(), nDayOfWeek, nDecPos, nMatchedAllStrings, nMatchedStartString, nMonth, nMonthPos, nNumericsCnt, nPos, nSign, nStringsCnt, pFormatter, ScanStringNumFor(), SkipBlanks(), SkipChar(), SkipString(), and UNDEFINED.
Referenced by IsNumberFormatMain().
|
private |
not 1
Definition at line 3277 of file zforfind.cxx.
References SvNumberformat::GetNumForString(), SvNumberFormatter::GetTransliteration(), SvNumberformat::HasStringNegativeSign(), SvNumberformat::IsNegativeWithoutSign(), SvNumberformat::IsSecondSubformatRealNegative(), mpFormat, nPos, nSign, nStringScanNumFor, nStringScanSign, and pFormatter.
Referenced by ScanEndString(), ScanMidString(), and ScanStartString().
|
inline |
set threshold of two-digit year input
Definition at line 62 of file zforfind.hxx.
References nYear2000.
|
inlinestaticprivate |
Skips blanks.
Definition at line 503 of file zforfind.cxx.
References cNarrowNoBreakSpace, cNoBreakSpace, nPos, and p.
Referenced by IsAcceptedDatePattern(), ScanEndString(), ScanMidString(), and ScanStartString().
|
inlinestaticprivate |
Skips the supplied char.
Definition at line 488 of file zforfind.cxx.
References nPos.
Referenced by ScanEndString(), ScanMidString(), and ScanStartString().
|
private |
Sets (not advances!) rPos to sStrArray[nParticle].getLength() if string matches separator in pattern at nParticle.
Also detects a signed year case like M/D/-Y
Definition at line 1528 of file zforfind.cxx.
References aBuf, IsAcceptedDatePattern(), IsNum, lcl_getPatternSeparatorLength(), lcl_IsSignedYearSep(), nAcceptedDatePattern, nDatePatternStart, nNumericsCnt, nNums, nStringsCnt, padToLength(), sDateAcceptancePatterns, and sStrArray.
Referenced by ScanEndString(), and ScanMidString().
|
inlinestaticprivate |
jump over rWhat in rString at nPos
Definition at line 523 of file zforfind.cxx.
References nPos, and StringContains().
Referenced by ScanEndString(), ScanMidString(), and ScanStartString().
|
private |
Definition at line 288 of file zforfind.cxx.
References SvNumberFormatter::GetNumThousandSep(), pFormatter, and StringPtrContains().
Referenced by NumberStringDivision().
|
inlinestaticprivate |
Definition at line 225 of file zforfind.hxx.
References nPos, and StringContainsImpl().
Referenced by GetCurrency(), GetTimeAmPm(), ScanEndString(), and SkipString().
|
staticprivate |
DO NOT use directly.
Whether rString contains rWhat at nPos.
Definition at line 389 of file zforfind.cxx.
References nPos, and StringPtrContainsImpl().
Referenced by StringContains().
|
private |
Whether rString contains word (!) rWhat at nPos.
Whether rString contains word rWhat at nPos.
rWhat will not be matched if it is a substring of a word.
Definition at line 429 of file zforfind.cxx.
References CharClass::getCharacterType(), SvNumberFormatter::GetCharClass(), nIndex, nPos, nType, pFormatter, and StringPtrContainsImpl().
Referenced by GetDayOfWeek(), and GetMonth().
|
inlinestaticprivate |
Definition at line 242 of file zforfind.hxx.
References nPos, and StringPtrContainsImpl().
Referenced by SkipThousands().
|
staticprivate |
DO NOT use directly.
Whether pString contains rWhat at nPos.
Definition at line 403 of file zforfind.cxx.
References nPos.
Referenced by StringContainsImpl(), StringContainsWord(), and StringPtrContains().
|
staticprivate |
Only simple unsigned floating point values without any error detection, decimal separator has to be '.
'
Definition at line 156 of file zforfind.cxx.
Referenced by GetTimeRef(), and IsNumberFormat().
|
private |
Definition at line 89 of file zforfind.hxx.
Referenced by ChangeIntl(), and GetCurrency().
|
private |
Definition at line 100 of file zforfind.hxx.
Referenced by ChangeIntl(), ScanEndString(), and ScanMidString().
|
private |
Whether the 'T' time separator was detected in an ISO 8601 string.
Definition at line 150 of file zforfind.hxx.
Referenced by GetTime100SecSep(), HasIso8601Tsep(), Reset(), and ScanMidString().
|
private |
Definition at line 118 of file zforfind.hxx.
Referenced by GetSign(), IsNumberFormat(), IsNumberFormatMain(), Reset(), and ScanEndString().
|
private |
Definition at line 91 of file zforfind.hxx.
Referenced by GetMonth(), and InitText().
|
private |
Definition at line 92 of file zforfind.hxx.
Referenced by GetMonth(), and InitText().
|
private |
Definition at line 90 of file zforfind.hxx.
Referenced by ChangeIntl(), GetDayOfWeek(), GetMonth(), and InitText().
|
private |
Definition at line 125 of file zforfind.hxx.
Referenced by IsNumberFormat(), IsNumberFormatMain(), Reset(), ScanEndString(), ScanMidString(), and ScanStartString().
|
private |
Definition at line 126 of file zforfind.hxx.
Referenced by IsNumberFormat(), IsNumberFormatMain(), and ScanMidString().
|
private |
Definition at line 96 of file zforfind.hxx.
Referenced by GetNextNumber(), GetThousandSep(), IsAcceptedDatePattern(), NumberStringDivision(), Reset(), and SkipDatePatternSeparator().
|
private |
Definition at line 122 of file zforfind.hxx.
Referenced by GetDateRef(), ImplGetYear(), IsNumberFormat(), Reset(), and ScanMidString().
|
private |
Definition at line 93 of file zforfind.hxx.
Referenced by ChangeNullDate(), GetDateRef(), and ImpSvNumberInputScan().
|
private |
Definition at line 80 of file zforfind.hxx.
Referenced by GetCurrency(), GetDateOrder(), GetDateRef(), GetMiddleMonthLongDateOrder(), GetTimeRef(), IsAcceptableIso8601(), IsAcceptedDatePattern(), IsNumberFormatMain(), Reset(), ScanMidString(), and ScanStringNumFor().
|
private |
Input matched this locale dependent date acceptance pattern.
-2 if not checked yet, -1 if no match, >=0 matched pattern.
Definition at line 168 of file zforfind.hxx.
Referenced by GetDatePatternOrder(), IsAcceptedDatePattern(), IsDatePatternNumberOfType(), Reset(), and SkipDatePatternSeparator().
|
private |
Definition at line 120 of file zforfind.hxx.
Referenced by GetTimeAmPm(), GetTimeRef(), and Reset().
|
private |
Count of numbers that matched the accepted pattern, if any, else 0.
Definition at line 182 of file zforfind.hxx.
Referenced by GetDatePatternNumbers(), IsAcceptedDatePattern(), and Reset().
|
private |
If input matched a date acceptance pattern that starts at input particle sStrArray[nDatePatternStart].
Definition at line 176 of file zforfind.hxx.
Referenced by IsAcceptedDatePattern(), Reset(), and SkipDatePatternSeparator().
|
private |
Definition at line 115 of file zforfind.hxx.
Referenced by IsNumberFormat(), Reset(), and ScanStartString().
|
private |
Definition at line 117 of file zforfind.hxx.
Referenced by GetDecPos(), GetTimeRef(), IsNumberFormat(), IsNumberFormatMain(), Reset(), ScanEndString(), ScanMidString(), and ScanStartString().
|
private |
Definition at line 119 of file zforfind.hxx.
Referenced by IsNumberFormat(), Reset(), and ScanMidString().
|
private |
Definition at line 121 of file zforfind.hxx.
Referenced by IsNumberFormat(), IsNumberFormatMain(), and Reset().
|
private |
Definition at line 101 of file zforfind.hxx.
Referenced by GetDateRef(), IsNumberFormat(), IsNumberFormatMain(), MatchedReturn(), Reset(), ScanEndString(), ScanMidString(), and ScanStartString().
|
staticprivate |
Definition at line 104 of file zforfind.hxx.
Referenced by ScanEndString().
|
staticprivate |
Definition at line 105 of file zforfind.hxx.
Referenced by ScanMidString().
|
staticprivate |
Definition at line 106 of file zforfind.hxx.
Referenced by ScanStartString().
|
staticprivate |
Definition at line 108 of file zforfind.hxx.
Referenced by IsNumberFormatMain(), and MatchedReturn().
|
staticprivate |
Definition at line 107 of file zforfind.hxx.
Referenced by MatchedReturn(), Reset(), and ScanMidString().
|
private |
State of ISO 8601 detection.
0:= don't know yet 1:= no 2:= yes, <=2 digits in year 3:= yes, 3 digits in year 4:= yes, >=4 digits in year
Definition at line 147 of file zforfind.hxx.
Referenced by CanForceToIso8601(), MayBeIso8601(), and Reset().
|
private |
State of dd-month-yy or yy-month-dd detection, with month name.
0:= don't know yet 1:= no 2:= yes, dd-month-yy 3:= yes, yy-month-dd
Definition at line 161 of file zforfind.hxx.
Referenced by GetMiddleMonthLongDateOrder(), MayBeMonthDate(), and Reset().
|
private |
Definition at line 111 of file zforfind.hxx.
Referenced by GetDateRef(), IsNumberFormat(), Reset(), ScanEndString(), ScanMidString(), and ScanStartString().
|
private |
Definition at line 113 of file zforfind.hxx.
Referenced by GetDateRef(), IsNumberFormat(), Reset(), ScanEndString(), ScanMidString(), and ScanStartString().
|
private |
Definition at line 99 of file zforfind.hxx.
Referenced by CanForceToIso8601(), GetDatePatternNumbers(), GetDatePatternOrder(), GetDateRef(), GetNumericsCount(), IsAcceptedDatePattern(), IsNumberFormat(), IsNumberFormatMain(), MayBeIso8601(), MayBeMonthDate(), NumberStringDivision(), Reset(), ScanEndString(), ScanMidString(), ScanStartString(), and SkipDatePatternSeparator().
|
private |
Definition at line 97 of file zforfind.hxx.
Referenced by CanForceToIso8601(), GetDatePatternNumbers(), GetDatePatternOrder(), GetDateRef(), GetTimeRef(), ImplGetDay(), ImplGetMonth(), ImplGetYear(), IsNumberFormat(), MayBeIso8601(), MayBeMonthDate(), NumberStringDivision(), Reset(), and SkipDatePatternSeparator().
|
private |
Definition at line 124 of file zforfind.hxx.
Referenced by GetThousandSep(), NumberStringDivision(), and Reset().
|
private |
Definition at line 110 of file zforfind.hxx.
Referenced by IsNumberFormat(), IsNumberFormatMain(), Reset(), ScanEndString(), ScanMidString(), ScanStartString(), and ScanStringNumFor().
|
private |
Definition at line 128 of file zforfind.hxx.
Referenced by GetDateRef(), IsNumberFormatMain(), Reset(), and ScanStringNumFor().
|
private |
Definition at line 130 of file zforfind.hxx.
Referenced by IsNumberFormat(), Reset(), and ScanStringNumFor().
|
private |
Definition at line 98 of file zforfind.hxx.
Referenced by GetNextNumber(), GetThousandSep(), IsAcceptedDatePattern(), IsNumberFormatMain(), MayBeIso8601(), MayBeMonthDate(), NumberStringDivision(), Reset(), ScanEndString(), ScanMidString(), ScanStartString(), and SkipDatePatternSeparator().
|
private |
Definition at line 123 of file zforfind.hxx.
Referenced by IsNumberFormat(), IsNumberFormatMain(), Reset(), and ScanMidString().
|
private |
Definition at line 116 of file zforfind.hxx.
Referenced by GetDateRef(), Reset(), ScanEndString(), and ScanMidString().
|
private |
Definition at line 131 of file zforfind.hxx.
Referenced by GetYear2000(), ImplGetYear(), ImpSvNumberInputScan(), and SetYear2000().
|
private |
Definition at line 79 of file zforfind.hxx.
Referenced by ChangeIntl(), GetCurrency(), GetDateOrder(), GetDateRef(), GetDayOfWeek(), GetDecSep(), GetLogical(), GetMonth(), GetThousandSep(), GetTime100SecSep(), GetTimeAmPm(), ImplGetMonth(), ImpSvNumberInputScan(), InitText(), IsAcceptableIso8601(), IsAcceptedDatePattern(), IsNumberFormat(), IsNumberFormatMain(), ScanEndString(), ScanMidString(), ScanStartString(), ScanStringNumFor(), SkipThousands(), and StringContainsWord().
|
private |
Definition at line 88 of file zforfind.hxx.
Referenced by GetDayOfWeek(), and InitText().
|
private |
Definition at line 82 of file zforfind.hxx.
Referenced by GetMonth(), and InitText().
|
private |
Definition at line 87 of file zforfind.hxx.
Referenced by GetDayOfWeek(), and InitText().
|
private |
Definition at line 84 of file zforfind.hxx.
Referenced by GetMonth(), and InitText().
|
private |
Definition at line 83 of file zforfind.hxx.
Referenced by GetMonth(), and InitText().
|
private |
Definition at line 81 of file zforfind.hxx.
Referenced by GetMonth(), and InitText().
|
private |
Definition at line 86 of file zforfind.hxx.
Referenced by GetMonth(), and InitText().
|
private |
Definition at line 85 of file zforfind.hxx.
Referenced by GetMonth(), and InitText().
|
private |
Definition at line 169 of file zforfind.hxx.
Referenced by GetDatePatternOrder(), InvalidateDateAcceptancePatterns(), IsAcceptedDatePattern(), IsDatePatternNumberOfType(), and SkipDatePatternSeparator().
|
private |
Definition at line 95 of file zforfind.hxx.
Referenced by CanForceToIso8601(), GetThousandSep(), GetTimeRef(), ImplGetDay(), ImplGetMonth(), ImplGetYear(), IsAcceptedDatePattern(), IsNumberFormat(), IsNumberFormatMain(), MayBeIso8601(), MayBeMonthDate(), NumberStringDivision(), ScanMidString(), and SkipDatePatternSeparator().