Foxit PDF SDK
fx_string.h 文件参考

字符串的头文件,可变长度字符序列。 这里有两种字符串,字节字符串和宽字符串 更多...

浏览源代码.

class  CFX_ByteString
 字节字符串类 更多...
 
class  CFX_ByteStringC
 常量字节字符串类 更多...
 
class  CFX_StringBufBase
 固定字符串缓冲区,最多容纳特定数量的字符。 更多...
 
class  CFX_StringBufTemplate< limit >
 固定字符串缓冲区模板。 更多...
 
struct  CFX_StringData
 此类表示字节字符串对象的数据。 更多...
 
struct  CFX_StringDataW
 此类表示宽字符串对象的数据。 更多...
 
class  CFX_WideString
 宽字符串类 更多...
 
class  CFX_WideStringC
 常量宽字符串类 更多...
 

宏定义

#define FX_BSTRC(str)   CFX_ByteStringC(str, sizeof str-1)
 指定字符串常量时,所有应用程序都应使用以下宏。 "str"必须是字符字符串常量。 更多...
 
#define FXBSTR_ID(c1, c2, c3, c4)   ((c1 << 24) | (c2 << 16) | (c3 << 8) | (c4))
 从四个整数值构造ID。
 
#define FXFORMAT_CAPITAL   4
 用于格式化整数:与FXFORMAT_HEX一起使用以产生大写十六进制字母
 
#define FXFORMAT_HEX   2
 用于格式化整数:使用十六进制格式
 
#define FXFORMAT_SIGNED   1
 用于格式化整数:值是有符号的。
 

类型定义

typedef int FX_STRSIZE
 字符串大小限制为 2^31-1。
 

函数

宽字符串连接操作

连接操作符(+)的两侧可以是:

  • 带缓冲的宽字符串 (const CFX_WideString&);
  • 非缓冲的宽字符串 (const CFX_WideStringC&);
  • 以零结尾的C风格宽字符串 (FX_LPCWSTR);
  • 单个字符 (FX_WCHAR);

但您必须在一侧至少有一个CFX_WideString或CFX_WideStringC。

CFX_WideString operator+ (const CFX_WideString &str1, const CFX_WideString &str2)
 连接带缓冲字节字符串和带缓冲字节字符串。 更多...
 
CFX_WideString operator+ (const CFX_WideString &str1, const CFX_WideStringC &str2)
 连接带缓冲字节字符串和非缓冲字节字符串。 更多...
 
CFX_WideString operator+ (const CFX_WideString &str1, FX_LPCWSTR str2)
 连接带缓冲宽字符串和以零结尾的C风格字符串。 更多...
 
CFX_WideString operator+ (const CFX_WideString &str1, FX_WCHAR ch)
 连接带缓冲字节字符串和单个字符或字节。 更多...
 
CFX_WideString operator+ (const CFX_WideStringC &str1, const CFX_WideString &str2)
 连接非缓冲字节字符串和带缓冲字节字符串。 更多...
 
CFX_WideString operator+ (const CFX_WideStringC &str1, const CFX_WideStringC &str2)
 连接非缓冲宽字符串和非缓冲宽字符串。 更多...
 
CFX_WideString operator+ (const CFX_WideStringC &str1, FX_LPCWSTR str2)
 连接非缓冲字节字符串和以零结尾的C风格字符串 更多...
 
CFX_WideString operator+ (const CFX_WideStringC &str1, FX_WCHAR ch)
 连接非缓冲字节字符串和单个字符或字节。 更多...
 
CFX_WideString operator+ (FX_LPCWSTR str1, const CFX_WideString &str2)
 连接以零结尾的C风格字符串和带缓冲字节字符串。 更多...
 
CFX_WideString operator+ (FX_LPCWSTR str1, const CFX_WideStringC &str2)
 连接以零结尾的C风格字符串和非缓冲字节字符串。 更多...
 
CFX_WideString operator+ (FX_WCHAR ch, const CFX_WideString &str2)
 连接单个字符或字节和带缓冲字节字符串。 更多...
 
CFX_WideString operator+ (FX_WCHAR ch, const CFX_WideStringC &str2)
 连接单个字符或字节和非缓冲字节字符串。 更多...
 
宽字符串比较操作
FX_FLOAT FX_atof (FX_BSTR str)
 将非缓冲字节字符串转换为浮点数。 更多...
 
void FX_atonum (FX_BSTR str, FX_BOOL &bInteger, void *pData, int sizeOfData=4)
 将非缓冲字节字符串转换为数字。 更多...
 
FX_STRSIZE FX_ftoa (FX_FLOAT f, FX_LPSTR buf, int precision=0)
 将浮点数转换为字节字符串。 更多...
 
bool operator!= (const CFX_WideString &s1, const CFX_WideString &s2)
 比较(!=)操作符重载。区分大小写。 更多...
 
bool operator!= (const CFX_WideString &s1, const CFX_WideStringC &s2)
 比较(!=)操作符重载。区分大小写。 更多...
 
bool operator!= (const CFX_WideString &s1, FX_LPCWSTR s2)
 比较(!=)操作符重载。区分大小写。 更多...
 
bool operator!= (const CFX_WideStringC &s1, const CFX_WideString &s2)
 比较(!=)操作符重载。区分大小写。 更多...
 
bool operator!= (FX_LPCWSTR s1, const CFX_WideString &s2)
 比较(!=)操作符重载。区分大小写。 更多...
 
bool operator< (const CFX_WideString &lhs, const CFX_WideString &rhs)
 比较(<)操作符重载。区分大小写。 更多...
 
bool operator== (const CFX_WideString &s1, const CFX_WideString &s2)
 比较(==)操作符重载。区分大小写。 更多...
 
bool operator== (const CFX_WideString &s1, const CFX_WideStringC &s2)
 比较(==)操作符重载。区分大小写。 更多...
 
bool operator== (const CFX_WideString &s1, FX_LPCWSTR s2)
 比较(==)操作符重载。区分大小写。 更多...
 
bool operator== (const CFX_WideStringC &s1, const CFX_WideString &s2)
 比较(==)操作符重载。区分大小写。 更多...
 
bool operator== (FX_LPCWSTR s1, const CFX_WideString &s2)
 比较(==)操作符重载。区分大小写。 更多...
 
基本Unicode字符属性例程
FX_WCHAR FXWCHAR_GetLower (FX_WCHAR wchar)
 转换为小写字母。 更多...
 
FX_WCHAR FXWCHAR_GetUpper (FX_WCHAR wchar)
 转换为大写字母。 更多...
 
FX_BOOL FXWCHAR_IsSpace (FX_WCHAR wchar)
 检查Unicode是否为空格。 更多...
 
FX_BOOL FXWCHAR_IsWordBreak (FX_WCHAR wchar)
 检查Unicode是否可以断词。 更多...
 
将宽字符串编码为UTF-8字节字符串
FX_DWORD FX_CreateCodePointFromUtf16SurrogatePair (FX_WCHAR first, FX_WCHAR second)
 从UTF16代理对创建Unicode代码点。 更多...
 
FX_BOOL FX_CreateUtf16SurrogatePairFromCodePoint (FX_DWORD unicode, FX_WCHAR &first, FX_WCHAR &second)
 从Unicode代码点创建UTF16代理对。 更多...
 
FX_BOOL FX_IsUtf16SurrogatePair (FX_WCHAR first, FX_WCHAR second)
 确定参数是否构成UTF-16代理对。 更多...
 
CFX_ByteString FX_UTF8Encode (const CFX_WideString &wsStr)
 将宽字符串编码为UTF-8字符串。 更多...
 
CFX_ByteString FX_UTF8Encode (FX_LPCWSTR pwsStr, FX_STRSIZE len)
 将宽字符串编码为UTF-8字符串。 更多...
 
void FX_UTF8Encode (FX_LPCWSTR pwsStr, FX_STRSIZE len, CFX_ByteStringL &utf8Str, IFX_Allocator *pAllocator=NULL)
 
CFX_ByteString FX_UTF8Encode (FX_WSTR wsStr)
 将宽字符串编码为UTF-8字符串。 更多...
 

变量

const typedef CFX_ByteStringCFX_BSTR
 常量CFX_ByteStringC对象的引用。
 

字节字符串连接操作

连接操作符(+)的两边可以是:

  • 缓冲字节字符串(const CFX_ByteString&);
  • 非缓冲字节字符串(const CFX_ByteStringC&,即FX_BSTR);
  • 以零结尾的C风格字符串(FX_LPCSTR);
  • 单个字符或字节(FX_CHAR);
typedef CFX_StringBufTemplate< 256 > CFX_StringBuf256
 固定的256字节字符串缓冲区。
 
const typedef CFX_WideStringCFX_WSTR
 常量CFX_WideStringC对象的引用的类型定义。
 
#define FX_WSTRC(wstr)   CFX_WideStringC((FX_LPCWSTR)wstr, sizeof(wstr) / sizeof(FX_WCHAR) - 1)
 所有应用程序在指定宽字符串常量时都应使用以下宏。 "wstr"必须是宽字符串常量。 更多...
 
CFX_ByteString operator+ (const CFX_ByteString &str1, const CFX_ByteString &str2)
 连接缓冲字节字符串和缓冲字节字符串。 更多...
 
CFX_ByteString operator+ (const CFX_ByteString &str1, FX_BSTR str2)
 连接缓冲字节字符串和非缓冲字节字符串。 更多...
 
CFX_ByteString operator+ (const CFX_ByteString &str1, FX_CHAR ch)
 连接缓冲字节字符串和单个字符或字节。 更多...
 
CFX_ByteString operator+ (const CFX_ByteString &str1, FX_LPCSTR str2)
 连接缓冲字节字符串和以零结尾的C风格字符串。 更多...
 
CFX_ByteString operator+ (FX_BSTR str1, const CFX_ByteString &str2)
 连接非缓冲字节字符串和缓冲字节字符串。 更多...
 
CFX_ByteString operator+ (FX_BSTR str1, FX_BSTR str2)
 连接非缓冲字节字符串和非缓冲字节字符串。 更多...
 
CFX_ByteString operator+ (FX_BSTR str1, FX_CHAR ch)
 连接非缓冲字节字符串和单个字符或字节。 更多...
 
CFX_ByteString operator+ (FX_BSTR str1, FX_LPCSTR str2)
 连接非缓冲字节字符串和以零结尾的C风格字符串 更多...
 
CFX_ByteString operator+ (FX_CHAR ch, const CFX_ByteString &str2)
 连接单个字符或字节和缓冲字节字符串。 更多...
 
CFX_ByteString operator+ (FX_CHAR ch, FX_BSTR str2)
 连接单个字符或字节和非缓冲字节字符串。 更多...
 
CFX_ByteString operator+ (FX_LPCSTR str1, const CFX_ByteString &str2)
 连接以零结尾的C风格字符串和缓冲字节字符串。 更多...
 
CFX_ByteString operator+ (FX_LPCSTR str1, FX_BSTR str2)
 连接以零结尾的C风格字符串和非缓冲字节字符串。 更多...
 

文本方向定义

int FXWCHAR_GetDirection (FX_WCHAR wchar)
 获取文本方向。 更多...
 
#define FXWCHAR_LTR   0
 从左到右的顺序
 
#define FXWCHAR_RTL   1
 从右到左的顺序
 
#define FXWCHAR_UNKNOWN   2
 不确定顺序或不关心
 

详细描述

字符串的头文件,可变长度字符序列。 这里有两种字符串,字节字符串和宽字符串

Copyright (C) 2003-2026, Foxit Software Inc.. All Rights Reserved.

http://www.foxitsoftware.com

The following code is copyrighted and is the proprietary of Foxit Software Inc.. It is not allowed to distribute any parts of Foxit PDF SDK to third party or public without permission unless an agreement is signed between Foxit Software Inc. and customers to explicitly grant customers permissions.