/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/** convert string to number with optional min and max values */ staticbool 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 */ staticbool 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 */ staticbool 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 */ staticbool convertNumber64(sal_Int64& rValue,
std::string_view aString,
sal_Int64 nMin = SAL_MIN_INT64,
sal_Int64 nMax = SAL_MAX_INT64);
/** convert double number to string (using ::rtl::math) and
DO convert from source unit to target unit */ staticvoid convertDouble( OUStringBuffer& rBuffer, double fNumber, bool bWriteUnits,
sal_Int16 nSourceUnit,
sal_Int16 nTargetUnit );
/** convert double number to string (using ::rtl::math) without unit conversion */ staticvoid convertDouble( OUStringBuffer& rBuffer, double fNumber);
/** convert string to double number (using ::rtl::math) and DO convert from
source unit to target unit. */ staticbool 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. */ staticbool convertDouble( double& rValue,
std::string_view rString,
sal_Int16 nSourceUnit,
sal_Int16 nTargetUnit );
/** convert string to double number (using ::rtl::math) without unit conversion */ staticbool convertDouble(double& rValue, std::u16string_view rString, std::u16string_view* pRest = nullptr);
/** convert string to double number (using ::rtl::math) without unit conversion */ staticbool convertDouble(double& rValue, std::string_view rString, std::string_view* pRest = nullptr);
/** convert number, 10th of degrees with range [0..3600] to SVG angle */ staticvoid convert10thDegAngle(OUStringBuffer& rBuffer, sal_Int16 nAngle, constbool isWrongOOo10thDegAngle);
/** convert SVG angle to number in 10th of degrees */ staticbool convert10thDegAngle(sal_Int16& rAngle, std::u16string_view rString, bool isWrongOOo10thDegAngle);
/** convert SVG angle to number in 10th of degrees */ staticbool convert10thDegAngle(sal_Int16& rAngle, std::string_view rString, bool isWrongOOo10thDegAngle);
/** convert SVG angle to number, in degrees, range [0..360] */ staticbool convertAngle(double& rAngle, std::u16string_view rString);
/** convert SVG angle to number, in degrees, range [0..360] */ staticbool convertAngle(double& rAngle, std::string_view rString);
/** convert util::DateTime to XMLSchema-2 "time" or "dateTime" string */ staticvoid convertTimeOrDateTime(OUStringBuffer& rBuffer, const css::util::DateTime& rDateTime);
/** convert XMLSchema-2 "date" or "dateTime" string to util::DateTime */ staticbool parseDateTime( css::util::DateTime& rDateTime,
std::u16string_view rString );
/** convert XMLSchema-2 "date" or "dateTime" string to util::DateTime */ staticbool parseDateTime( css::util::DateTime& rDateTime,
std::string_view rString );
/** convert XMLSchema-2 "time" or "dateTime" string to util::DateTime */ staticbool parseTimeOrDateTime(css::util::DateTime& rDateTime,
std::u16string_view rString);
/** convert XMLSchema-2 "time" or "dateTime" string to util::DateTime */ staticbool parseTimeOrDateTime(css::util::DateTime& rDateTime,
std::string_view rString);
/** convert XMLSchema-2 "date" or "dateTime" string to util::DateTime or
util::Date */ staticbool 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 */ staticbool parseDateOrDateTime(
css::util::Date * pDate,
css::util::DateTime & rDateTime, bool & rbDateTime,
std::optional<sal_Int16> * pTimeZoneOffset,
std::string_view rString );
/** gets the position of the first comma after npos in the string
rStr. Commas inside '"' pairs are not matched */ static sal_Int32 indexOfComma( std::u16string_view rStr,
sal_Int32 nPos );
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.