LibreOffice Module sax (master) 1
|
the Converter converts values of various types from their internal representation to the textual form used in xml and back. More...
#include <converter.hxx>
Static Public Member Functions | |
static bool | convertMeasure (sal_Int32 &rValue, std::u16string_view rString, sal_Int16 nTargetUnit=css::util::MeasureUnit::MM_100TH, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32) |
convert string to measure using optional min and max values More... | |
static bool | convertMeasure (sal_Int32 &rValue, std::string_view rString, sal_Int16 nTargetUnit=css::util::MeasureUnit::MM_100TH, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32) |
convert string to measure using optional min and max values More... | |
static void | convertMeasure (OUStringBuffer &rBuffer, sal_Int32 nMeasure, sal_Int16 SourceUnit, sal_Int16 nTargetUnit) |
convert measure to string More... | |
static bool | convertBool (bool &rBool, std::u16string_view rString) |
convert string to boolean More... | |
static bool | convertBool (bool &rBool, std::string_view rString) |
convert string to boolean More... | |
static void | convertBool (OUStringBuffer &rBuffer, bool bValue) |
convert boolean to string More... | |
static bool | convertPercent (sal_Int32 &rValue, std::u16string_view rString) |
convert string to percent More... | |
static bool | convertPercent (sal_Int32 &rValue, std::string_view rString) |
convert string to percent More... | |
static void | convertPercent (OUStringBuffer &rBuffer, sal_Int32 nValue) |
convert percent to string More... | |
static bool | convertMeasurePx (sal_Int32 &rValue, std::u16string_view rString) |
convert string to pixel measure unit More... | |
static bool | convertMeasurePx (sal_Int32 &rValue, std::string_view rString) |
convert string to pixel measure unit More... | |
static void | convertMeasurePx (OUStringBuffer &rBuffer, sal_Int32 nValue) |
convert pixel measure unit to string More... | |
static bool | convertColor (sal_Int32 &rColor, std::u16string_view rValue) |
convert string to rgb color More... | |
static bool | convertColor (sal_Int32 &rColor, std::string_view rValue) |
convert string to rgb color More... | |
static bool | convertColor (::Color &rColor, std::u16string_view rValue) |
static bool | convertColor (::Color &rColor, std::string_view rValue) |
static void | convertColor (OUStringBuffer &rBuffer, sal_Int32 nColor) |
convert color to string More... | |
static void | convertColor (OUStringBuffer &rBuffer, ::Color nColor) |
static bool | convertNumber (sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32) |
convert string to number with optional min and max values More... | |
static bool | convertNumber (sal_Int32 &rValue, std::string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32) |
convert string to number with optional min and max values More... | |
static bool | convertNumber64 (sal_Int64 &rValue, std::u16string_view aString, sal_Int64 nMin=SAL_MIN_INT64, sal_Int64 nMax=SAL_MAX_INT64) |
convert string to number with optional min and max values More... | |
static bool | convertNumber64 (sal_Int64 &rValue, std::string_view aString, sal_Int64 nMin=SAL_MIN_INT64, sal_Int64 nMax=SAL_MAX_INT64) |
convert string to number with optional min and max values More... | |
static void | convertDouble (OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit) |
convert double number to string (using ::rtl::math) and DO convert from source unit to target unit More... | |
static void | convertDouble (OUStringBuffer &rBuffer, double fNumber) |
convert double number to string (using ::rtl::math) without unit conversion More... | |
static bool | convertDouble (double &rValue, std::u16string_view rString, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit) |
convert string to double number (using ::rtl::math) and DO convert from source unit to target unit. More... | |
static bool | convertDouble (double &rValue, std::string_view rString, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit) |
convert string to double number (using ::rtl::math) and DO convert from source unit to target unit. More... | |
static bool | convertDouble (double &rValue, std::u16string_view rString) |
convert string to double number (using ::rtl::math) without unit conversion More... | |
static bool | convertDouble (double &rValue, std::string_view rString) |
convert string to double number (using ::rtl::math) without unit conversion More... | |
static void | convertAngle (OUStringBuffer &rBuffer, sal_Int16 nAngle, SvtSaveOptions::ODFSaneDefaultVersion nVersion) |
convert number, 10th of degrees with range [0..3600] to SVG angle More... | |
static bool | convertAngle (sal_Int16 &rAngle, std::u16string_view rString, bool isWrongOOo10thDegAngle) |
convert SVG angle to number, 10th of degrees with range [0..3600] More... | |
static bool | convertAngle (sal_Int16 &rAngle, std::string_view rString, bool isWrongOOo10thDegAngle) |
convert SVG angle to number, 10th of degrees with range [0..3600] More... | |
static void | convertDuration (OUStringBuffer &rBuffer, const double fTime) |
convert double to XMLSchema-2 "duration" string; negative durations allowed More... | |
static void | convertDuration (OUStringBuffer &rBuffer, const css::util::Duration &rDuration) |
convert util::Duration to XMLSchema-2 "duration" string More... | |
static bool | convertDuration (double &rfTime, std::string_view rString) |
convert XMLSchema-2 "duration" string to double; negative durations allowed More... | |
static bool | convertDuration (css::util::Duration &rDuration, std::u16string_view rString) |
convert XMLSchema-2 "duration" string to util::Duration More... | |
static bool | convertDuration (css::util::Duration &rDuration, std::string_view rString) |
convert XMLSchema-2 "duration" string to util::Duration More... | |
static void | convertDate (OUStringBuffer &rBuffer, const css::util::Date &rDate, sal_Int16 const *pTimeZoneOffset) |
convert util::Date to XMLSchema-2 "date" string More... | |
static void | convertDateTime (OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime, sal_Int16 const *pTimeZoneOffset, bool bAddTimeIf0AM=false) |
convert util::DateTime to XMLSchema-2 "date" or "dateTime" string More... | |
static void | convertTimeOrDateTime (OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime) |
convert util::DateTime to XMLSchema-2 "time" or "dateTime" string More... | |
static bool | parseDateTime (css::util::DateTime &rDateTime, std::u16string_view rString) |
convert XMLSchema-2 "date" or "dateTime" string to util::DateTime More... | |
static bool | parseDateTime (css::util::DateTime &rDateTime, std::string_view rString) |
convert XMLSchema-2 "date" or "dateTime" string to util::DateTime More... | |
static bool | parseTimeOrDateTime (css::util::DateTime &rDateTime, std::u16string_view rString) |
convert XMLSchema-2 "time" or "dateTime" string to util::DateTime More... | |
static bool | parseTimeOrDateTime (css::util::DateTime &rDateTime, std::string_view rString) |
convert XMLSchema-2 "time" or "dateTime" string to util::DateTime More... | |
static bool | parseDateOrDateTime (css::util::Date *pDate, css::util::DateTime &rDateTime, bool &rbDateTime, std::optional< sal_Int16 > *pTimeZoneOffset, std::u16string_view rString) |
convert XMLSchema-2 "date" or "dateTime" string to util::DateTime or util::Date More... | |
static bool | parseDateOrDateTime (css::util::Date *pDate, css::util::DateTime &rDateTime, bool &rbDateTime, std::optional< sal_Int16 > *pTimeZoneOffset, std::string_view rString) |
convert XMLSchema-2 "date" or "dateTime" string to util::DateTime or util::Date More... | |
static sal_Int32 | indexOfComma (std::u16string_view rStr, sal_Int32 nPos) |
gets the position of the first comma after npos in the string rStr. More... | |
static double | GetConversionFactor (OUStringBuffer &rUnit, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit) |
static double | GetConversionFactor (OStringBuffer &rUnit, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit) |
static sal_Int16 | GetUnitFromString (std::u16string_view rString, sal_Int16 nDefaultUnit) |
static sal_Int16 | GetUnitFromString (std::string_view rString, sal_Int16 nDefaultUnit) |
static bool | convertAny (OUStringBuffer &rsValue, OUStringBuffer &rsType, const css::uno::Any &rValue) |
convert an Any to string (typesafe) More... | |
static void | convertBytesToHexBinary (OUStringBuffer &rBuffer, const void *pBytes, sal_Int32 nBytes) |
convert specified byte sequence to xsd:hexBinary string More... | |
template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0> | |
static void | convertNumberToHexBinary (OUStringBuffer &rBuffer, T n) |
the Converter converts values of various types from their internal representation to the textual form used in xml and back.
All unit types are expressed as css::util::MeasureUnit
Definition at line 58 of file converter.hxx.
|
static |
convert number, 10th of degrees with range [0..3600] to SVG angle
Definition at line 729 of file converter.cxx.
References convertDouble(), nVersion, SvtSaveOptions::ODFSVER_012, and SvtSaveOptions::ODFSVER_012_EXT_COMPAT.
|
static |
convert SVG angle to number, 10th of degrees with range [0..3600]
Definition at line 796 of file converter.cxx.
References convertDouble(), and nValue.
|
static |
convert SVG angle to number, 10th of degrees with range [0..3600]
Definition at line 746 of file converter.cxx.
References convertDouble(), nValue, and u.
|
static |
convert an Any to string (typesafe)
Definition at line 2228 of file converter.cxx.
References convertBool(), convertDateTime(), convertDouble(), and convertDuration().
|
static |
convert string to boolean
Definition at line 447 of file converter.cxx.
|
static |
convert string to boolean
Definition at line 439 of file converter.cxx.
References u.
Referenced by convertAny().
|
static |
convert boolean to string
Definition at line 455 of file converter.cxx.
|
static |
convert specified byte sequence to xsd:hexBinary string
Definition at line 2343 of file converter.cxx.
References i.
|
inlinestatic |
Definition at line 130 of file converter.hxx.
References ColorTransparency, and n.
|
inlinestatic |
Definition at line 122 of file converter.hxx.
References ColorTransparency, and n.
|
inlinestatic |
Definition at line 142 of file converter.hxx.
|
static |
|
static |
convert string to rgb color
Definition at line 536 of file converter.cxx.
References sax::lcl_convertColor().
|
static |
convert string to rgb color
Definition at line 530 of file converter.cxx.
References sax::lcl_convertColor().
|
static |
convert util::Date to XMLSchema-2 "date" string
convert util::Date to ISO "date" string
Definition at line 1452 of file converter.cxx.
References convertDateTime().
|
static |
convert util::DateTime to XMLSchema-2 "date" or "dateTime" string
convert util::DateTime to ISO "date" or "dateTime" string
Definition at line 1523 of file converter.cxx.
References abs(), sax::convertTime(), and sax::convertTimeZone().
Referenced by convertAny(), convertDate(), and convertTimeOrDateTime().
|
static |
convert string to double number (using ::rtl::math) without unit conversion
convert string to double number (using ::rtl::math)
Definition at line 718 of file converter.cxx.
|
static |
convert string to double number (using ::rtl::math) and DO convert from source unit to target unit.
convert string to double number (using ::rtl::math)
Definition at line 691 of file converter.cxx.
References convertDouble(), and GetConversionFactor().
|
static |
convert string to double number (using ::rtl::math) without unit conversion
convert string to double number (using ::rtl::math)
Definition at line 707 of file converter.cxx.
|
static |
convert string to double number (using ::rtl::math) and DO convert from source unit to target unit.
convert string to double number (using ::rtl::math)
Definition at line 675 of file converter.cxx.
References convertDouble(), and GetConversionFactor().
|
static |
convert double number to string (using ::rtl::math) without unit conversion
convert double number to string (using ::rtl::math)
Definition at line 669 of file converter.cxx.
|
static |
convert double number to string (using ::rtl::math) and DO convert from source unit to target unit
convert double number to string (using ::rtl::math)
Definition at line 643 of file converter.cxx.
References GetConversionFactor().
Referenced by convertAngle(), convertAny(), and convertDouble().
|
static |
convert XMLSchema-2 "duration" string to util::Duration
|
static |
convert XMLSchema-2 "duration" string to util::Duration
|
static |
convert XMLSchema-2 "duration" string to double; negative durations allowed
convert ISO "duration" string to double; negative durations allowed
Definition at line 1042 of file converter.cxx.
References sax::convertDurationHelper(), and o3tl::trim().
|
static |
convert util::Duration to XMLSchema-2 "duration" string
|
static |
convert double to XMLSchema-2 "duration" string; negative durations allowed
convert double to ISO "duration" string; negative durations allowed
Definition at line 846 of file converter.cxx.
References sax::XML_MAXDIGITSCOUNT_TIME.
Referenced by convertAny().
|
static |
convert measure to string
convert measure in given unit to string with given unit
Definition at line 303 of file converter.cxx.
References o3tl::cm, o3tl::convert(), sax::gpsCM, sax::gpsINCH, sax::gpsMM, sax::gpsPT, o3tl::in, o3tl::mm, nValue, o3tl::pt, and o3tl::twip.
|
static |
convert string to measure using optional min and max values
Definition at line 292 of file converter.cxx.
References sax::lcl_convertMeasure().
|
static |
convert string to measure using optional min and max values
Definition at line 282 of file converter.cxx.
References sax::lcl_convertMeasure().
Referenced by convertMeasurePx(), and convertPercent().
|
static |
convert pixel measure unit to string
convert pixel measure to string
Definition at line 492 of file converter.cxx.
References nValue.
|
static |
convert string to pixel measure unit
convert string to pixel measure
Definition at line 486 of file converter.cxx.
References convertMeasure().
|
static |
convert string to pixel measure unit
convert string to pixel measure
Definition at line 480 of file converter.cxx.
References convertMeasure().
|
static |
convert string to number with optional min and max values
Definition at line 575 of file converter.cxx.
References convertNumber64().
|
static |
convert string to number with optional min and max values
Definition at line 562 of file converter.cxx.
References convertNumber64().
|
static |
convert string to number with optional min and max values
convert string to 64-bit number with optional min and max values
Definition at line 634 of file converter.cxx.
References sax::lcl_convertNumber64().
|
static |
convert string to number with optional min and max values
convert string to 64-bit number with optional min and max values
Definition at line 626 of file converter.cxx.
References sax::lcl_convertNumber64().
Referenced by convertNumber().
|
inlinestatic |
Definition at line 302 of file converter.hxx.
References n.
|
static |
|
static |
convert string to percent
Definition at line 467 of file converter.cxx.
References convertMeasure().
|
static |
convert string to percent
Definition at line 461 of file converter.cxx.
References convertMeasure().
|
static |
convert util::DateTime to XMLSchema-2 "time" or "dateTime" string
convert util::DateTime to ISO "time" or "dateTime" string
Definition at line 1505 of file converter.cxx.
References convertDateTime(), sax::convertTime(), and sax::convertTimeZone().
|
static |
Definition at line 2114 of file converter.cxx.
References o3tl::convert().
|
static |
Definition at line 2095 of file converter.cxx.
References o3tl::convert().
Referenced by convertDouble().
|
static |
Definition at line 2223 of file converter.cxx.
References sax::lcl_GetUnitFromString().
|
static |
Definition at line 2219 of file converter.cxx.
References sax::lcl_GetUnitFromString().
|
static |
gets the position of the first comma after npos in the string rStr.
Commas inside '"' pairs are not matched
Definition at line 2061 of file converter.cxx.
|
static |
convert XMLSchema-2 "date" or "dateTime" string to util::DateTime or util::Date
|
static |
convert XMLSchema-2 "date" or "dateTime" string to util::DateTime or util::Date
|
static |
convert XMLSchema-2 "date" or "dateTime" string to util::DateTime
|
static |
convert XMLSchema-2 "date" or "dateTime" string to util::DateTime
|
static |
convert XMLSchema-2 "time" or "dateTime" string to util::DateTime
|
static |
convert XMLSchema-2 "time" or "dateTime" string to util::DateTime