ICU-4247 stub implementation of udata_setFileAccess()

X-SVN-Rev: 17781
This commit is contained in:
Steven R. Loomis 2005-06-02 21:00:00 +00:00
parent da83c2f563
commit f1d363aa6d
2 changed files with 39 additions and 0 deletions

View file

@ -78,6 +78,7 @@ static UDataMemory *gStubICUData = NULL; /* If gCommonICUData does get upda
static UHashtable *gCommonDataCache = NULL; /* Global hash table of opened ICU data files. */
static UDataFileAccess gDataFileAccess = UDATA_DEFAULT_ACCESS;
static UBool U_CALLCONV
udata_cleanup(void)
@ -1492,3 +1493,10 @@ udata_getInfo(UDataMemory *pData, UDataInfo *pInfo) {
}
}
}
U_CAPI void U_EXPORT2 udata_setFileAccess(UDataFileAccess fa)
{
gDataFileAccess = fa;
}

View file

@ -348,6 +348,37 @@ udata_setCommonData(const void *data, UErrorCode *err);
U_STABLE void U_EXPORT2
udata_setAppData(const char *packageName, const void *data, UErrorCode *err);
/**
* Possible settings for udata_setFileAccess()
* @see udata_setFileAccess
* @draft ICU 3.4
*/
typedef enum UDataFileAccess {
/** ICU does not access the file system for data loading. */
UDATA_NO_FILES,
/** ICU only loads data from packages, not from single files. */
UDATA_ONLY_PACKAGES,
/** ICU loads data from packages first, and only from single files
if the data cannot be found in a package. */
UDATA_PACKAGES_FIRST,
/** ICU looks for data in single files first, then in packages. (default) */
UDATA_FILES_FIRST,
/** An alias for the default access mode. */
UDATA_DEFAULT_ACCESS = UDATA_FILES_FIRST,
UDATA_FILE_ACCESS_COUNT
} UDataFileAccess;
/**
* This function may be called to control how ICU loads data. It must be called
* before any ICU data is loaded, including application data loaded with ures/ResourceBundle or
* udata APIs.
* @param fa The type of file access to be used
* @see UDataFileAccess
* @draft ICU 3.4
*/
U_DRAFT void U_EXPORT2
udata_setFileAccess(UDataFileAccess fa);
U_CDECL_END
#endif