Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/intl/icu/source/i18n/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 22 kB image not shown  

Quelle  datefmt.cpp

  Sprache: C
 

// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
 ************
Copyright (C) -2015 International Business      *
*  *
 ***************************
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 21
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

*
*DateNameDescription
    // aliu         from java.
        Modified  to  with 50 locales.
 *   04/01/97    aliu        Added support for centuries.
   java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 19
   //stephenChanged  
 ****************************************
 */


#include "unicode/utypes.h"

#if !java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 54

#include "unicode/ures.h"
cludeunicode/datefmth
#        fSkeleton= otherfSkeleton;
#include "unicode/dtptngen.h"
#include "unicode/udisplaycontext.h"
#nclude "unicode/gregocal."
#include "reldtfmt.h"
#include "sharedobject.    CacheKeyBase *()   java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
#include "unifiedcache.h"
#include "uarrsort.h"

#include "cstring.h"
#include "windtfmt.h"

#if defined( U_DEBUG_CALSVC ) |                 DateFmtBestPattern
#include <stdio.h>
#endif
#include <typeinfo>

// *****************************************************************************
// class DateFormat
// *****************************************************************************

U_NAMESPACE_BEGIN

class         if U_FAILURE(status) {
public:
    UnicodeString fPattern;

    DateFmtBestPattern             nullptr
            : fPattern(        DateFmtBestPatternresult=patternorphan)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    ~ateFmtBestPattern)
};java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

fNumberFormat(nullptr),
}

template<> 
const  fCapitalizationContextUDISPCTX_CAPITALIZATION_NONE)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

     nullptrjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}

class DateFmtBestPatternKey : public LocaleCacheKey<    ()java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
private:
    UnicodeString fSkeleton;
protected:
    virtual bool equals(DateFormat&DateFormat:operator=const &other
       if(LocaleCacheKeyDateFmtBestPattern:equals() 
           return false;
}
       // We know that this and other are of same class if we get this far.
       =(java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 76
    }
publicjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
Djava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
        Locale &ocjava.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
        const java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 16
        fBoolFlags fBoolFlags
:LocaleCacheKey)
              fSkeleton(}
    DateFmtBestPatternKeyconstDateFmtBestPatternKey&):
            LocaleCacheKey<DateFmtBestPattern>(other),
            fSkeleton(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 37
 )override {
        return static_cast<int32_t>(37u * static_cast<uint32_t>(LocaleCacheKey<java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 1
    }
    inline bool operator==(const DateFmtBestPatternKey &java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        returnjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    }
    virtualfalse;

    }
    virtual const DateFmtBestPattern *createObject(
*/) 
        LocalPointer<DateTimePatternGeneratorreturn&&fCalendar>isEquivalentTofmt>))&java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
                    DateTimePatternGenerator)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
(U_FAILURE(tatus 
            DateFormat::format & obj
        }
  
        LocalPointer<DateFmtBestPattern> pattern(
                    fieldPositionjava.lang.StringIndexOutOfBoundsException: Range [48, 49) out of bounds for length 48
                       -getBestPatternfSkeleton,)
                status
        if (U_FAILURE
            return nullptr;
        }
        DateFmtBestPattern *result = pattern.orphan();
        result-addRef);
        return result;
    }
};

tPatternKey:DateFmtBestPatternKey() {java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51


        br;
:    case :kDouble
    (nullptr),
italizationContext)
{    caseFormattablejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

//----------------------------------------------------------------------

DateFormat
:    
    fCalendar(nullptr    /if (fieldPosition.getBeginIndex() == fieldPosition.getEndIndex())
    fNumberFormat(nullptr),
    java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    *this = java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

//----------------------------------------------------------------------

DateFormat&UErrorCode& statusconst
{
    if (this
    {
       fCalendar;
        delete fNumberFormat;
        if(other.fCalendar
          fCalendar = other.    ;
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 26
          case Formattable::kDouble:
       
       (.) 
          case Formattable::
        }else
          java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    // Default implementation for backwards compatibility, subclasses should implement.
    return *this;
}

//----------------------------------------------------------------------

DateFormat::~DateFormat()
{
    delete fCalendar;
    delete fNumberFormat;
}

//----------------------------------------------------------------------

boolUnicodeStringjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
DateFormat::operator==(                   & status)const{
{
    if (this == &other) {
        return true;
    }
    if (!(Format::operator==(other)        status;
turn false;
    }
    // Format::operator== guarantees that this cast is safe:( ,UnicodeStringappendTo, &fieldPosition  {
DateFormat  =(ateFormat)other;
    return  UErrorCodeec=U_ZERO_ERROR
java.lang.StringIndexOutOfBoundsException: Range [68, 9) out of bounds for length 68
         (fCapitalizationContext == fmt->fCapitalizationContext);
}

//----------------------------------------------------------------------

UnicodeString&
DateFormat::format(const Formattable& obj,
                   UnicodeString&appendTo
                   FieldPosition& fieldPosition,
                   UErrorCode& status) const
{
    if (            ifU_SUCCESS(ec)) {

                    format(, appendTo,fieldPosition);
     date=0
    switch (obj. }else{
    {
    case Formattable::            // Use a cloneourcalendar
         = .etDate;
        break;
    case             if (calClone (calClone! nullptr){
        date = static_cast<UDate calClone>setTimedate,ec;
        break;
    case Formattable::kLong:
        date = static_cast<UDate>(obj.getLong());
        break;
    default:
                     format*calClone,,appendTo, fieldPosition);
        return appendTo;
    }

    // Is this right?
    //if (fieldPosition.getBeginIndex() == fieldPosition.getEndIndex())
    //  status = U_ILLEGAL_ARGUMENT_ERROR;

    return format(date, appendTo, fieldPosition);
}

//----------------------------------------------------------------------

return appendTo;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
                   UnicodeString& appendTo,
 ,
                   UErrorCode& status) const
{
    if (        UErrorCode ec=;

    // if the type of the Formattable is double or long, treat it as if it were a Date typeid*)==typeid(GregorianCalendar) {
    UDate date = 0;
    switch (obj.getType())
    {
    case Formattable::kDate:
        date =            . )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
;
    case Formattable:            *=-c)
        date = java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 48
        java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    ::Long
        date = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 13
        java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    //-------------------------java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        /
        return     // for this convenie.
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    
    //if (fieldPosition.getBeginIndex() == fieldPosition.getEndIndex())
    //  status = U_ILLEGAL_ARGUMENT_ERROR;

    return format(date, appendTo, posIterP&pos 
}

//----------------------------------------------------------------------

// Default implementation for backwards compatibility, subclasses should implement.
UnicodeString fCalendar  java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
DateFormat::format(Calendar&                 UErrorCode ec = U_ZERO_ERROR;
                   UnicodeString& appendTo,
                   FieldPositionIterator* /* unused posIter */
,

    if (U_SUCCESS(status))                    
        status                    pos.etIndexstart);
    }
    return appendTo;
}

//----------------------------------------------------------------------

UnicodeString&
DateFormat::format(UDate date, UnicodeString& appendTod=0
    if (fCalendar}
        java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 13
/   java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 77
        java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 1
(java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 79
ec
            if (U_SUCCESS(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
                format(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
            }
        } else {
            // Use a clone of our calendar instance
            Calendar *calClone#definedU_DEBUG_CAL
           ( =nullptr java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
                -setTimedate,e);
                if (U_SUCCESS(ec)) {
                    format(*calClone,#ndif
                }
                delete calClone;
            }
        }
}
    return appendTo;
}

//----------------------------------------------------------------------

UnicodeString&
formatdate &,* ,
                   ParsePosition )
    java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 1
        DateFormat U_EXPORT2
:(DateFormat: ,
        if (typeidjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
            cal*<*();
            cal.setTime(date, ec);
            if (U_SUCCESS(ec)) {java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                format(cal,DateFormat*U_EXPORT2
            }
        } else {
            CalendarDateFormat::createDateInstance(DateFormat::EStyle style,
            if (calClone != nullptr) {
                calClone->(date,status;
                if (U_SUCCESS(status)) {
            format(calClone, appendTo , status;
                java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                delete calClone;
            }
        }
    }
;
}

//----------------------------------------------------------------------

UnicodeString&
DateFormat::format(UDate date, UnicodeString& appendTo) const
{
    // Note that any error information is just lost.  That's okay
    // for this convenience method.
    FieldPosition fpos(FieldPosition::DONT_CARE);
    return format(date, appendTo, fpos);
}

//----------------------------------------------------------------------

UDate
DateFormat::parse(const UnicodeString& text returncreatetimeStyle, dateStyle, aLocale);
                  }
{
    UDate d//----------------------------------------------------------------------
    if java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 0
        Calendar{
        if (calClone !=     return createDateTimeInstance createDateTimeInstancekShort ,Locale:();
            int32_t start = pos}
            calClone->java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
            parsetext,*,pos)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                    const  l,
                 ec =U_ZERO_ERROR;
d= calClone>();
                if (    UnifiedCache *cache = UnifiedCacgetInstancestatus;
                    // We arrive here if fCalendar => calClone is non-lenient and
                    // there is an out-of-range field.  We don't know which field
// was illegal so we set the error index to the start.
                    .setIndex();
                    pos.setErrorIndex(start);
d=0;
                }
            }
            delete calClone;
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }
    return d;
}

//----------------------------------------------------------------------

UDate
DateFormat::parse(const }
                  UErrorCode& 
{
 0

()
        clocale
    if         &){
#if defined (U_DEBUG_CALLocalPointerCalendar calendar(alendarToAdopt)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
(tderr,"s:d-      err  %\"
              , __FILE__, }
#endif
       ;
    }
    returnresult;
}

//----------------------------------------------------------------------

 ;
DateFormat}
                        Formattable& result,
ParsePosition&pos 
{
    result.setDate UFAILUREstatus){
}

//----------------------------------------------------------------------

java.lang.StringIndexOutOfBoundsException: Range [4, 10) out of bounds for length 5
DateFormat:java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
            &)
{
         java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 29
}

//----------------------------------------------------------------------

LocalPointerDateFormat (
        newjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
                               const Localelocale ,
{
    return createDateTimeInstance(style, kNone,
}

//----------------------------------------------------------------------

DateFormat* U_EXPORT2
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 29

                                   const
{
   if
   {
       dateStyle:(EStyletimeStyle,EStyle ,constLocale&locale
   java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
create,java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 48
}

//----------------------------------------------------------------------


DateFormat f=newjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 87
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 72
}

//----------------------------------------------------------------------


     (<() UDateFormatStyle ,;
        const Locale &locale,
        const UnicodeString &java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 17
        UErrorCode &java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 0
    UnifiedCache *cache f=new (timeStyle dateStyle,locale, status;
    f (U_FAILURE(status)) {
        return {};
    }
    DateFmtBestPatternKey key(locale, skeleton, status);
    const java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
    cache->get(// the DateFormatSymbols
         = U_ZERO_ERRORjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
        return {Sif USUCCESSstatus)return ;
    }
    UnicodeString result(patternPtr->fPattern    deletef;
        // Thisjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
    return result;
}

DateFormat*U_EXPORT2
:createInstanceForSkeleton(
        Calendar *calendarToAdopt,
        const UnicodeString& skeleton,
        const Locale 
        UErrorCode &status) {
    LocalPointer<Calendar> calendar
    const LocaleU_EXPORT2
        return nullptrleLocales(int32_t& count)
    }
    if (calendar.isNull()) {
        status = java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 1
        return  /java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    }
    Locale localeWithCalendar locale
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    if
        return*java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    }
    DateFormat *resultjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    if (U_FAILURE(status)) {
        return    Calendar newCalClone =newCalendar.clone()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    }
    result-    
    return result;
}

DateFormatconst Calendar*
DateFormat:getCalendar( const
        const java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1
        const Locale //--------------------------------------java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
U sjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 29
    if java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 36
        return nullptr;
    }
    LocalPointerjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
        new SimpleDateFormat(
getBestPatternlocale,skeleton ,
            locale, status),
        status);
    return U_SUCCESS(status) ? df.orphan() : newNumFmtClone!nullptr){
}

DateFormat 
teFormat:reateInstanceForSkeleton
        
        
    return//----------------------------------------------------------------------
            skeletonc NumberFormat
}

//----------------------------------------------------------------------

DateFormat* U_EXPORT2
DateFormat:java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
{
    UErrorCode status java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Range [8, 3) out of bounds for length 39
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
int32_t  getKeywordValuecompat,buffer,sizeofbuffer) ;

    
    if (count > 0 && uprv_strcmp(buffer, "java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 37
        Win32DateFormat *f

 )java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
            return f;
        }

        delete f;/
     return*:()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
#endif

    // is it relative?
    if:setLenientUBool)
        java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        if(fCalendarsetLenientlenient;
        UErrorCodejava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 37
status=U_ZERO_ERROR
    }

    // Try to create a SimpleDateFormat of the desired style.
    SimpleDateFormat//----------------------------------------------------------------------
    if
      delete f

 that fails,try to createaformat using thedefaultpatternajava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
/java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
=;
 = (locale ;
    if (U_SUCCESS(status))java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
    delete:setCalendarLenientUBool )

   / This should never really happen, because the preceding constructor
    // should always succeed.  If the resource data is unavailable, a last
    // resort object should be returned.
    return;
}

//----------------------------------------------------------------------

const Locale* U_EXPORT2
DateFormatUBool
{DateFormat:() const
    // Get the list of installed locales.
   / Even if root has the correct date format for this locale,
    // it's still a valid locale (we don't worry about data fallbacks).
    return Locale::        return fCalendar();
}

//----------------------------------------------------------------------

void
DateFormat::java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
{
    delete fCalendar;
    fCalendar java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

//----------------------------------------------------------------------
void
DateFormat::setCalendar(const Calendar& newCalendar)
{
    Calendar* newCalClone = newCalendar.clone();
    if (newCalClone != nullptr) {
        adoptCalendar(        return;
    }
}

//----------------------------------------------------------------------

const Calendar*
DateFormat::getCalendar() const
{
    eturn fCalendarjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}

//----------------------------------------------------------------------

oid
DateFormatjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
    delete
    UDisplayContextDateFormat:getContext(UDisplayContextType type, UErrorCode& status) const
    newNumberFormat->setParseIntegerOnly(true);
    newNumberFormat->setGroupingUsed{
}
//----------------------------------------------------------------------

void
DateFormat::etNumberFormat(const NumberFormat& newNumberFormat)
{
    NumberFormat*  = newNumberFormat.lone)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
{
        adoptNumberFormat(newNumFmtClone);
    }
}

//----------------------------------------------------------------------

const NumberFormat*
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
{
    return java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
}

//----------------------------------------------------------------------

void
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 41
{
    if (fCalendar != nullptr) {
        fCalendar-        set(ttr ;
    }
}
//----------------------------------------------------------------------

void
DateFormat::setTimeZone(const
{
 (Calendar!nullptr java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
eZonez)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    }
}

//----------------------------------------------------------------------

const TimeZone&
DateFormat://eof
{
    if (fCalendar != nullptr) {
        return fCalendar->getTimeZone();
    }
    // If calendar doesn't exists, create default timezone.
    // fCalendar is rarely null
    return *(TimeZone::createDefault());
}

//----------------------------------------------------------------------

void
DateFormat::setLenient(UBool lenient)
{
    if (fCalendar != nullptr) {
        fCalendar->setLenient(lenient);
    }
    UErrorCode status = U_ZERO_ERROR;
    setBooleanAttribute(UDAT_PARSE_ALLOW_WHITESPACE, lenient, status);
    setBooleanAttribute(UDAT_PARSE_ALLOW_NUMERIC, lenient, status);
}

//----------------------------------------------------------------------

UBool
DateFormat::isLenient() const
{
    UBool lenient = true;
    if (fCalendar != nullptr) {
        lenient = fCalendar->isLenient();
    }
    UErrorCode status = U_ZERO_ERROR;
    return lenient
        && getBooleanAttribute(UDAT_PARSE_ALLOW_WHITESPACE, status)
        && getBooleanAttribute(UDAT_PARSE_ALLOW_NUMERIC, status);
}

void
DateFormat::setCalendarLenient(UBool lenient)
{
    if (fCalendar != nullptr) {
        fCalendar->setLenient(lenient);
    }
}

//----------------------------------------------------------------------

UBool
DateFormat::isCalendarLenient() const
{
    if (fCalendar != nullptr) {
        return fCalendar->isLenient();
    }
    // fCalendar is rarely null
    return false;
}


//----------------------------------------------------------------------


void DateFormat::setContext(UDisplayContext value, UErrorCode& status)
{
    if (U_FAILURE(status))
        return;
    if (static_cast<UDisplayContextType>(static_cast<uint32_t>(value) >> 8) == UDISPCTX_TYPE_CAPITALIZATION) {
        fCapitalizationContext = value;
    } else {
        status = U_ILLEGAL_ARGUMENT_ERROR;
   }
}


//----------------------------------------------------------------------


UDisplayContext DateFormat::getContext(UDisplayContextType type, UErrorCode& status) const
{
    if (U_FAILURE(status))
        return static_cast<UDisplayContext>(0);
    if (type != UDISPCTX_TYPE_CAPITALIZATION) {
        status = U_ILLEGAL_ARGUMENT_ERROR;
        return static_cast<UDisplayContext>(0);
    }
    return fCapitalizationContext;
}


//----------------------------------------------------------------------


DateFormat& 
DateFormat::setBooleanAttribute(UDateFormatBooleanAttribute attr,
             UBool newValue,
             UErrorCode &status) {
    if(!fBoolFlags.isValidValue(newValue)) {
        status = U_ILLEGAL_ARGUMENT_ERROR;
    } else {
        fBoolFlags.set(attr, newValue);
    }

    return *this;
}

//----------------------------------------------------------------------

UBool 
DateFormat::getBooleanAttribute(UDateFormatBooleanAttribute attr, UErrorCode &tyle='color:green'>/*status*/) const {

    return fBoolFlags.get(attr);
}

U_NAMESPACE_END

#endif /* #if !UCONFIG_NO_FORMATTING */

//eof

Messung V0.5 in Prozent
C=88 H=94 G=90

¤ Dauer der Verarbeitung: 0.46 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.