public:
SvXMLTokenEnumerator( std::u16string_view rString, sal_Unicode cSeparator = u' ' ); /** just so no-one accidentally passes a temporary to this, and ends up with this class
* accessing the temporary after the temporary has been deleted. */
SvXMLTokenEnumerator( OUString&& , sal_Unicode cSeparator = u' ' ) = delete;
/** the SvXMLTypeConverter converts values of various types from theirinternalrepresentationtothetextualformusedinxml andback. MostofthemethodsarestaticbuttheSvXMLTypeConvertercan alsostoredefaultunitsforbothnumericalandtextualmeasures.
public: /** constructs a SvXMLUnitConverter. The core measure unit is the defaultunitfornumericalmeasures,theXMLmeasureunitis
the default unit for textual measures */
SvXMLUnitConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext,
sal_Int16 eCoreMeasureUnit /*css::util::MeasureUnit*/,
sal_Int16 eXMLMeasureUnit /*css::util::MeasureUnit*/,
SvtSaveOptions::ODFSaneDefaultVersion const nODFVersion);
/** convert string to measure with meCoreMeasureUnit,
using optional min and max values*/ bool convertMeasureToCore( sal_Int32& rValue,
std::u16string_view rString,
sal_Int32 nMin = SAL_MIN_INT32,
sal_Int32 nMax = SAL_MAX_INT32) const;
/** convert string to measure with meCoreMeasureUnit,
using optional min and max values*/ bool convertMeasureToCore( sal_Int32& rValue,
std::string_view rString,
sal_Int32 nMin = SAL_MIN_INT32,
sal_Int32 nMax = SAL_MAX_INT32) const;
/** convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit */ void convertMeasureToXML( OUStringBuffer& rBuffer,
sal_Int32 nMeasure ) const;
/** convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit */
OUString convertMeasureToXML( sal_Int32 nMeasure ) const;
/** convert string to enum using given enum map, if the enum is
not found in the map, this method will return false */ template<typename EnumT> staticbool convertEnum( EnumT& rEnum,
std::u16string_view rValue, const SvXMLEnumMapEntry<EnumT> *pMap )
{
sal_uInt16 nTmp; bool bRet = convertEnumImpl(nTmp, rValue, reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pMap)); if (bRet)
rEnum = static_cast<EnumT>(nTmp); return bRet;
}
/** convert string to enum using given enum map, if the enum is
not found in the map, this method will return false */ template<typename EnumT> staticbool convertEnum( EnumT& rEnum,
std::string_view rValue, const SvXMLEnumMapEntry<EnumT> *pMap )
{
sal_uInt16 nTmp; bool bRet = convertEnumImpl(nTmp, rValue, reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pMap)); if (bRet)
rEnum = static_cast<EnumT>(nTmp); return bRet;
}
/** convert string to enum using given token map, if the enum is
not found in the map, this method will return false */ template<typename EnumT> staticbool convertEnum( EnumT& rEnum,
std::u16string_view rValue, const SvXMLEnumStringMapEntry<EnumT> *pMap )
{
sal_uInt16 nTmp; bool bRet = convertEnumImpl(nTmp, rValue, reinterpret_cast<const SvXMLEnumStringMapEntry<sal_uInt16>*>(pMap)); if (bRet)
rEnum = static_cast<EnumT>(nTmp); return bRet;
}
/** convert string to enum using given token map, if the enum is
not found in the map, this method will return false */ template<typename EnumT> staticbool convertEnum( EnumT& rEnum,
std::string_view rValue, const SvXMLEnumStringMapEntry<EnumT> *pMap )
{
sal_uInt16 nTmp; bool bRet = convertEnumImpl(nTmp, rValue, reinterpret_cast<const SvXMLEnumStringMapEntry<sal_uInt16>*>(pMap)); if (bRet)
rEnum = static_cast<EnumT>(nTmp); return bRet;
}
/** convert enum to string using given enum map with an optional defaulttoken.Iftheenumisnotfoundinthemap, thismethodwilleitherusethegivendefaultorreturn
false if not default is set */ template<typename EnumT> staticbool convertEnum( OUStringBuffer& rBuffer,
EnumT nValue, const SvXMLEnumMapEntry<EnumT> *pMap, enum ::xmloff::token::XMLTokenEnum eDefault =
::xmloff::token::XML_TOKEN_INVALID )
{ return convertEnumImpl(rBuffer, static_cast<sal_uInt16>(nValue), reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pMap), eDefault);
}
/** convert double number to string (using ::rtl::math) and DO
convert to export MapUnit using meCoreMeasureUnit/meXMLMeasureUnit */ void convertDouble(OUStringBuffer& rBuffer, double fNumber) const;
/** convert string to double number (using ::rtl::math) and DO convert. */ bool convertDouble(double& rValue, std::u16string_view rString) const;
/** convert string to double number (using ::rtl::math) and DO convert. */ bool convertDouble(double& rValue, std::string_view rString) const;
/** get the Null Date of the XModel and set it to the UnitConverter */ bool setNullDate ( const css::uno::Reference <css::frame::XModel>& xModel);
/** convert double to ISO Date Time String */ void convertDateTime( OUStringBuffer& rBuffer, constdouble& fDateTime, boolconst bAddTimeIf0AM = false);
/** convert ISO Date Time String to double */ bool convertDateTime(double& fDateTime,
std::u16string_view rString) const;
/** convert ISO Date Time String to double */ bool convertDateTime(double& fDateTime,
std::string_view rString) const;
/// these 2 functions use tools Date, so they're not yet moved to sax
/** convert double to ISO Date Time String */ staticvoid convertDateTime( OUStringBuffer& rBuffer, constdouble& fDateTime, const css::util::Date& aNullDate, bool bAddTimeIf0AM = false); /** convert ISO Date Time String to double */ staticbool convertDateTime( double& fDateTime,
std::u16string_view rString, const css::util::Date& aNullDate); /** convert ISO Date Time String to double */ staticbool convertDateTime( double& fDateTime,
std::string_view rString, const css::util::Date& aNullDate);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.