/*
*******************************************************************************
*
-* Copyright (C) 2005-2007, International Business Machines
+* Copyright (C) 2005-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
// .dat package file representation ---------------------------------------- ***
#define STRING_STORE_SIZE 100000
-#define MAX_FILE_COUNT 2000
#define MAX_PKG_NAME_LENGTH 32
typedef void CheckDependency(void *context, const char *itemName, const char *targetName);
void addFile(const char *filesPath, const char *name);
void addItems(const Package &listPkg);
- void removeItem(int32_t index);
+ void removeItem(int32_t itemIndex);
void removeItems(const char *pattern);
void removeItems(const Package &listPkg);
/* The extractItem() functions accept outputType=0 to mean "don't swap the item". */
- void extractItem(const char *filesPath, int32_t index, char outType);
+ void extractItem(const char *filesPath, int32_t itemIndex, char outType);
void extractItems(const char *filesPath, const char *pattern, char outType);
void extractItems(const char *filesPath, const Package &listPkg, char outType);
/* This variant extracts an item to a specific filename. */
- void extractItem(const char *filesPath, const char *outName, int32_t index, char outType);
+ void extractItem(const char *filesPath, const char *outName, int32_t itemIndex, char outType);
int32_t getItemCount() const;
const Item *getItem(int32_t idx) const;
UBool checkDependencies();
/*
- * Enumerate all the dependencies and give the results to context and check
+ * Enumerate all the dependencies and give the results to context and call CheckDependency callback
+ * @param context user context (will be passed to check function)
+ * @param check will be called with context and any missing items
*/
void enumDependencies(void *context, CheckDependency check);
private:
void enumDependencies(Item *pItem, void *context, CheckDependency check);
+ /**
+ * Default CheckDependency function used by checkDependencies()
+ */
static void checkDependency(void *context, const char *itemName, const char *targetName);
/*
UBool inIsBigEndian;
int32_t itemCount;
- Item items[MAX_FILE_COUNT];
+ int32_t itemMax;
+ Item *items;
int32_t inStringTop, outStringTop;
char inStrings[STRING_STORE_SIZE], outStrings[STRING_STORE_SIZE];
// state for checkDependencies()
UBool isMissingItems;
+
+ /**
+ * Grow itemMax to new value
+ */
+ void setItemCapacity(int32_t max);
+
+ /**
+ * Grow itemMax to at least itemCount+1
+ */
+ void ensureItemCapacity();
};
U_NAMESPACE_END
#endif
+
+