Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

uresimp.h

Go to the documentation of this file.
00001 #ifndef URESIMP_H
00002 #define URESIMP_H
00003 
00004 #include "unicode/ures.h"
00005 
00006 #include "unicode/uloc.h"
00007 #include "unicode/ustring.h"
00008 #include "cmemory.h"
00009 #include "cstring.h"
00010 #include "uresdata.h"
00011 #include "uhash.h"
00012 #include "umutex.h"
00013 
00014 #define kRootLocaleName         "root"
00015 #define kIndexLocaleName        "index"
00016 #define kIndexTag               "InstalledLocales"
00017 
00018 /*
00019  The default minor version and the version separator must be exactly one
00020  character long.
00021 */
00022 
00023 #define kDefaultMinorVersion    "0"
00024 #define kVersionSeparator       "."
00025 #define kVersionTag             "Version"
00026 
00027 #define MAGIC1 19700503
00028 #define MAGIC2 19641227
00029 
00030 
00031 enum UResEntryType {
00032     ENTRY_OK = 0,
00033     ENTRY_GOTO_ROOT = 1,
00034     ENTRY_GOTO_DEFAULT = 2,
00035     ENTRY_INVALID = 3
00036 };
00037 
00038 typedef enum UResEntryType UResEntryType;
00039 
00040 struct UResourceDataEntry;
00041 typedef struct UResourceDataEntry UResourceDataEntry;
00042 
00043 struct UResourceDataEntry {
00044     char *fName; /* name of the locale for bundle - still to decide whether it is original or fallback */
00045     char *fPath; /* path to bundle - used for distinguishing between resources with the same name */
00046     uint32_t fCountExisting; /* how much is this resource used */
00047     ResourceData fData; /* data for low level access */
00048     UResourceDataEntry *fParent; /*next resource in fallback chain*/
00049     UResEntryType fStatus;
00050     UErrorCode fBogus;
00051     int32_t fHashKey; /* for faster access in the hashtable */
00052 };
00053 
00054 struct UResourceBundle {
00055     const char *fKey; /*tag*/
00056     char *fVersion;
00057     UBool fHasFallback;
00058     UBool fIsTopLevel;
00059     uint32_t fMagic1;
00060     uint32_t fMagic2;
00061     /*UBool fIsStackObject;*/
00062     UResourceDataEntry *fData; /*for low-level access*/
00063     int32_t fIndex;
00064     int32_t fSize;
00065     ResourceData fResData;
00066     Resource fRes;
00067 };
00068 
00069 U_CFUNC UResourceBundle* ures_openNoFallback(const char* path, const char* localeID, UErrorCode* status);
00070 U_CFUNC const char* ures_getRealLocale(const UResourceBundle* resourceBundle, UErrorCode* status);
00071 U_CAPI void ures_setIsStackObject( UResourceBundle* resB, UBool state);
00072 U_CAPI UBool ures_isStackObject( UResourceBundle* resB, UErrorCode *status);
00073 
00074 U_CFUNC const ResourceData *getFallbackData(const UResourceBundle* resBundle, const char* * resTag, UResourceDataEntry* *realData, Resource *res, UErrorCode *status);
00075 U_CFUNC int32_t hashBundle(const void *parm);
00076 U_CFUNC UBool compareBundles(const void *p1, const void *p2);
00077 
00078 /* Candidates for export */
00079 U_CFUNC UResourceBundle *copyResb(UResourceBundle *r, const UResourceBundle *original, UErrorCode *status);
00080 U_CFUNC const ResourceData * ures_getResData(const UResourceBundle* resB);
00081 #endif /*URESIMP_H*/

Generated at Tue Dec 5 17:55:37 2000 for ICU by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000