mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-20 20:19:32 +00:00
ICU-5447 Make it easier to enumerate items.
X-SVN-Rev: 20614
This commit is contained in:
parent
afd294656e
commit
0b66ebe18c
3 changed files with 16 additions and 7 deletions
|
@ -528,7 +528,11 @@ main(int argc, char *argv[]) {
|
|||
|
||||
/* list items */
|
||||
if(options[OPT_LIST_ITEMS].doesOccur) {
|
||||
pkg->listItems(stdout);
|
||||
int32_t i;
|
||||
|
||||
for(i=0; i<pkg->getItemCount(); ++i) {
|
||||
fprintf(stdout, "%s\n", pkg->getItem(i)->name);
|
||||
}
|
||||
}
|
||||
|
||||
/* check dependencies between items */
|
||||
|
|
|
@ -1139,13 +1139,17 @@ Package::extractItems(const char *filesPath, const Package &listPkg, char outTyp
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Package::listItems(FILE *file) {
|
||||
int32_t i;
|
||||
int32_t
|
||||
Package::getItemCount() {
|
||||
return itemCount;
|
||||
}
|
||||
|
||||
for(i=0; i<itemCount; ++i) {
|
||||
fprintf(file, "%s\n", items[i].name);
|
||||
const Item *
|
||||
Package::getItem(int32_t idx) {
|
||||
if (0 <= idx && idx < itemCount) {
|
||||
return &items[idx];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -107,7 +107,8 @@ public:
|
|||
/* This variant extracts an item to a specific filename. */
|
||||
void extractItem(const char *filesPath, const char *outName, int32_t index, char outType);
|
||||
|
||||
void listItems(FILE *file);
|
||||
int32_t getItemCount();
|
||||
const Item *getItem(int32_t idx);
|
||||
|
||||
/*
|
||||
* Check dependencies and return TRUE if all dependencies are fulfilled.
|
||||
|
|
Loading…
Add table
Reference in a new issue