]>
git.saurik.com Git - apple/icu.git/blob - icuSources/tools/genrb/reslist.h
2 *******************************************************************************
4 * Copyright (C) 2000-2003, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
11 * Modification History:
13 * Date Name Description
14 * 02/21/00 weiv Creation.
15 *******************************************************************************
21 #define KEY_SPACE_SIZE 65536
22 #define RESLIST_MAX_INT_VECTOR 2048
24 #include "unicode/utypes.h"
25 #include "unicode/ures.h"
26 #include "unicode/ustring.h"
35 /* Resource bundle root table */
40 int32_t fKeysCapacity
;
42 struct SResource
*fRoot
;
43 int32_t fMaxTableLength
;
46 struct SRBRoot
*bundle_open(const struct UString
* comment
, UErrorCode
*status
);
47 void bundle_write(struct SRBRoot
*bundle
, const char *outputDir
, const char *outputPkg
, char *writtenFilename
, int writtenFilenameLen
, UErrorCode
*status
);
49 /* write a java resource file */
50 void bundle_write_java(struct SRBRoot
*bundle
, const char *outputDir
, const char* outputEnc
, char *writtenFilename
,
51 int writtenFilenameLen
, const char* packageName
, const char* bundleName
, UErrorCode
*status
);
53 /* write a xml resource file */
54 /* commented by Jing*/
55 /* void bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char* outputEnc,
56 char *writtenFilename, int writtenFilenameLen,UErrorCode *status); */
59 void bundle_write_xml(struct SRBRoot
*bundle
, const char *outputDir
,const char* outputEnc
, const char* rbname
,
60 char *writtenFilename
, int writtenFilenameLen
, const char* language
, const char* package
, UErrorCode
*status
);
62 void bundle_close(struct SRBRoot
*bundle
, UErrorCode
*status
);
63 void bundle_setlocale(struct SRBRoot
*bundle
, UChar
*locale
, UErrorCode
*status
);
64 int32_t bundle_addtag(struct SRBRoot
*bundle
, const char *tag
, UErrorCode
*status
);
66 /* Various resource types */
67 struct SResource
* res_open(const struct UString
* comment
, UErrorCode
* status
);
71 uint32_t fChildrenSize
;
72 struct SResource
*fFirst
;
73 struct SRBRoot
*fRoot
;
76 struct SResource
* table_open(struct SRBRoot
*bundle
, char *tag
, const struct UString
* comment
, UErrorCode
*status
);
77 void table_close(struct SResource
*table
, UErrorCode
*status
);
78 void table_add(struct SResource
*table
, struct SResource
*res
, int linenumber
, UErrorCode
*status
);
82 uint32_t fChildrenSize
;
83 struct SResource
*fFirst
;
84 struct SResource
*fLast
;
87 struct SResource
* array_open(struct SRBRoot
*bundle
, char *tag
, const struct UString
* comment
, UErrorCode
*status
);
88 void array_close(struct SResource
*array
, UErrorCode
*status
);
89 void array_add(struct SResource
*array
, struct SResource
*res
, UErrorCode
*status
);
96 struct SResource
*string_open(struct SRBRoot
*bundle
, char *tag
, const UChar
*value
, int32_t len
, const struct UString
* comment
, UErrorCode
*status
);
97 void string_close(struct SResource
*string
, UErrorCode
*status
);
99 struct SResource
*alias_open(struct SRBRoot
*bundle
, char *tag
, UChar
*value
, int32_t len
, const struct UString
* comment
, UErrorCode
*status
);
100 void alias_close(struct SResource
*string
, UErrorCode
*status
);
102 struct SResIntVector
{
107 struct SResource
* intvector_open(struct SRBRoot
*bundle
, char *tag
, const struct UString
* comment
, UErrorCode
*status
);
108 void intvector_close(struct SResource
*intvector
, UErrorCode
*status
);
109 void intvector_add(struct SResource
*intvector
, int32_t value
, UErrorCode
*status
);
115 struct SResource
*int_open(struct SRBRoot
*bundle
, char *tag
, int32_t value
, const struct UString
* comment
, UErrorCode
*status
);
116 void int_close(struct SResource
*intres
, UErrorCode
*status
);
121 char* fFileName
; /* file name for binary or import binary tags if any */
124 struct SResource
*bin_open(struct SRBRoot
*bundle
, const char *tag
, uint32_t length
, uint8_t *data
, const char* fileName
, const struct UString
* comment
, UErrorCode
*status
);
125 void bin_close(struct SResource
*binres
, UErrorCode
*status
);
127 /* Resource place holder */
132 uint32_t fSize
; /* Size in bytes outside the header part */
133 int line
; /* used internally to report duplicate keys in tables */
134 struct SResource
*fNext
; /*This is for internal chaining while building*/
135 struct UString
*fComment
;
137 struct SResTable fTable
;
138 struct SResArray fArray
;
139 struct SResString fString
;
140 struct SResIntVector fIntVector
;
141 struct SResInt fIntValue
;
142 struct SResBinary fBinaryValue
;
146 void res_close(struct SResource
*res
, UErrorCode
*status
);
147 void setIncludeCopyright(UBool val
);
148 UBool
getIncludeCopyright(void);
151 #endif /* #ifndef RESLIST_H */