Classes and structures used internally to this file and intl implementation
| 139 | |
| 140 | // Classes and structures used internally to this file and intl implementation |
| 141 | class CharSetContainer |
| 142 | { |
| 143 | public: |
| 144 | CharSetContainer(MemoryPool& p, USHORT cs_id, const SubtypeInfo* info); |
| 145 | |
| 146 | void release(thread_db* tdbb) |
| 147 | { |
| 148 | for (FB_SIZE_T i = 0; i < charset_collations.getCount(); i++) |
| 149 | { |
| 150 | if (charset_collations[i]) |
| 151 | charset_collations[i]->release(tdbb); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | void destroy(thread_db* tdbb) |
| 156 | { |
| 157 | cs->destroy(); |
| 158 | for (FB_SIZE_T i = 0; i < charset_collations.getCount(); i++) |
| 159 | { |
| 160 | if (charset_collations[i]) |
| 161 | charset_collations[i]->destroy(tdbb); |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | CharSet* getCharSet() { return cs; } |
| 166 | |
| 167 | Collation* lookupCollation(thread_db* tdbb, USHORT tt_id); |
| 168 | void unloadCollation(thread_db* tdbb, USHORT tt_id); |
| 169 | |
| 170 | CsConvert lookupConverter(thread_db* tdbb, CHARSET_ID to_cs); |
| 171 | |
| 172 | static CharSetContainer* lookupCharset(thread_db* tdbb, USHORT ttype); |
| 173 | static Lock* createCollationLock(thread_db* tdbb, USHORT ttype, void* object = NULL); |
| 174 | |
| 175 | private: |
| 176 | static bool lookupInternalCharSet(USHORT id, SubtypeInfo* info); |
| 177 | |
| 178 | private: |
| 179 | Firebird::Array<Collation*> charset_collations; |
| 180 | CharSet* cs; |
| 181 | }; |
| 182 | |
| 183 | |
| 184 | CharSetContainer* CharSetContainer::lookupCharset(thread_db* tdbb, USHORT ttype) |