Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
00001 /******************************************************************************** 00002 * * 00003 * U T F - 1 6 T e x t C o d e c * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2002,2005 by Lyle Johnson. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXUTF16Codec.h,v 1.4 2005/01/16 16:06:06 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXUTF16CODEC_H 00025 #define FXUTF16CODEC_H 00026 00027 #ifndef FXTEXTCODEC_H 00028 #include "FXTextCodec.h" 00029 #endif 00030 00031 00032 ////////////////////////////// UNDER DEVELOPMENT ////////////////////////////// 00033 00034 00035 namespace FX { 00036 00037 /** 00038 * Codec for UTF-16 00039 */ 00040 class FXUTF16Codec : public FXTextCodec { 00041 public: 00042 00043 /// Constructor 00044 FXUTF16Codec(){} 00045 00046 /** 00047 * Convert a sequence of wide characters from Unicode to UTF-16. 00048 * Reads at most n wide characters from src and writes at most m 00049 * bytes into dest. Returns the number of characters actually 00050 * written into dest. 00051 * 00052 * On exit, the src and dest pointers are updated to point to the next 00053 * available character (or byte) for reading (writing). 00054 */ 00055 virtual unsigned long fromUnicode(FXuchar*& dest,unsigned long m,const FXwchar*& src,unsigned long n); 00056 00057 /** 00058 * Insert byte-order mark (BOM) into the stream 00059 */ 00060 unsigned long insertBOM(FXuchar*& dest,unsigned long m); 00061 00062 /** 00063 * Convert a sequence of bytes in UTF-16 encoding to a sequence 00064 * of wide characters (Unicode). Reads at most n bytes from src and 00065 * writes at most m characters into dest. Returns the number of characters 00066 * actually read from src. 00067 * 00068 * On exit, the src and dest pointers are updated to point to the next 00069 * available byte (or character) for writing (reading). 00070 */ 00071 virtual unsigned long toUnicode(FXwchar*& dest,unsigned long m,const FXuchar*& src,unsigned long n); 00072 00073 /** 00074 * Return the IANA mime name for this codec. 00075 */ 00076 virtual const FXchar* mimeName() const; 00077 00078 /** 00079 * Return the Management Information Base (MIBenum) for the character set. 00080 */ 00081 virtual FXint mibEnum() const; 00082 00083 /// Destructor 00084 virtual ~FXUTF16Codec(){} 00085 }; 00086 00087 } 00088 00089 #endif 00090
Copyright © 1997-2005 Jeroen van der Zijp |