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

#include <sbxform.hxx>

Public Member Functions

 SbxBasicFormater (sal_Unicode _cDecPoint, sal_Unicode _cThousandSep, OUString _sOnStrg, OUString _sOffStrg, OUString _sYesStrg, OUString _sNoStrg, OUString _sTrueStrg, OUString _sFalseStrg, OUString _sCurrencyStrg, OUString _sCurrencyFormatStrg)
 
OUString BasicFormat (double dNumber, const OUString &sFormatStrg)
 

Static Public Member Functions

static OUString BasicFormatNull (std::u16string_view sFormatStrg)
 
static bool isBasicFormat (std::u16string_view sFormatStrg)
 

Private Member Functions

void LeftShiftDecimalPoint (OUStringBuffer &sStrg)
 
void StrRoundDigit (OUStringBuffer &sStrg, short nPos, bool &bOverflow)
 
void StrRoundDigit (OUStringBuffer &sStrg, short nPos)
 
void InitScan (double _dNum)
 
void InitExp (double _dNewExp)
 
short GetDigitAtPosScan (short nPos, bool &bFoundFirstDigit)
 
short GetDigitAtPosExpScan (double dNewExponent, short nPos, bool &bFoundFirstDigit)
 
short GetDigitAtPosExpScan (short nPos, bool &bFoundFirstDigit)
 
void ScanFormatString (double dNumber, std::u16string_view sFormatStrg, OUString &sReturnStrg, bool bCreateSign)
 

Static Private Member Functions

static void ShiftString (OUStringBuffer &sStrg, sal_uInt16 nStartPos)
 
static void AppendDigit (OUStringBuffer &sStrg, short nDigit)
 
static void ParseBack (OUStringBuffer &sStrg, std::u16string_view sFormatStrg, short nFormatPos)
 
static OUString GetPosFormatString (std::u16string_view sFormatStrg, bool &bFound)
 
static OUString GetNegFormatString (std::u16string_view sFormatStrg, bool &bFound)
 
static OUString Get0FormatString (std::u16string_view sFormatStrg, bool &bFound)
 
static OUString GetNullFormatString (std::u16string_view sFormatStrg, bool &bFound)
 
static void AnalyseFormatString (std::u16string_view sFormatStrg, short &nNoOfDigitsLeft, short &nNoOfDigitsRight, short &nNoOfOptionalDigitsLeft, short &nNoOfExponentDigits, short &nNoOfOptionalExponentDigits, bool &bPercent, bool &bCurrency, bool &bScientific, bool &bGenerateThousandSeparator, short &nMultipleThousandSeparators)
 

Private Attributes

sal_Unicode cDecPoint
 
sal_Unicode cThousandSep
 
OUString sOnStrg
 
OUString sOffStrg
 
OUString sYesStrg
 
OUString sNoStrg
 
OUString sTrueStrg
 
OUString sFalseStrg
 
OUString sCurrencyStrg
 
OUString sCurrencyFormatStrg
 
OUString sSciNumStrg
 
OUString sNumExpStrg
 
double dNum
 
short nNumExp
 
short nExpExp
 

Detailed Description

Definition at line 72 of file sbxform.hxx.

Constructor & Destructor Documentation

◆ SbxBasicFormater()

SbxBasicFormater::SbxBasicFormater ( sal_Unicode  _cDecPoint,
sal_Unicode  _cThousandSep,
OUString  _sOnStrg,
OUString  _sOffStrg,
OUString  _sYesStrg,
OUString  _sNoStrg,
OUString  _sTrueStrg,
OUString  _sFalseStrg,
OUString  _sCurrencyStrg,
OUString  _sCurrencyFormatStrg 
)

Definition at line 97 of file sbxform.cxx.

Member Function Documentation

◆ AnalyseFormatString()

void SbxBasicFormater::AnalyseFormatString ( std::u16string_view  sFormatStrg,
short &  nNoOfDigitsLeft,
short &  nNoOfDigitsRight,
short &  nNoOfOptionalDigitsLeft,
short &  nNoOfExponentDigits,
short &  nNoOfOptionalExponentDigits,
bool &  bPercent,
bool &  bCurrency,
bool &  bScientific,
bool &  bGenerateThousandSeparator,
short &  nMultipleThousandSeparators 
)
staticprivate

Definition at line 401 of file sbxform.cxx.

References ch, CREATE_1000SEP_CHAR, i, and nState.

Referenced by ScanFormatString().

◆ AppendDigit()

void SbxBasicFormater::AppendDigit ( OUStringBuffer &  sStrg,
short  nDigit 
)
staticprivate

Definition at line 132 of file sbxform.cxx.

Referenced by ScanFormatString().

◆ BasicFormat()

OUString SbxBasicFormater::BasicFormat ( double  dNumber,
const OUString &  sFormatStrg 
)

◆ BasicFormatNull()

OUString SbxBasicFormater::BasicFormatNull ( std::u16string_view  sFormatStrg)
static

Definition at line 845 of file sbxform.cxx.

References GetNullFormatString().

Referenced by SbxValue::Format().

◆ Get0FormatString()

OUString SbxBasicFormater::Get0FormatString ( std::u16string_view  sFormatStrg,
bool &  bFound 
)
staticprivate

Definition at line 343 of file sbxform.cxx.

References FORMAT_SEPARATOR, and nPos.

Referenced by BasicFormat().

◆ GetDigitAtPosExpScan() [1/2]

short SbxBasicFormater::GetDigitAtPosExpScan ( double  dNewExponent,
short  nPos,
bool &  bFoundFirstDigit 
)
private

Definition at line 291 of file sbxform.cxx.

References GetDigitAtPosExpScan(), InitExp(), and nPos.

Referenced by GetDigitAtPosExpScan(), and ScanFormatString().

◆ GetDigitAtPosExpScan() [2/2]

short SbxBasicFormater::GetDigitAtPosExpScan ( short  nPos,
bool &  bFoundFirstDigit 
)
private

Definition at line 276 of file sbxform.cxx.

References nExpExp, nPos, and sNumExpStrg.

◆ GetDigitAtPosScan()

short SbxBasicFormater::GetDigitAtPosScan ( short  nPos,
bool &  bFoundFirstDigit 
)
private

Definition at line 253 of file sbxform.cxx.

References abs(), MAX_NO_OF_DIGITS, nNumExp, NO_DIGIT_, nPos, and sSciNumStrg.

Referenced by ScanFormatString().

◆ GetNegFormatString()

OUString SbxBasicFormater::GetNegFormatString ( std::u16string_view  sFormatStrg,
bool &  bFound 
)
staticprivate

Definition at line 318 of file sbxform.cxx.

References FORMAT_SEPARATOR, and nPos.

Referenced by BasicFormat().

◆ GetNullFormatString()

OUString SbxBasicFormater::GetNullFormatString ( std::u16string_view  sFormatStrg,
bool &  bFound 
)
staticprivate

Definition at line 374 of file sbxform.cxx.

References FORMAT_SEPARATOR, and nPos.

Referenced by BasicFormatNull().

◆ GetPosFormatString()

OUString SbxBasicFormater::GetPosFormatString ( std::u16string_view  sFormatStrg,
bool &  bFound 
)
staticprivate

Definition at line 301 of file sbxform.cxx.

References FORMAT_SEPARATOR, and nPos.

Referenced by BasicFormat().

◆ InitExp()

void SbxBasicFormater::InitExp ( double  _dNewExp)
private

Definition at line 244 of file sbxform.cxx.

References get_number_of_digits(), nExpExp, nNumExp, sNumExpStrg, and u.

Referenced by GetDigitAtPosExpScan(), and InitScan().

◆ InitScan()

void SbxBasicFormater::InitScan ( double  _dNum)
private

◆ isBasicFormat()

bool SbxBasicFormater::isBasicFormat ( std::u16string_view  sFormatStrg)
static

◆ LeftShiftDecimalPoint()

void SbxBasicFormater::LeftShiftDecimalPoint ( OUStringBuffer &  sStrg)
private

Definition at line 140 of file sbxform.cxx.

References cDecPoint, i, and nPos.

Referenced by ScanFormatString().

◆ ParseBack()

void SbxBasicFormater::ParseBack ( OUStringBuffer &  sStrg,
std::u16string_view  sFormatStrg,
short  nFormatPos 
)
staticprivate

Definition at line 221 of file sbxform.cxx.

References i.

Referenced by ScanFormatString().

◆ ScanFormatString()

void SbxBasicFormater::ScanFormatString ( double  dNumber,
std::u16string_view  sFormatStrg,
OUString &  sReturnStrg,
bool  bCreateSign 
)
private

◆ ShiftString()

void SbxBasicFormater::ShiftString ( OUStringBuffer &  sStrg,
sal_uInt16  nStartPos 
)
inlinestaticprivate

Definition at line 127 of file sbxform.cxx.

Referenced by StrRoundDigit().

◆ StrRoundDigit() [1/2]

void SbxBasicFormater::StrRoundDigit ( OUStringBuffer &  sStrg,
short  nPos 
)
private

Definition at line 214 of file sbxform.cxx.

References nPos, and StrRoundDigit().

◆ StrRoundDigit() [2/2]

void SbxBasicFormater::StrRoundDigit ( OUStringBuffer &  sStrg,
short  nPos,
bool &  bOverflow 
)
private

Definition at line 160 of file sbxform.cxx.

References cDecPoint, cThousandSep, nPos, ShiftString(), and StrRoundDigit().

Referenced by ScanFormatString(), and StrRoundDigit().

Member Data Documentation

◆ cDecPoint

sal_Unicode SbxBasicFormater::cDecPoint
private

Definition at line 131 of file sbxform.hxx.

Referenced by LeftShiftDecimalPoint(), ScanFormatString(), and StrRoundDigit().

◆ cThousandSep

sal_Unicode SbxBasicFormater::cThousandSep
private

Definition at line 132 of file sbxform.hxx.

Referenced by ScanFormatString(), and StrRoundDigit().

◆ dNum

double SbxBasicFormater::dNum
private

Definition at line 149 of file sbxform.hxx.

Referenced by InitScan().

◆ nExpExp

short SbxBasicFormater::nExpExp
private

Definition at line 151 of file sbxform.hxx.

Referenced by GetDigitAtPosExpScan(), and InitExp().

◆ nNumExp

short SbxBasicFormater::nNumExp
private

Definition at line 150 of file sbxform.hxx.

Referenced by GetDigitAtPosScan(), and InitExp().

◆ sCurrencyFormatStrg

OUString SbxBasicFormater::sCurrencyFormatStrg
private

Definition at line 141 of file sbxform.hxx.

Referenced by BasicFormat().

◆ sCurrencyStrg

OUString SbxBasicFormater::sCurrencyStrg
private

Definition at line 140 of file sbxform.hxx.

Referenced by ScanFormatString().

◆ sFalseStrg

OUString SbxBasicFormater::sFalseStrg
private

Definition at line 139 of file sbxform.hxx.

Referenced by BasicFormat().

◆ sNoStrg

OUString SbxBasicFormater::sNoStrg
private

Definition at line 137 of file sbxform.hxx.

Referenced by BasicFormat().

◆ sNumExpStrg

OUString SbxBasicFormater::sNumExpStrg
private

Definition at line 148 of file sbxform.hxx.

Referenced by GetDigitAtPosExpScan(), and InitExp().

◆ sOffStrg

OUString SbxBasicFormater::sOffStrg
private

Definition at line 135 of file sbxform.hxx.

Referenced by BasicFormat().

◆ sOnStrg

OUString SbxBasicFormater::sOnStrg
private

Definition at line 134 of file sbxform.hxx.

Referenced by BasicFormat().

◆ sSciNumStrg

OUString SbxBasicFormater::sSciNumStrg
private

Definition at line 146 of file sbxform.hxx.

Referenced by GetDigitAtPosScan(), and InitScan().

◆ sTrueStrg

OUString SbxBasicFormater::sTrueStrg
private

Definition at line 138 of file sbxform.hxx.

Referenced by BasicFormat().

◆ sYesStrg

OUString SbxBasicFormater::sYesStrg
private

Definition at line 136 of file sbxform.hxx.

Referenced by BasicFormat().


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