LibreOffice Module svl (master) 1
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ImpSvNumberInputScan Class Reference

#include <zforfind.hxx>

Collaboration diagram for ImpSvNumberInputScan:
[legend]

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
 
ImpSvNumberInputScanoperator= (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

SvNumberFormatterpFormatter
 
const SvNumberformatmpFormat
 
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< DatemoNullDate
 
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
 

Detailed Description

Definition at line 36 of file zforfind.hxx.

Constructor & Destructor Documentation

◆ ImpSvNumberInputScan() [1/2]

ImpSvNumberInputScan::ImpSvNumberInputScan ( SvNumberFormatter pFormatter)
explicit

◆ ~ImpSvNumberInputScan()

ImpSvNumberInputScan::~ImpSvNumberInputScan ( )

Definition at line 91 of file zforfind.cxx.

◆ ImpSvNumberInputScan() [2/2]

ImpSvNumberInputScan::ImpSvNumberInputScan ( const ImpSvNumberInputScan )
privatedelete

Member Function Documentation

◆ CanForceToIso8601()

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().

◆ ChangeIntl()

void ImpSvNumberInputScan::ChangeIntl ( )

◆ ChangeNullDate()

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.

◆ GetCurrency()

bool ImpSvNumberInputScan::GetCurrency ( const OUString &  rString,
sal_Int32 &  nPos 
)
private

◆ GetDateOrder()

DateOrder ImpSvNumberInputScan::GetDateOrder ( bool  bFromFormatIfNoPattern = false)
private

Obtain date format order, from accepted date pattern if available or otherwise the locale's default order.

Parameters
bFromFormatIfNoPatternIf <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().

◆ GetDatePatternNumbers()

sal_uInt16 ImpSvNumberInputScan::GetDatePatternNumbers ( )
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().

◆ GetDatePatternOrder()

sal_uInt32 ImpSvNumberInputScan::GetDatePatternOrder ( )
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().

◆ GetDateRef()

bool ImpSvNumberInputScan::GetDateRef ( double &  fDays,
sal_uInt16 &  nCounter 
)
private

◆ GetDayOfWeek()

int ImpSvNumberInputScan::GetDayOfWeek ( const OUString &  rString,
sal_Int32 &  nPos 
)
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().

◆ GetDecPos()

short ImpSvNumberInputScan::GetDecPos ( ) const
inline

after IsNumberFormat: get decimal position

Definition at line 57 of file zforfind.hxx.

References nDecPos.

◆ GetDecSep()

bool ImpSvNumberInputScan::GetDecSep ( std::u16string_view  rString,
sal_Int32 &  nPos 
) const
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().

◆ GetESign()

short ImpSvNumberInputScan::GetESign ( std::u16string_view  rString,
sal_Int32 &  nPos 
)
staticprivate

Read a sign with an exponent '+' => 1 '-' => -1 else => 0.

Definition at line 943 of file zforfind.cxx.

References nPos.

Referenced by ScanMidString().

◆ GetLogical()

short ImpSvNumberInputScan::GetLogical ( std::u16string_view  rString) const
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().

◆ GetMiddleMonthLongDateOrder()

LongDateOrder ImpSvNumberInputScan::GetMiddleMonthLongDateOrder ( bool  bFormatTurn,
const LocaleDataWrapper pLoc,
DateOrder  eDateOrder 
)
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().

◆ GetMonth()

short ImpSvNumberInputScan::GetMonth ( const OUString &  rString,
sal_Int32 &  nPos 
)
private

◆ GetNextNumber()

bool ImpSvNumberInputScan::GetNextNumber ( sal_uInt16 &  i,
sal_uInt16 &  j 
) const
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().

◆ GetNumericsCount()

sal_uInt16 ImpSvNumberInputScan::GetNumericsCount ( ) const
inline

after IsNumberFormat: get count of numeric substrings in input string

Definition at line 59 of file zforfind.hxx.

References nNumericsCnt.

◆ GetSign()

int ImpSvNumberInputScan::GetSign ( std::u16string_view  rString,
sal_Int32 &  nPos 
)
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().

◆ GetThousandSep()

bool ImpSvNumberInputScan::GetThousandSep ( std::u16string_view  rString,
sal_Int32 &  nPos,
sal_uInt16  nStringPos 
) const
inlineprivate

◆ GetTime100SecSep()

bool ImpSvNumberInputScan::GetTime100SecSep ( std::u16string_view  rString,
sal_Int32 &  nPos 
) const
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().

◆ GetTimeAmPm()

bool ImpSvNumberInputScan::GetTimeAmPm ( const OUString &  rString,
sal_Int32 &  nPos 
)
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().

◆ GetTimeRef()

bool ImpSvNumberInputScan::GetTimeRef ( double &  fOutNumber,
sal_uInt16  nIndex,
sal_uInt16  nCnt,
SvNumInputOptions  eInputOptions 
) const
private

Converts time -> double (only decimals)

Returns
TRUE if time, FALSE if not (e.g. hours >12 with AM/PM)

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().

◆ GetYear2000()

sal_uInt16 ImpSvNumberInputScan::GetYear2000 ( ) const
inline

get threshold of two-digit year input

Definition at line 64 of file zforfind.hxx.

References nYear2000.

◆ HasIso8601Tsep()

bool ImpSvNumberInputScan::HasIso8601Tsep ( ) const
inline

Whether 'T' separator was detected in an ISO 8601 date+time format.

Definition at line 76 of file zforfind.hxx.

References bIso8601Tsep.

◆ ImplGetDay()

sal_uInt16 ImpSvNumberInputScan::ImplGetDay ( sal_uInt16  nIndex) const
private

Definition at line 1060 of file zforfind.cxx.

References getLength(), nIndex, nNums, and sStrArray.

Referenced by GetDateRef(), and GetMiddleMonthLongDateOrder().

◆ ImplGetMonth()

sal_uInt16 ImpSvNumberInputScan::ImplGetMonth ( sal_uInt16  nIndex) const
private

◆ ImplGetYear()

sal_uInt16 ImpSvNumberInputScan::ImplGetYear ( sal_uInt16  nIndex)
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().

◆ InitText()

void ImpSvNumberInputScan::InitText ( )
private

◆ InvalidateDateAcceptancePatterns()

void ImpSvNumberInputScan::InvalidateDateAcceptancePatterns ( )

Definition at line 3824 of file zforfind.cxx.

References sDateAcceptancePatterns.

Referenced by ChangeIntl().

◆ IsAcceptableIso8601()

bool ImpSvNumberInputScan::IsAcceptableIso8601 ( )
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().

◆ IsAcceptedDatePattern()

bool ImpSvNumberInputScan::IsAcceptedDatePattern ( sal_uInt16  nStartPatternAt)
private

◆ IsDatePatternNumberOfType()

bool ImpSvNumberInputScan::IsDatePatternNumberOfType ( sal_uInt16  nNumber,
sal_Unicode  cType 
)
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().

◆ 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)

Parameters
F_Typeinput string
fOutNumberformat type (in + out)
pFormatvalue determined (out)
eInputOptionsnumber 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().

◆ IsNumberFormatMain()

bool ImpSvNumberInputScan::IsNumberFormatMain ( const OUString &  rString,
const SvNumberformat pFormat 
)
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().

◆ MatchedReturn()

bool ImpSvNumberInputScan::MatchedReturn ( )
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().

◆ MayBeIso8601()

bool ImpSvNumberInputScan::MayBeIso8601 ( )
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.

See also
nMayBeIso8601

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().

◆ MayBeMonthDate()

bool ImpSvNumberInputScan::MayBeMonthDate ( )
private

Whether input may be a dd-month-yy format, with month name, not number.

See also
nMayBeMonthDate

Definition at line 1215 of file zforfind.cxx.

References n, nMayBeMonthDate, nNumericsCnt, nNums, nStringsCnt, and sStrArray.

Referenced by GetMiddleMonthLongDateOrder(), ScanEndString(), and ScanMidString().

◆ NextNumberStringSymbol()

bool ImpSvNumberInputScan::NextNumberStringSymbol ( const sal_Unicode *&  pStr,
OUString &  rSymbol 
)
staticprivate

Definition at line 214 of file zforfind.cxx.

References isNumber.

Referenced by NumberStringDivision().

◆ NumberStringDivision()

void ImpSvNumberInputScan::NumberStringDivision ( const OUString &  rString)
private

◆ operator=()

ImpSvNumberInputScan & ImpSvNumberInputScan::operator= ( const ImpSvNumberInputScan )
privatedelete

◆ Reset()

void ImpSvNumberInputScan::Reset ( void  )
private

◆ ScanEndString()

bool ImpSvNumberInputScan::ScanEndString ( const OUString &  rString)
private

◆ ScanMidString()

bool ImpSvNumberInputScan::ScanMidString ( const OUString &  rString,
sal_uInt16  nStringPos,
sal_uInt16  nCurNumCount 
)
private

◆ ScanStartString()

bool ImpSvNumberInputScan::ScanStartString ( const OUString &  rString)
private

◆ ScanStringNumFor()

bool ImpSvNumberInputScan::ScanStringNumFor ( const OUString &  rString,
sal_Int32  nPos,
sal_uInt16  nString,
bool  bDontDetectNegation = false 
)
private

◆ SetYear2000()

void ImpSvNumberInputScan::SetYear2000 ( sal_uInt16  nVal)
inline

set threshold of two-digit year input

Definition at line 62 of file zforfind.hxx.

References nYear2000.

◆ SkipBlanks()

bool ImpSvNumberInputScan::SkipBlanks ( const OUString &  rString,
sal_Int32 &  nPos 
)
inlinestaticprivate

Skips blanks.

Definition at line 503 of file zforfind.cxx.

References cNarrowNoBreakSpace, cNoBreakSpace, nPos, and p.

Referenced by IsAcceptedDatePattern(), ScanEndString(), ScanMidString(), and ScanStartString().

◆ SkipChar()

bool ImpSvNumberInputScan::SkipChar ( sal_Unicode  c,
std::u16string_view  rString,
sal_Int32 &  nPos 
)
inlinestaticprivate

Skips the supplied char.

Definition at line 488 of file zforfind.cxx.

References nPos.

Referenced by ScanEndString(), ScanMidString(), and ScanStartString().

◆ SkipDatePatternSeparator()

bool ImpSvNumberInputScan::SkipDatePatternSeparator ( sal_uInt16  nParticle,
sal_Int32 &  rPos,
bool &  rSignedYear 
)
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

Returns
TRUE if separator matched.

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().

◆ SkipString()

bool ImpSvNumberInputScan::SkipString ( const OUString &  rWhat,
const OUString &  rString,
sal_Int32 &  nPos 
)
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().

◆ SkipThousands()

bool ImpSvNumberInputScan::SkipThousands ( const sal_Unicode *&  pStr,
OUString &  rSymbol 
) const
private

◆ StringContains()

static bool ImpSvNumberInputScan::StringContains ( const OUString &  rWhat,
const OUString &  rString,
sal_Int32  nPos 
)
inlinestaticprivate

Definition at line 225 of file zforfind.hxx.

References nPos, and StringContainsImpl().

Referenced by GetCurrency(), GetTimeAmPm(), ScanEndString(), and SkipString().

◆ StringContainsImpl()

bool ImpSvNumberInputScan::StringContainsImpl ( const OUString &  rWhat,
const OUString &  rString,
sal_Int32  nPos 
)
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().

◆ StringContainsWord()

bool ImpSvNumberInputScan::StringContainsWord ( const OUString &  rWhat,
const OUString &  rString,
sal_Int32  nPos 
) const
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().

◆ StringPtrContains()

static bool ImpSvNumberInputScan::StringPtrContains ( const OUString &  rWhat,
const sal_Unicode pString,
sal_Int32  nPos 
)
inlinestaticprivate

Definition at line 242 of file zforfind.hxx.

References nPos, and StringPtrContainsImpl().

Referenced by SkipThousands().

◆ StringPtrContainsImpl()

bool ImpSvNumberInputScan::StringPtrContainsImpl ( const OUString &  rWhat,
const sal_Unicode pString,
sal_Int32  nPos 
)
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().

◆ StringToDouble()

double ImpSvNumberInputScan::StringToDouble ( std::u16string_view  aStr,
bool  bForceFraction = false 
)
staticprivate

Only simple unsigned floating point values without any error detection, decimal separator has to be '.

'

Definition at line 156 of file zforfind.cxx.

References aStr, nPos, and p.

Referenced by GetTimeRef(), and IsNumberFormat().

Member Data Documentation

◆ aUpperCurrSymbol

OUString ImpSvNumberInputScan::aUpperCurrSymbol
private

Definition at line 89 of file zforfind.hxx.

Referenced by ChangeIntl(), and GetCurrency().

◆ bDecSepInDateSeps

bool ImpSvNumberInputScan::bDecSepInDateSeps
private

Definition at line 100 of file zforfind.hxx.

Referenced by ChangeIntl(), ScanEndString(), and ScanMidString().

◆ bIso8601Tsep

bool ImpSvNumberInputScan::bIso8601Tsep
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().

◆ bNegCheck

bool ImpSvNumberInputScan::bNegCheck
private

Definition at line 118 of file zforfind.hxx.

Referenced by GetSign(), IsNumberFormat(), IsNumberFormatMain(), Reset(), and ScanEndString().

◆ bScanGenitiveMonths

bool ImpSvNumberInputScan::bScanGenitiveMonths
private

Definition at line 91 of file zforfind.hxx.

Referenced by GetMonth(), and InitText().

◆ bScanPartitiveMonths

bool ImpSvNumberInputScan::bScanPartitiveMonths
private

Definition at line 92 of file zforfind.hxx.

Referenced by GetMonth(), and InitText().

◆ bTextInitialized

bool ImpSvNumberInputScan::bTextInitialized
private

Definition at line 90 of file zforfind.hxx.

Referenced by ChangeIntl(), GetDayOfWeek(), GetMonth(), and InitText().

◆ eScannedType

SvNumFormatType ImpSvNumberInputScan::eScannedType
private

◆ eSetType

SvNumFormatType ImpSvNumberInputScan::eSetType
private

Definition at line 126 of file zforfind.hxx.

Referenced by IsNumberFormat(), IsNumberFormatMain(), and ScanMidString().

◆ IsNum

bool ImpSvNumberInputScan::IsNum[SV_MAX_COUNT_INPUT_STRINGS]
private

◆ mbEraCE

bool ImpSvNumberInputScan::mbEraCE
private

Definition at line 122 of file zforfind.hxx.

Referenced by GetDateRef(), ImplGetYear(), IsNumberFormat(), Reset(), and ScanMidString().

◆ moNullDate

std::optional<Date> ImpSvNumberInputScan::moNullDate
private

Definition at line 93 of file zforfind.hxx.

Referenced by ChangeNullDate(), GetDateRef(), and ImpSvNumberInputScan().

◆ mpFormat

const SvNumberformat* ImpSvNumberInputScan::mpFormat
private

◆ nAcceptedDatePattern

sal_Int32 ImpSvNumberInputScan::nAcceptedDatePattern
private

Input matched this locale dependent date acceptance pattern.

-2 if not checked yet, -1 if no match, >=0 matched pattern.

See also
IsAcceptedDatePattern()

Definition at line 168 of file zforfind.hxx.

Referenced by GetDatePatternOrder(), IsAcceptedDatePattern(), IsDatePatternNumberOfType(), Reset(), and SkipDatePatternSeparator().

◆ nAmPm

short ImpSvNumberInputScan::nAmPm
private

Definition at line 120 of file zforfind.hxx.

Referenced by GetTimeAmPm(), GetTimeRef(), and Reset().

◆ nDatePatternNumbers

sal_uInt16 ImpSvNumberInputScan::nDatePatternNumbers
private

Count of numbers that matched the accepted pattern, if any, else 0.

See also
GetDatePatternNumbers()

Definition at line 182 of file zforfind.hxx.

Referenced by GetDatePatternNumbers(), IsAcceptedDatePattern(), and Reset().

◆ nDatePatternStart

sal_uInt16 ImpSvNumberInputScan::nDatePatternStart
private

If input matched a date acceptance pattern that starts at input particle sStrArray[nDatePatternStart].

See also
IsAcceptedDatePattern()

Definition at line 176 of file zforfind.hxx.

Referenced by IsAcceptedDatePattern(), Reset(), and SkipDatePatternSeparator().

◆ nDayOfWeek

int ImpSvNumberInputScan::nDayOfWeek
private

Definition at line 115 of file zforfind.hxx.

Referenced by IsNumberFormat(), Reset(), and ScanStartString().

◆ nDecPos

short ImpSvNumberInputScan::nDecPos
private

◆ nESign

short ImpSvNumberInputScan::nESign
private

Definition at line 119 of file zforfind.hxx.

Referenced by IsNumberFormat(), Reset(), and ScanMidString().

◆ nLogical

short ImpSvNumberInputScan::nLogical
private

Definition at line 121 of file zforfind.hxx.

Referenced by IsNumberFormat(), IsNumberFormatMain(), and Reset().

◆ nMatchedAllStrings

sal_uInt8 ImpSvNumberInputScan::nMatchedAllStrings
private

◆ nMatchedEndString

const sal_uInt8 ImpSvNumberInputScan::nMatchedEndString = 0x01
staticprivate

Definition at line 104 of file zforfind.hxx.

Referenced by ScanEndString().

◆ nMatchedMidString

const sal_uInt8 ImpSvNumberInputScan::nMatchedMidString = 0x02
staticprivate

Definition at line 105 of file zforfind.hxx.

Referenced by ScanMidString().

◆ nMatchedStartString

const sal_uInt8 ImpSvNumberInputScan::nMatchedStartString = 0x04
staticprivate

Definition at line 106 of file zforfind.hxx.

Referenced by ScanStartString().

◆ nMatchedUsedAsReturn

const sal_uInt8 ImpSvNumberInputScan::nMatchedUsedAsReturn = 0x10
staticprivate

Definition at line 108 of file zforfind.hxx.

Referenced by IsNumberFormatMain(), and MatchedReturn().

◆ nMatchedVirgin

const sal_uInt8 ImpSvNumberInputScan::nMatchedVirgin = 0x08
staticprivate

Definition at line 107 of file zforfind.hxx.

Referenced by MatchedReturn(), Reset(), and ScanMidString().

◆ nMayBeIso8601

sal_uInt8 ImpSvNumberInputScan::nMayBeIso8601
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

See also
MayBeIso8601()

Definition at line 147 of file zforfind.hxx.

Referenced by CanForceToIso8601(), MayBeIso8601(), and Reset().

◆ nMayBeMonthDate

sal_uInt8 ImpSvNumberInputScan::nMayBeMonthDate
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

See also
MayBeMonthDate()

Definition at line 161 of file zforfind.hxx.

Referenced by GetMiddleMonthLongDateOrder(), MayBeMonthDate(), and Reset().

◆ nMonth

int ImpSvNumberInputScan::nMonth
private

◆ nMonthPos

short ImpSvNumberInputScan::nMonthPos
private

◆ nNumericsCnt

sal_uInt16 ImpSvNumberInputScan::nNumericsCnt
private

◆ nNums

sal_uInt16 ImpSvNumberInputScan::nNums[SV_MAX_COUNT_INPUT_STRINGS]
private

◆ nPosThousandString

sal_uInt16 ImpSvNumberInputScan::nPosThousandString
private

Definition at line 124 of file zforfind.hxx.

Referenced by GetThousandSep(), NumberStringDivision(), and Reset().

◆ nSign

int ImpSvNumberInputScan::nSign
private

◆ nStringScanNumFor

sal_uInt16 ImpSvNumberInputScan::nStringScanNumFor
private

Definition at line 128 of file zforfind.hxx.

Referenced by GetDateRef(), IsNumberFormatMain(), Reset(), and ScanStringNumFor().

◆ nStringScanSign

short ImpSvNumberInputScan::nStringScanSign
private

Definition at line 130 of file zforfind.hxx.

Referenced by IsNumberFormat(), Reset(), and ScanStringNumFor().

◆ nStringsCnt

sal_uInt16 ImpSvNumberInputScan::nStringsCnt
private

◆ nThousand

sal_uInt16 ImpSvNumberInputScan::nThousand
private

Definition at line 123 of file zforfind.hxx.

Referenced by IsNumberFormat(), IsNumberFormatMain(), Reset(), and ScanMidString().

◆ nTimePos

sal_uInt16 ImpSvNumberInputScan::nTimePos
private

Definition at line 116 of file zforfind.hxx.

Referenced by GetDateRef(), Reset(), ScanEndString(), and ScanMidString().

◆ nYear2000

sal_uInt16 ImpSvNumberInputScan::nYear2000
private

Definition at line 131 of file zforfind.hxx.

Referenced by GetYear2000(), ImplGetYear(), ImpSvNumberInputScan(), and SetYear2000().

◆ pFormatter

SvNumberFormatter* ImpSvNumberInputScan::pFormatter
private

◆ pUpperAbbrevDayText

std::unique_ptr<OUString[]> ImpSvNumberInputScan::pUpperAbbrevDayText
private

Definition at line 88 of file zforfind.hxx.

Referenced by GetDayOfWeek(), and InitText().

◆ pUpperAbbrevMonthText

std::unique_ptr<OUString[]> ImpSvNumberInputScan::pUpperAbbrevMonthText
private

Definition at line 82 of file zforfind.hxx.

Referenced by GetMonth(), and InitText().

◆ pUpperDayText

std::unique_ptr<OUString[]> ImpSvNumberInputScan::pUpperDayText
private

Definition at line 87 of file zforfind.hxx.

Referenced by GetDayOfWeek(), and InitText().

◆ pUpperGenitiveAbbrevMonthText

std::unique_ptr<OUString[]> ImpSvNumberInputScan::pUpperGenitiveAbbrevMonthText
private

Definition at line 84 of file zforfind.hxx.

Referenced by GetMonth(), and InitText().

◆ pUpperGenitiveMonthText

std::unique_ptr<OUString[]> ImpSvNumberInputScan::pUpperGenitiveMonthText
private

Definition at line 83 of file zforfind.hxx.

Referenced by GetMonth(), and InitText().

◆ pUpperMonthText

std::unique_ptr<OUString[]> ImpSvNumberInputScan::pUpperMonthText
private

Definition at line 81 of file zforfind.hxx.

Referenced by GetMonth(), and InitText().

◆ pUpperPartitiveAbbrevMonthText

std::unique_ptr<OUString[]> ImpSvNumberInputScan::pUpperPartitiveAbbrevMonthText
private

Definition at line 86 of file zforfind.hxx.

Referenced by GetMonth(), and InitText().

◆ pUpperPartitiveMonthText

std::unique_ptr<OUString[]> ImpSvNumberInputScan::pUpperPartitiveMonthText
private

Definition at line 85 of file zforfind.hxx.

Referenced by GetMonth(), and InitText().

◆ sDateAcceptancePatterns

css::uno::Sequence< OUString > ImpSvNumberInputScan::sDateAcceptancePatterns
private

◆ sStrArray

OUString ImpSvNumberInputScan::sStrArray[SV_MAX_COUNT_INPUT_STRINGS]
private

The documentation for this class was generated from the following files: