Changeset 1279 for branches/New_Config_Format-branch/gsdl/lib/gsdlunicode.h
- Timestamp:
- 2000-07-13T10:21:53+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New_Config_Format-branch/gsdl/lib/gsdlunicode.h
r1076 r1279 215 215 }; 216 216 217 218 // Simple input and output converter classes for use with 8 bit encodings 219 // using simple textual map files. Map files should contain (at least) two 220 // tab-separated fields. The first field is the mapped value and the second 221 // field is the unicode value. 222 223 struct ltus_t 224 { 225 bool operator()(const unsigned short &t1, const unsigned short &t2) const 226 { return t1 < t2; } 227 }; 228 229 230 class simplemapconvert { 231 public: 232 simplemapconvert () {absentc=0; loaded=false;} 233 unsigned short convert (unsigned short c, bool in); 234 void setmapfile (const text_t &themapfile) {mapfile = themapfile;} 235 236 protected: 237 bool loadmapfile (bool in); 238 239 map <unsigned short, unsigned short, ltus_t> mapping; 240 bool loaded; 241 text_t mapfile; 242 unsigned short absentc; 243 }; 244 245 246 class simplemapinconvertclass : public inconvertclass { 247 public: 248 virtual ~simplemapinconvertclass () {} 249 250 void convert (text_t &output, status_t &status); 251 252 void setmapfile (const text_t &themapfile) {converter.setmapfile(themapfile);} 253 254 protected: 255 simplemapconvert converter; 256 }; 257 258 class simplemapoutconvertclass : public rzwsoutconvertclass { 259 public: 260 virtual ~simplemapoutconvertclass () {} 261 262 void convert (char *output, size_t maxlen, 263 size_t &len, status_t &status); 264 265 void setmapfile (const text_t &themapfile) {converter.setmapfile(themapfile);} 266 267 protected: 268 simplemapconvert converter; 269 }; 270 271 272 273 217 274 #endif
Note:
See TracChangeset
for help on using the changeset viewer.