From 3f4f09f5a980d448c03c14e0048a9a295a6ec023 Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Sat, 27 Mar 2004 07:05:32 +0000 Subject: [PATCH] ICU-3668 make getters const X-SVN-Rev: 14787 --- icu4c/source/common/rbbidata.cpp | 2 +- icu4c/source/common/rbbidata.h | 2 +- icu4c/source/common/rbbisetb.cpp | 6 +++--- icu4c/source/common/rbbisetb.h | 6 +++--- icu4c/source/common/rbbitblb.cpp | 2 +- icu4c/source/common/rbbitblb.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/icu4c/source/common/rbbidata.cpp b/icu4c/source/common/rbbidata.cpp index 60a3348eb0..f9e8073c37 100644 --- a/icu4c/source/common/rbbidata.cpp +++ b/icu4c/source/common/rbbidata.cpp @@ -189,7 +189,7 @@ RBBIDataWrapper *RBBIDataWrapper::addReference() { // getRuleSourceString // //----------------------------------------------------------------------------- -const UnicodeString &RBBIDataWrapper::getRuleSourceString() { +const UnicodeString &RBBIDataWrapper::getRuleSourceString() const { return fRuleString; } diff --git a/icu4c/source/common/rbbidata.h b/icu4c/source/common/rbbidata.h index 7ce9b20aea..2901d5c7e8 100644 --- a/icu4c/source/common/rbbidata.h +++ b/icu4c/source/common/rbbidata.h @@ -144,7 +144,7 @@ public: void removeReference(); UBool operator ==(const RBBIDataWrapper &other) const; int32_t hashCode(); - const UnicodeString &getRuleSourceString(); + const UnicodeString &getRuleSourceString() const; #ifdef RBBI_DEBUG void printData(); void printTable(const char *heading, const RBBIStateTable *table); diff --git a/icu4c/source/common/rbbisetb.cpp b/icu4c/source/common/rbbisetb.cpp index e5e3226c48..b84604036e 100644 --- a/icu4c/source/common/rbbisetb.cpp +++ b/icu4c/source/common/rbbisetb.cpp @@ -265,7 +265,7 @@ void RBBISetBuilder::build() { // getTrieSize() Return the size that will be required to serialize the Trie. // //----------------------------------------------------------------------------------- -int32_t RBBISetBuilder::getTrieSize() { +int32_t RBBISetBuilder::getTrieSize() /*const*/ { fTrieSize = utrie_serialize(fTrie, NULL, // Buffer 0, // Capacity @@ -339,7 +339,7 @@ void RBBISetBuilder::addValToSets(UVector *sets, uint32_t val) { // getNumOutputSets // //------------------------------------------------------------------------ -int32_t RBBISetBuilder::getNumCharCategories() { +int32_t RBBISetBuilder::getNumCharCategories() const { return fGroupCount + 1; } @@ -351,7 +351,7 @@ int32_t RBBISetBuilder::getNumCharCategories() { // the first UChar32 that is in the set of chars // in the category. //------------------------------------------------------------------------ -UChar32 RBBISetBuilder::getFirstChar(int32_t category) { +UChar32 RBBISetBuilder::getFirstChar(int32_t category) const { RangeDescriptor *rlRange; UChar32 retVal = (UChar32)-1; for (rlRange = fRangeList; rlRange!=0; rlRange=rlRange->fNext) { diff --git a/icu4c/source/common/rbbisetb.h b/icu4c/source/common/rbbisetb.h index fde3acc62c..d1450231a5 100644 --- a/icu4c/source/common/rbbisetb.h +++ b/icu4c/source/common/rbbisetb.h @@ -80,12 +80,12 @@ public: void build(); void addValToSets(UVector *sets, uint32_t val); - int32_t getNumCharCategories(); // CharCategories are the same as input symbol set to the + int32_t getNumCharCategories() const; // CharCategories are the same as input symbol set to the // runtime state machine, which are the same as // columns in the DFA state table - int32_t getTrieSize(); // Size in bytes of the serialized Trie. + int32_t getTrieSize() /*const*/; // Size in bytes of the serialized Trie. void serializeTrie(uint8_t *where); // write out the serialized Trie. - UChar32 getFirstChar(int32_t val); + UChar32 getFirstChar(int32_t val) const; #ifdef RBBI_DEBUG void printSets(); void printRanges(); diff --git a/icu4c/source/common/rbbitblb.cpp b/icu4c/source/common/rbbitblb.cpp index 2d77ea6450..ace924688a 100644 --- a/icu4c/source/common/rbbitblb.cpp +++ b/icu4c/source/common/rbbitblb.cpp @@ -887,7 +887,7 @@ void RBBITableBuilder::printPosSets(RBBINode *n) { // state transition table. // //----------------------------------------------------------------------------- -int32_t RBBITableBuilder::getTableSize() { +int32_t RBBITableBuilder::getTableSize() const { int32_t size = 0; int32_t numRows; int32_t numCols; diff --git a/icu4c/source/common/rbbitblb.h b/icu4c/source/common/rbbitblb.h index 5569b79217..593789a21c 100644 --- a/icu4c/source/common/rbbitblb.h +++ b/icu4c/source/common/rbbitblb.h @@ -38,7 +38,7 @@ public: ~RBBITableBuilder(); void build(); - int32_t getTableSize(); // Return the runtime size in bytes of + int32_t getTableSize() const; // Return the runtime size in bytes of // the built state table void exportTable(void *where); // fill in the runtime state table. // Sufficient memory must exist at