📄 converter.h
字号:
#ifndef _LANG_CONVERTER_H
#define _LANG_CONVERTER_H
#include <lang/Object.h>
namespace lang
{
/**
* Character encoding/decoding interface.
* Converts to/from Unicode code points.
*
*
* @ingroup lang
*/
class Converter :
public lang::Object
{
public:
/**
* Decodes bytes to single Unicode code point.
* Ignores invalid input byte sequences.
*
* @param src Ptr to the source data.
* @param srcend Ptr to the end of source data.
* @param srcbytes [out] Receives number of bytes decoded.
* @param dst [out] Receives decoded Unicode code point (if byte sequence was not malformed).
* @return false if decoded byte sequence was malformed.
*/
virtual bool decode( const void* src, const void* srcend, int* srcbytes, int* dst ) const = 0;
/**
* Encodes single Unicode code point to bytes.
*
* @param dst Destination buffer which receives encoded byte sequence.
* @param dstend End of the destination buffer.
* @param dstbytes [out] Receives number of bytes encoded.
* @param src Unicode code point to encode.
* @return false if the code point couldn't be encoded.
*/
virtual bool encode( void* dst, void* dstend, int* dstbytes, int src ) const = 0;
};
} // lang
#endif // _LANG_CONVERTER_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -