本文整理汇总了C++中FX_BSTR类的典型用法代码示例。如果您正苦于以下问题:C++ FX_BSTR类的具体用法?C++ FX_BSTR怎么用?C++ FX_BSTR使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FX_BSTR类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkipLiterals
void CXML_Parser::SkipLiterals(FX_BSTR str)
{
m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
if (IsEOF()) {
return;
}
FX_INT32 i = 0, iLen = str.GetLength();
do {
while (m_dwIndex < m_dwBufferSize) {
if (str.GetAt(i) != m_pBuffer[m_dwIndex ++]) {
i = 0;
} else {
i ++;
if (i == iLen) {
break;
}
}
}
m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
if (i == iLen) {
return;
}
if (m_dwIndex < m_dwBufferSize || IsEOF()) {
break;
}
} while (ReadNextBlock());
while (!m_pDataAcc->IsEOF()) {
ReadNextBlock();
m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwBufferSize;
}
m_dwIndex = m_dwBufferSize;
}
示例2: 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;
}
示例3: FX_OpenFolder
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);
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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);
}
}
示例8: RemoveAt
void CXML_AttrMap::RemoveAt(FX_BSTR space, FX_BSTR name)
{
if (m_pMap == NULL) {
return;
}
for (int i = 0; i < m_pMap->GetSize(); i ++) {
CXML_AttrItem& item = GetAt(i);
if ((space.IsEmpty() || item.m_QSpaceName == space) && item.m_AttrName == name) {
m_pMap->RemoveAt(i);
return;
}
}
}
示例9: CountElements
FX_DWORD CXML_Element::CountElements(FX_BSTR space, FX_BSTR tag) const
{
int count = 0;
for (int i = 0; i < m_Children.GetSize(); i += 2) {
ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
if (type != Element) {
continue;
}
CXML_Element* pKid = (CXML_Element*)m_Children.GetAt(i + 1);
if ((space.IsEmpty() || pKid->m_QSpaceName == space) && pKid->m_TagName == tag) {
count ++;
}
}
return count;
}
示例10: FX_BSTRC
CFX_ByteString CXML_Element::GetNamespaceURI(FX_BSTR qName) const
{
const CFX_WideString* pwsSpace;
const CXML_Element *pElement = this;
do {
if (qName.IsEmpty()) {
pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC(""), FX_BSTRC("xmlns"));
} else {
pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC("xmlns"), qName);
}
if (pwsSpace) {
break;
}
pElement = pElement->GetParent();
} while(pElement);
return pwsSpace ? FX_UTF8Encode(*pwsSpace) : CFX_ByteString();
}
示例11: SetAt
void CXML_AttrMap::SetAt(FX_BSTR space, FX_BSTR name, FX_WSTR value)
{
for (int i = 0; i < GetSize(); i++) {
CXML_AttrItem& item = GetAt(i);
if ((space.IsEmpty() || item.m_QSpaceName == space) && item.m_AttrName == name) {
item.m_Value = value;
return;
}
}
if (!m_pMap) {
m_pMap = FX_NEW CFX_ObjectArray < CXML_AttrItem > ;
}
if (!m_pMap) {
return;
}
CXML_AttrItem* pItem = (CXML_AttrItem*)m_pMap->AddSpace();
if (!pItem) {
return;
}
pItem->m_QSpaceName = space;
pItem->m_AttrName = name;
pItem->m_Value = value;
}
示例12: FX_File_Move
FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
{
return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
}
示例13: FX_File_Delete
FX_BOOL FX_File_Delete(FX_BSTR fileName)
{
return remove(fileName.GetCStr()) > -1;
}
示例14: FX_File_Exist
FX_BOOL FX_File_Exist(FX_BSTR fileName)
{
return access(fileName.GetCStr(), F_OK) > -1;
}