Main Page   Class Hierarchy   Compound List   File List   Header Files   Sources   Compound Members   File Members  

dtfmtsym.h

This is the verbatim text of the dtfmtsym.h include file.
/*  
********************************************************************************
*   Copyright (C) 1997-1999, International Business Machines
*   Corporation and others.  All Rights Reserved.
********************************************************************************
*
* File DTFMTSYM.H
*
* Modification History:
*
*   Date        Name        Description
*   02/19/97    aliu        Converted from java.
*    07/21/98    stephen        Added getZoneIndex()
*                            Changed to match C++ conventions
********************************************************************************
*/
     
#ifndef DTFMTSYM_H
#define DTFMTSYM_H
 
#include "unicode/utypes.h"
#include "unicode/locid.h"
#include "unicode/resbund.h"

/* forward declaration */
class SimpleDateFormat;

class U_I18N_API DateFormatSymbols {
public:
    DateFormatSymbols(UErrorCode& status);

    DateFormatSymbols(const Locale& locale,
                      UErrorCode& status);

    DateFormatSymbols(const DateFormatSymbols&);

    DateFormatSymbols& operator=(const DateFormatSymbols&);

    ~DateFormatSymbols();

    UBool operator==(const DateFormatSymbols& other) const;

    UBool operator!=(const DateFormatSymbols& other) const { return !operator==(other); }

    const UnicodeString* getEras(int32_t& count) const;

    void setEras(const UnicodeString* eras, int32_t count);

    const UnicodeString* getMonths(int32_t& count) const;

    void setMonths(const UnicodeString* months, int32_t count);

    const UnicodeString* getShortMonths(int32_t& count) const;

    void setShortMonths(const UnicodeString* shortMonths, int32_t count);

    const UnicodeString* getWeekdays(int32_t& count) const;

    void setWeekdays(const UnicodeString* weekdays, int32_t count);

    const UnicodeString* getShortWeekdays(int32_t& count) const;

    void setShortWeekdays(const UnicodeString* shortWeekdays, int32_t count);

    const UnicodeString* getAmPmStrings(int32_t& count) const;

    void setAmPmStrings(const UnicodeString* ampms, int32_t count);

    const UnicodeString** getZoneStrings(int32_t& rowCount, int32_t& columnCount) const;

    void setZoneStrings(const UnicodeString* const* strings, int32_t rowCount, int32_t columnCount);

    static const UnicodeString& getPatternChars(void) { return fgPatternChars; }

    UnicodeString& getLocalPatternChars(UnicodeString& result) const;

    void setLocalPatternChars(const UnicodeString& newLocalPatternChars);

private:
    friend class SimpleDateFormat;

    UnicodeString*  fEras;
    int32_t         fErasCount;

    UnicodeString*  fMonths;
    int32_t         fMonthsCount;

    UnicodeString*  fShortMonths;
    int32_t         fShortMonthsCount;

    UnicodeString*  fWeekdays;
    int32_t         fWeekdaysCount;

    UnicodeString*  fShortWeekdays;
    int32_t         fShortWeekdaysCount;

    UnicodeString*  fAmPms;
    int32_t         fAmPmsCount;

    UnicodeString** fZoneStrings;
    int32_t         fZoneStringsRowCount;
    int32_t         fZoneStringsColCount;

    UnicodeString   fLocalPatternChars;

    static UnicodeString fgPatternChars;

private:

    void initField(UnicodeString **field, int32_t& length, const ResourceBundle data, uint8_t ownfield, UErrorCode &status);
    void initializeData(const Locale&, UErrorCode& status, UBool useLastResortData = FALSE);

    void assignArray(UnicodeString*& dstArray,
                     int32_t& dstCount,
                     const UnicodeString* srcArray,
                     int32_t srcCount,
                     const DateFormatSymbols& other,
                     int32_t which);

    static UBool arrayCompare(const UnicodeString* array1,
                             const UnicodeString* array2,
                             int32_t count);

    void createZoneStrings(const UnicodeString *const * otherStrings);

    int32_t getZoneIndex(const UnicodeString& ID) const;

    void dispose(void);

    void disposeZoneStrings(void);

    static const UnicodeString     fgLastResortMonthNames[];
    static const UnicodeString     fgLastResortDayNames[];
    static const UnicodeString     fgLastResortAmPmMarkers[];
    static const UnicodeString     fgLastResortEras[];
    static const UnicodeString     fgLastResortZoneStrings[];
    static UnicodeString**         fgLastResortZoneStringsH;

    enum
    {
        kEras,
        kMonths,
        kShortMonths,
        kWeekdays,
        kShortWeekdays,
        kAmPms,
        kZoneStrings
    };
    uint8_t                 fIsOwned;

    void                    setIsOwned(int32_t which, UBool isOwned);

    UBool                  isOwned(int32_t which) const;
};

inline void
DateFormatSymbols::setIsOwned(int32_t which, UBool isOwned)
{
    fIsOwned = (uint8_t)(( fIsOwned & ~(1 << which) ) | ( (isOwned ? 1 : 0) << which ));
}

inline UBool
DateFormatSymbols::isOwned(int32_t which) const
{
    return ( (fIsOwned >> which) & 1 ) != 0;
}

#endif // _DTFMTSYM
//eof

Generated at Wed Aug 16 16:05:43 2000 for ICU1.6 by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999