LibreOffice Module sax (master) 1
Classes | Functions | Variables
sax Namespace Reference

Classes

class  Converter
 the Converter converts values of various types from their internal representation to the textual form used in xml and back. More...
 
class  DocumentHandlerAdapter
 DocumentHandlerAdapter provides a base class for simple decorators to XDocumentHandlers. More...
 
class  ExtendedDocumentHandlerAdapter
 ExtendedDocumentHandlerAdapter provides a base class for simple decorators to XExtendedDocumentHandlers. More...
 

Functions

static sal_Int64 toInt64_WithLength (const sal_Unicode *str, sal_Int16 radix, sal_Int32 nStrLength)
 
static sal_Int64 toInt64_WithLength (const char *str, sal_Int16 radix, sal_Int32 nStrLength)
 
template<typename V >
static bool lcl_convertMeasure (sal_Int32 &rValue, V rString, sal_Int16 nTargetUnit, sal_Int32 nMin, sal_Int32 nMax)
 convert string to measure using optional min and max values More...
 
static int lcl_gethex (int nChar)
 
template<typename V >
static bool lcl_convertColor (sal_Int32 &rColor, V rValue)
 convert string to rgb color More...
 
template<typename V >
static bool lcl_convertNumber64 (sal_Int64 &rValue, V aString, sal_Int64 nMin, sal_Int64 nMax)
 convert string to 64-bit number with optional min and max values More...
 
template<typename V >
static bool convertDurationHelper (double &rfTime, V pStr)
 helper function of Converter::convertDuration More...
 
template<typename V >
static Result readUnsignedNumber (V rString, size_t &io_rnPos, sal_Int32 &o_rNumber)
 
template<typename V >
static Result readUnsignedNumberMaxDigits (int maxDigits, V rString, size_t &io_rnPos, sal_Int32 &o_rNumber)
 
template<typename V >
static bool readDurationT (V rString, size_t &io_rnPos)
 
template<typename V >
static bool readDurationComponent (V rString, size_t &io_rnPos, sal_Int32 &io_rnTemp, bool &io_rbTimePart, sal_Int32 &o_rnTarget, const sal_Unicode cLower, const sal_Unicode cUpper)
 
template<typename V >
static bool convertDurationHelper (util::Duration &rDuration, V string)
 
static void lcl_AppendTimezone (OUStringBuffer &i_rBuffer, int const nOffset)
 
static void convertTime (OUStringBuffer &i_rBuffer, const css::util::DateTime &i_rDateTime)
 
static void convertTimeZone (OUStringBuffer &i_rBuffer, const css::util::DateTime &i_rDateTime, sal_Int16 const *pTimeZoneOffset)
 
static bool lcl_isLeapYear (const sal_uInt32 nYear)
 
static sal_uInt16 lcl_MaxDaysPerMonth (const sal_Int32 nMonth, const sal_Int32 nYear)
 
static void lcl_ConvertToUTC (sal_Int16 &o_rYear, sal_uInt16 &o_rMonth, sal_uInt16 &o_rDay, sal_uInt16 &o_rHours, sal_uInt16 &o_rMinutes, int const nSourceOffset)
 
template<typename V >
static bool readDateTimeComponent (V rString, size_t &io_rnPos, sal_Int32 &o_rnTarget, const sal_Int32 nMinLength, const bool bExactLength)
 
template<typename V >
static bool lcl_parseDate (bool &isNegative, sal_Int32 &nYear, sal_Int32 &nMonth, sal_Int32 &nDay, bool &bHaveTime, size_t &nPos, V string, bool const bIgnoreInvalidOrMissingDate)
 convert ISO "date" or "dateTime" string to util::DateTime or util::Date More...
 
template<typename V >
static bool lcl_parseDateTime (util::Date *const pDate, util::DateTime &rDateTime, bool &rbDateTime, std::optional< sal_Int16 > *const pTimeZoneOffset, V string, bool const bIgnoreInvalidOrMissingDate)
 convert ISO "date" or "dateTime" string to util::DateTime or util::Date More...
 
template<typename V >
static sal_Int16 lcl_GetUnitFromString (V rString, sal_Int16 nDefaultUnit)
 

Variables

const std::string_view gpsMM = "mm"
 
const std::string_view gpsCM = "cm"
 
const std::string_view gpsPT = "pt"
 
const std::string_view gpsINCH = "in"
 
const std::string_view gpsPC = "pc"
 
const sal_Int8 XML_MAXDIGITSCOUNT_TIME = 14
 
const char aHexTab [] = "0123456789abcdef"
 

Function Documentation

◆ convertDurationHelper() [1/2]

template<typename V >
static bool sax::convertDurationHelper ( double &  rfTime,
pStr 
)
static

helper function of Converter::convertDuration

how many days is a year or month?

Definition at line 918 of file converter.cxx.

References SAL_MAX_INT32, o3tl::toDouble(), and u.

Referenced by sax::Converter::convertDuration().

◆ convertDurationHelper() [2/2]

template<typename V >
static bool sax::convertDurationHelper ( util::Duration &  rDuration,
string 
)
static

last read number; -1 == no valid number! always reset after using!

Definition at line 1245 of file converter.cxx.

References nPos, readDurationComponent(), readDurationT(), readUnsignedNumber(), readUnsignedNumberMaxDigits(), and size.

◆ convertTime()

static void sax::convertTime ( OUStringBuffer &  i_rBuffer,
const css::util::DateTime &  i_rDateTime 
)
static

◆ convertTimeZone()

static void sax::convertTimeZone ( OUStringBuffer &  i_rBuffer,
const css::util::DateTime &  i_rDateTime,
sal_Int16 const *  pTimeZoneOffset 
)
static

◆ lcl_AppendTimezone()

static void sax::lcl_AppendTimezone ( OUStringBuffer &  i_rBuffer,
int const  nOffset 
)
static

Definition at line 1417 of file converter.cxx.

References abs(), and SAL_WARN_IF.

Referenced by convertTimeZone().

◆ lcl_convertColor()

template<typename V >
static bool sax::lcl_convertColor ( sal_Int32 &  rColor,
rValue 
)
static

convert string to rgb color

Definition at line 513 of file converter.cxx.

References lcl_gethex().

Referenced by sax::Converter::convertColor().

◆ lcl_convertMeasure()

template<typename V >
static bool sax::lcl_convertMeasure ( sal_Int32 &  rValue,
rString,
sal_Int16  nTargetUnit,
sal_Int32  nMin,
sal_Int32  nMax 
)
static

convert string to measure using optional min and max values

Definition at line 126 of file converter.cxx.

References o3tl::cm, o3tl::convert(), o3tl::in, o3tl::invalid, o3tl::mm, nPos, o3tl::pc, o3tl::pt, o3tl::px, and u.

Referenced by sax::Converter::convertMeasure().

◆ lcl_convertNumber64()

template<typename V >
static bool sax::lcl_convertNumber64 ( sal_Int64 &  rValue,
aString,
sal_Int64  nMin,
sal_Int64  nMax 
)
static

convert string to 64-bit number with optional min and max values

Definition at line 589 of file converter.cxx.

References nPos, and toInt64_WithLength().

Referenced by sax::Converter::convertNumber64().

◆ lcl_ConvertToUTC()

static void sax::lcl_ConvertToUTC ( sal_Int16 &  o_rYear,
sal_uInt16 &  o_rMonth,
sal_uInt16 &  o_rDay,
sal_uInt16 &  o_rHours,
sal_uInt16 &  o_rMinutes,
int const  nSourceOffset 
)
static

Definition at line 1604 of file converter.cxx.

References abs(), and lcl_MaxDaysPerMonth().

Referenced by lcl_parseDateTime().

◆ lcl_gethex()

static int sax::lcl_gethex ( int  nChar)
static

Definition at line 499 of file converter.cxx.

Referenced by lcl_convertColor().

◆ lcl_GetUnitFromString()

template<typename V >
static sal_Int16 sax::lcl_GetUnitFromString ( rString,
sal_Int16  nDefaultUnit 
)
static

Definition at line 2134 of file converter.cxx.

References nPos.

Referenced by sax::Converter::GetUnitFromString().

◆ lcl_isLeapYear()

static bool sax::lcl_isLeapYear ( const sal_uInt32  nYear)
static

Definition at line 1585 of file converter.cxx.

Referenced by lcl_MaxDaysPerMonth().

◆ lcl_MaxDaysPerMonth()

static sal_uInt16 sax::lcl_MaxDaysPerMonth ( const sal_Int32  nMonth,
const sal_Int32  nYear 
)
static

Definition at line 1592 of file converter.cxx.

References lcl_isLeapYear().

Referenced by lcl_ConvertToUTC(), and lcl_parseDate().

◆ lcl_parseDate()

template<typename V >
static bool sax::lcl_parseDate ( bool &  isNegative,
sal_Int32 &  nYear,
sal_Int32 &  nMonth,
sal_Int32 &  nDay,
bool &  bHaveTime,
size_t &  nPos,
string,
bool const  bIgnoreInvalidOrMissingDate 
)
static

convert ISO "date" or "dateTime" string to util::DateTime or util::Date

Definition at line 1712 of file converter.cxx.

References lcl_MaxDaysPerMonth(), nPos, readDateTimeComponent(), and size.

◆ lcl_parseDateTime()

template<typename V >
static bool sax::lcl_parseDateTime ( util::Date *const  pDate,
util::DateTime &  rDateTime,
bool &  rbDateTime,
std::optional< sal_Int16 > *const  pTimeZoneOffset,
string,
bool const  bIgnoreInvalidOrMissingDate 
)
static

convert ISO "date" or "dateTime" string to util::DateTime or util::Date

Definition at line 1792 of file converter.cxx.

References find(), lcl_ConvertToUTC(), nPos, readDateTimeComponent(), SAL_INFO, size, and o3tl::trim().

◆ readDateTimeComponent()

template<typename V >
static bool sax::readDateTimeComponent ( rString,
size_t &  io_rnPos,
sal_Int32 &  o_rnTarget,
const sal_Int32  nMinLength,
const bool  bExactLength 
)
static

Definition at line 1690 of file converter.cxx.

Referenced by lcl_parseDate(), and lcl_parseDateTime().

◆ readDurationComponent()

template<typename V >
static bool sax::readDurationComponent ( rString,
size_t &  io_rnPos,
sal_Int32 &  io_rnTemp,
bool &  io_rbTimePart,
sal_Int32 &  o_rnTarget,
const sal_Unicode  cLower,
const sal_Unicode  cUpper 
)
static

Definition at line 1215 of file converter.cxx.

References readDurationT(), and readUnsignedNumber().

Referenced by convertDurationHelper().

◆ readDurationT()

template<typename V >
static bool sax::readDurationT ( rString,
size_t &  io_rnPos 
)
static

Definition at line 1202 of file converter.cxx.

Referenced by convertDurationHelper(), and readDurationComponent().

◆ readUnsignedNumber()

template<typename V >
static Result sax::readUnsignedNumber ( rString,
size_t &  io_rnPos,
sal_Int32 &  o_rNumber 
)
static

Definition at line 1127 of file converter.cxx.

References nPos, SAL_MAX_INT32, and toInt64_WithLength().

Referenced by convertDurationHelper(), and readDurationComponent().

◆ readUnsignedNumberMaxDigits()

template<typename V >
static Result sax::readUnsignedNumberMaxDigits ( int  maxDigits,
rString,
size_t &  io_rnPos,
sal_Int32 &  o_rNumber 
)
static

Definition at line 1157 of file converter.cxx.

References nPos, SAL_MAX_INT32, and u.

Referenced by convertDurationHelper().

◆ toInt64_WithLength() [1/2]

static sal_Int64 sax::toInt64_WithLength ( const char *  str,
sal_Int16  radix,
sal_Int32  nStrLength 
)
static

Definition at line 62 of file converter.cxx.

◆ toInt64_WithLength() [2/2]

static sal_Int64 sax::toInt64_WithLength ( const sal_Unicode str,
sal_Int16  radix,
sal_Int32  nStrLength 
)
static

Definition at line 58 of file converter.cxx.

Referenced by lcl_convertNumber64(), and readUnsignedNumber().

Variable Documentation

◆ aHexTab

const char sax::aHexTab[] = "0123456789abcdef"

Definition at line 541 of file converter.cxx.

Referenced by sax::Converter::convertColor().

◆ gpsCM

const std::string_view sax::gpsCM = "cm"

Definition at line 51 of file converter.cxx.

Referenced by sax::Converter::convertMeasure().

◆ gpsINCH

const std::string_view sax::gpsINCH = "in"

Definition at line 53 of file converter.cxx.

Referenced by sax::Converter::convertMeasure().

◆ gpsMM

const std::string_view sax::gpsMM = "mm"

Definition at line 50 of file converter.cxx.

Referenced by sax::Converter::convertMeasure().

◆ gpsPC

const std::string_view sax::gpsPC = "pc"

Definition at line 54 of file converter.cxx.

◆ gpsPT

const std::string_view sax::gpsPT = "pt"

Definition at line 52 of file converter.cxx.

Referenced by sax::Converter::convertMeasure().

◆ XML_MAXDIGITSCOUNT_TIME

const sal_Int8 sax::XML_MAXDIGITSCOUNT_TIME = 14

Definition at line 56 of file converter.cxx.

Referenced by sax::Converter::convertDuration().