本文整理汇总了C++中FX_BSTR::GetCStr方法的典型用法代码示例。如果您正苦于以下问题:C++ FX_BSTR::GetCStr方法的具体用法?C++ FX_BSTR::GetCStr怎么用?C++ FX_BSTR::GetCStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FX_BSTR
的用法示例。
在下文中一共展示了FX_BSTR::GetCStr方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScanPath
void CFPF_SkiaFontMgr::ScanPath(FX_BSTR path)
{
void *handle = FX_OpenFolder(path.GetCStr());
if (!handle) {
return;
}
CFX_ByteString filename;
FX_BOOL bFolder = FALSE;
while (FX_GetNextFile(handle, filename, bFolder)) {
if (bFolder) {
if (filename == FX_BSTRC(".") || filename == FX_BSTRC("..")) {
continue;
}
} else {
CFX_ByteString ext = filename.Right(4);
ext.MakeLower();
if (ext != FX_BSTRC(".ttf") && ext != FX_BSTRC(".ttc")) {
continue;
}
}
CFX_ByteString fullpath = path;
fullpath += "/";
fullpath += filename;
if (bFolder) {
ScanPath(fullpath);
} else {
ScanFile(fullpath);
}
}
FX_CloseFolder(handle);
}
示例2: Open
FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_BSTR fileName, FX_DWORD dwMode)
{
if (m_hFile) {
return FALSE;
}
CFX_ByteString strMode;
FXCRT_GetFileModeString(dwMode, strMode);
m_hFile = FXSYS_fopen(fileName.GetCStr(), (FX_LPCSTR)strMode);
return m_hFile != NULL;
}
示例3: Open
FX_BOOL CFXCRT_FileAccess_Posix::Open(FX_BSTR fileName, FX_DWORD dwMode)
{
if (m_nFD > -1) {
return FALSE;
}
FX_INT32 nFlags, nMasks;
FXCRT_Posix_GetFileMode(dwMode, nFlags, nMasks);
m_nFD = open(fileName.GetCStr(), nFlags, nMasks);
return m_nFD > -1;
}
示例4: ScanFile
void CFPF_SkiaFontMgr::ScanFile(FX_BSTR file)
{
FXFT_Face face = GetFontFace(file);
if (face) {
CFPF_SkiaPathFont *pFontDesc = new CFPF_SkiaPathFont;
pFontDesc->SetPath(file.GetCStr());
ReportFace(face, pFontDesc);
m_FontFaces.Add(pFontDesc);
FXFT_Done_Face(face);
}
}
示例5: FPF_SKIANormalizeFontName
static FX_DWORD FPF_SKIANormalizeFontName(FX_BSTR bsfamily)
{
FX_DWORD dwHash = 0;
FX_INT32 iLength = bsfamily.GetLength();
FX_LPCSTR pBuffer = bsfamily.GetCStr();
for (FX_INT32 i = 0; i < iLength; i++) {
FX_CHAR ch = pBuffer[i];
if (ch == ' ' || ch == '-' || ch == ',') {
continue;
}
dwHash = 31 * dwHash + FXSYS_tolower(ch);
}
return dwHash;
}
示例6: GetFontFace
FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_BSTR bsFile, FX_INT32 iFaceIndex )
{
if (bsFile.IsEmpty()) {
return NULL;
}
if (iFaceIndex < 0) {
return NULL;
}
FXFT_Open_Args args;
args.flags = FT_OPEN_PATHNAME;
args.pathname = (FT_String*)bsFile.GetCStr();
FXFT_Face face;
if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face)) {
return FALSE;
}
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
}
示例7: FX_File_Move
FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
{
return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
}
示例8: FX_File_Delete
FX_BOOL FX_File_Delete(FX_BSTR fileName)
{
return remove(fileName.GetCStr()) > -1;
}
示例9: FX_File_Exist
FX_BOOL FX_File_Exist(FX_BSTR fileName)
{
return access(fileName.GetCStr(), F_OK) > -1;
}