ICU-3668 make getters const

X-SVN-Rev: 14806
This commit is contained in:
Alan Liu 2004-03-30 23:17:44 +00:00
parent a1bd7f50bf
commit 2e12dd0fa5
7 changed files with 22 additions and 22 deletions

View file

@ -293,15 +293,15 @@ int32_t ResourceBundle::getInt(UErrorCode& status) const {
return ures_getInt(fResource, &status);
}
const char *ResourceBundle::getName(void) {
const char *ResourceBundle::getName(void) const {
return ures_getName(fResource);
}
const char *ResourceBundle::getKey(void) {
const char *ResourceBundle::getKey(void) const {
return ures_getKey(fResource);
}
UResType ResourceBundle::getType(void) {
UResType ResourceBundle::getType(void) const {
return ures_getType(fResource);
}

View file

@ -260,15 +260,15 @@ ubrk_isBoundary(UBreakIterator *bi, int32_t offset)
U_CAPI int32_t U_EXPORT2
ubrk_getRuleStatus(UBreakIterator *bi)
ubrk_getRuleStatus(const UBreakIterator *bi)
{
return ((RuleBasedBreakIterator *)bi)->getRuleStatus();
return ((const RuleBasedBreakIterator *)bi)->getRuleStatus();
}
U_CAPI int32_t U_EXPORT2
ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status)
ubrk_getRuleStatusVec(const UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status)
{
return ((RuleBasedBreakIterator *)bi)->getRuleStatusVec(fillInVec, capacity, *status);
return ((/*const TODO: make this const*/ RuleBasedBreakIterator *)bi)->getRuleStatusVec(fillInVec, capacity, *status);
}

View file

@ -290,7 +290,7 @@ public:
* @stable ICU 2.0
*/
const char*
getKey(void);
getKey(void) const;
/**
* Gets the locale ID of the resource bundle as a string.
@ -300,7 +300,7 @@ public:
* @stable ICU 2.0
*/
const char*
getName(void);
getName(void) const;
/**
@ -310,7 +310,7 @@ public:
* @stable ICU 2.0
*/
UResType
getType(void);
getType(void) const;
/**
* Returns the next resource in a given resource or NULL if there are no more resources

View file

@ -523,7 +523,7 @@ ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
* @stable ICU 2.2
*/
U_STABLE int32_t U_EXPORT2
ubrk_getRuleStatus(UBreakIterator *bi);
ubrk_getRuleStatus(const UBreakIterator *bi);
/**
* Get the statuses from the break rules that determined the most recently
@ -543,7 +543,7 @@ ubrk_getRuleStatus(UBreakIterator *bi);
* @draft ICU 3.0
*/
U_DRAFT int32_t U_EXPORT2
ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
ubrk_getRuleStatusVec(const UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
/**
* Return the locale of the break iterator. You can choose between the valid and

View file

@ -438,7 +438,7 @@ ures_getInt(const UResourceBundle* resourceBundle,
* @stable ICU 2.0
*/
U_STABLE int32_t U_EXPORT2
ures_getSize(UResourceBundle *resourceBundle);
ures_getSize(const UResourceBundle *resourceBundle);
/**
* Returns the type of a resource. Available types are defined in enum UResType
@ -449,7 +449,7 @@ ures_getSize(UResourceBundle *resourceBundle);
* @stable ICU 2.0
*/
U_STABLE UResType U_EXPORT2
ures_getType(UResourceBundle *resourceBundle);
ures_getType(const UResourceBundle *resourceBundle);
/**
* Returns the key associated with a given resource. Not all the resources have a key - only
@ -460,7 +460,7 @@ ures_getType(UResourceBundle *resourceBundle);
* @stable ICU 2.0
*/
U_STABLE const char * U_EXPORT2
ures_getKey(UResourceBundle *resourceBundle);
ures_getKey(const UResourceBundle *resourceBundle);
/* ITERATION API
This API provides means for iterating through a resource
@ -483,7 +483,7 @@ ures_resetIterator(UResourceBundle *resourceBundle);
* @stable ICU 2.0
*/
U_STABLE UBool U_EXPORT2
ures_hasNext(UResourceBundle *resourceBundle);
ures_hasNext(const UResourceBundle *resourceBundle);
/**
* Returns the next resource in a given resource or NULL if there are no more resources

View file

@ -949,7 +949,7 @@ U_CAPI uint32_t U_EXPORT2 ures_getUInt(const UResourceBundle* resB, UErrorCode *
}
U_CAPI UResType U_EXPORT2 ures_getType(UResourceBundle *resB) {
U_CAPI UResType U_EXPORT2 ures_getType(const UResourceBundle *resB) {
UResType type;
if(resB == NULL) {
@ -959,7 +959,7 @@ U_CAPI UResType U_EXPORT2 ures_getType(UResourceBundle *resB) {
return type == URES_TABLE32 ? URES_TABLE : type;
}
U_CAPI const char * U_EXPORT2 ures_getKey(UResourceBundle *resB) {
U_CAPI const char * U_EXPORT2 ures_getKey(const UResourceBundle *resB) {
if(resB == NULL) {
return NULL;
}
@ -967,7 +967,7 @@ U_CAPI const char * U_EXPORT2 ures_getKey(UResourceBundle *resB) {
return(resB->fKey);
}
U_CAPI int32_t U_EXPORT2 ures_getSize(UResourceBundle *resB) {
U_CAPI int32_t U_EXPORT2 ures_getSize(const UResourceBundle *resB) {
if(resB == NULL) {
return 0;
}
@ -994,7 +994,7 @@ U_CAPI void U_EXPORT2 ures_resetIterator(UResourceBundle *resB){
resB->fIndex = -1;
}
U_CAPI UBool U_EXPORT2 ures_hasNext(UResourceBundle *resB) {
U_CAPI UBool U_EXPORT2 ures_hasNext(const UResourceBundle *resB) {
if(resB == NULL) {
return FALSE;
}
@ -1786,7 +1786,7 @@ U_CFUNC void ures_setIsStackObject( UResourceBundle* resB, UBool state) {
}
}
U_CFUNC UBool ures_isStackObject(UResourceBundle* resB) {
U_CFUNC UBool ures_isStackObject(const UResourceBundle* resB) {
return((resB->fMagic1 == MAGIC1 && resB->fMagic2 == MAGIC2)?FALSE:TRUE);
}

View file

@ -80,7 +80,7 @@ struct UResourceBundle {
U_CAPI void U_EXPORT2 ures_initStackObject(UResourceBundle* resB);
U_CFUNC void ures_setIsStackObject( UResourceBundle* resB, UBool state);
U_CFUNC UBool ures_isStackObject( UResourceBundle* resB);
U_CFUNC UBool ures_isStackObject(const UResourceBundle* resB);
/* Some getters used by the copy constructor */
U_CFUNC const char* ures_getName(const UResourceBundle* resB);