本文整理汇总了C++中CFX_ByteStringC::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_ByteStringC::IsEmpty方法的具体用法?C++ CFX_ByteStringC::IsEmpty怎么用?C++ CFX_ByteStringC::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_ByteStringC
的用法示例。
在下文中一共展示了CFX_ByteStringC::IsEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool CFX_ByteString::operator==(const CFX_ByteStringC& str) const {
if (!m_pData)
return str.IsEmpty();
return m_pData->m_nDataLength == str.GetLength() &&
FXSYS_memcmp(m_pData->m_String, str.c_str(), str.GetLength()) == 0;
}
示例2: FindTagParam
FX_BOOL CPDF_SimpleParser::FindTagParam(const CFX_ByteStringC& token,
int nParams) {
nParams++;
FX_DWORD* pBuf = FX_Alloc(FX_DWORD, nParams);
int buf_index = 0;
int buf_count = 0;
while (1) {
pBuf[buf_index++] = m_dwCurPos;
if (buf_index == nParams) {
buf_index = 0;
}
buf_count++;
if (buf_count > nParams) {
buf_count = nParams;
}
CFX_ByteStringC word = GetWord();
if (word.IsEmpty()) {
FX_Free(pBuf);
return FALSE;
}
if (word == token) {
if (buf_count < nParams) {
continue;
}
m_dwCurPos = pBuf[buf_index];
FX_Free(pBuf);
return TRUE;
}
}
return FALSE;
}
示例3: Parse
FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
{
while (1) {
CFX_ByteStringC word = parser.GetWord();
if (word.IsEmpty()) {
return FALSE;
}
if (word == FX_BSTRC("}")) {
return TRUE;
}
if (word == FX_BSTRC("{")) {
CPDF_PSProc* pProc = FX_NEW CPDF_PSProc;
m_Operators.Add((FX_LPVOID)PSOP_PROC);
m_Operators.Add(pProc);
if (!pProc->Parse(parser)) {
return FALSE;
}
} else {
int i = 0;
while (_PDF_PSOpNames[i].name) {
if (word == CFX_ByteStringC(_PDF_PSOpNames[i].name)) {
m_Operators.Add((FX_LPVOID)_PDF_PSOpNames[i].op);
break;
}
i ++;
}
if (_PDF_PSOpNames[i].name == NULL) {
FX_FLOAT* pd = FX_Alloc(FX_FLOAT, 1);
*pd = FX_atof(word);
m_Operators.Add((FX_LPVOID)PSOP_CONST);
m_Operators.Add(pd);
}
}
}
}
示例4: Parse
FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser* parser) {
while (1) {
CFX_ByteStringC word = parser->GetWord();
if (word.IsEmpty()) {
return FALSE;
}
if (word == "}") {
return TRUE;
}
if (word == "{") {
std::unique_ptr<CPDF_PSProc> proc(new CPDF_PSProc);
std::unique_ptr<CPDF_PSOP> op(new CPDF_PSOP(std::move(proc)));
m_Operators.push_back(std::move(op));
if (!m_Operators.back()->GetProc()->Parse(parser)) {
return FALSE;
}
} else {
bool found = false;
for (const PDF_PSOpName& op_name : PDF_PSOpNames) {
if (word == CFX_ByteStringC(op_name.name)) {
std::unique_ptr<CPDF_PSOP> op(new CPDF_PSOP(op_name.op));
m_Operators.push_back(std::move(op));
found = true;
break;
}
}
if (!found) {
std::unique_ptr<CPDF_PSOP> op(new CPDF_PSOP(FX_atof(word)));
m_Operators.push_back(std::move(op));
}
}
}
}
示例5: FXJSE_ThrowMessage
void FXJSE_ThrowMessage(const CFX_ByteStringC& utf8Name,
const CFX_ByteStringC& utf8Message) {
v8::Isolate* pIsolate = v8::Isolate::GetCurrent();
ASSERT(pIsolate);
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate);
v8::Local<v8::String> hMessage = v8::String::NewFromUtf8(
pIsolate, utf8Message.GetCStr(), v8::String::kNormalString,
utf8Message.GetLength());
v8::Local<v8::Value> hError;
if (utf8Name == "RangeError") {
hError = v8::Exception::RangeError(hMessage);
} else if (utf8Name == "ReferenceError") {
hError = v8::Exception::ReferenceError(hMessage);
} else if (utf8Name == "SyntaxError") {
hError = v8::Exception::SyntaxError(hMessage);
} else if (utf8Name == "TypeError") {
hError = v8::Exception::TypeError(hMessage);
} else {
hError = v8::Exception::Error(hMessage);
if (utf8Name != "Error" && !utf8Name.IsEmpty()) {
hError.As<v8::Object>()->Set(
v8::String::NewFromUtf8(pIsolate, "name"),
v8::String::NewFromUtf8(pIsolate, utf8Name.GetCStr(),
v8::String::kNormalString,
utf8Name.GetLength()));
}
}
pIsolate->ThrowException(hError);
}
示例6: EqualNoCase
bool CFX_ByteString::EqualNoCase(const CFX_ByteStringC& str) const {
if (!m_pData)
return str.IsEmpty();
FX_STRSIZE len = str.GetLength();
if (m_pData->m_nDataLength != len)
return false;
const uint8_t* pThis = (const uint8_t*)m_pData->m_String;
const uint8_t* pThat = str.raw_str();
for (FX_STRSIZE i = 0; i < len; i++) {
if ((*pThis) != (*pThat)) {
uint8_t bThis = *pThis;
if (bThis >= 'A' && bThis <= 'Z')
bThis += 'a' - 'A';
uint8_t bThat = *pThat;
if (bThat >= 'A' && bThat <= 'Z')
bThat += 'a' - 'A';
if (bThis != bThat)
return false;
}
pThis++;
pThat++;
}
return true;
}
示例7: SetTag
void CXML_Element::SetTag(const CFX_ByteStringC& qTagName) {
ASSERT(!qTagName.IsEmpty());
CFX_ByteStringC bsSpace, bsName;
FX_XML_SplitQualifiedName(qTagName, bsSpace, bsName);
m_QSpaceName = bsSpace;
m_TagName = bsName;
}
示例8: PDF_ReplaceAbbr
void PDF_ReplaceAbbr(CPDF_Object* pObj) {
switch (pObj->GetType()) {
case PDFOBJ_DICTIONARY: {
CPDF_Dictionary* pDict = pObj->AsDictionary();
for (const auto& it : *pDict) {
CFX_ByteString key = it.first;
CPDF_Object* value = it.second;
CFX_ByteStringC fullname = PDF_FindFullName(
PDF_InlineKeyAbbr, FX_ArraySize(PDF_InlineKeyAbbr), key);
if (!fullname.IsEmpty()) {
pDict->ReplaceKey(key, fullname);
key = fullname;
}
if (value->IsName()) {
CFX_ByteString name = value->GetString();
fullname = PDF_FindFullName(PDF_InlineValueAbbr,
FX_ArraySize(PDF_InlineValueAbbr), name);
if (!fullname.IsEmpty()) {
pDict->SetAtName(key, fullname);
}
} else {
PDF_ReplaceAbbr(value);
}
}
break;
}
case PDFOBJ_ARRAY: {
CPDF_Array* pArray = pObj->AsArray();
for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
CPDF_Object* pElement = pArray->GetElement(i);
if (pElement->IsName()) {
CFX_ByteString name = pElement->GetString();
CFX_ByteStringC fullname = PDF_FindFullName(
PDF_InlineValueAbbr, FX_ArraySize(PDF_InlineValueAbbr), name);
if (!fullname.IsEmpty()) {
pArray->SetAt(i, new CPDF_Name(fullname));
}
} else {
PDF_ReplaceAbbr(pElement);
}
}
break;
}
}
}
示例9: SkipWord
FX_BOOL CPDF_SimpleParser::SkipWord(const CFX_ByteStringC& token) {
while (1) {
CFX_ByteStringC word = GetWord();
if (word.IsEmpty()) {
return FALSE;
}
if (word == token) {
return TRUE;
}
}
return FALSE;
}
示例10: RemoveAt
void CXML_AttrMap::RemoveAt(const CFX_ByteStringC& space, const CFX_ByteStringC& 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;
}
}
}
示例11: FindTagPair
FX_BOOL CPDF_SimpleParser::FindTagPair(const CFX_ByteStringC& start_token,
const CFX_ByteStringC& end_token,
FX_DWORD& start_pos,
FX_DWORD& end_pos) {
if (!start_token.IsEmpty()) {
if (!SkipWord(start_token)) {
return FALSE;
}
start_pos = m_dwCurPos;
}
while (1) {
end_pos = m_dwCurPos;
CFX_ByteStringC word = GetWord();
if (word.IsEmpty()) {
return FALSE;
}
if (word == end_token) {
return TRUE;
}
}
return FALSE;
}
示例12: CountElements
uint32_t CXML_Element::CountElements(const CFX_ByteStringC& space,
const CFX_ByteStringC& tag) const {
int count = 0;
for (const ChildRecord& record : m_Children) {
if (record.type != Element)
continue;
CXML_Element* pKid = static_cast<CXML_Element*>(record.child);
if ((space.IsEmpty() || pKid->m_QSpaceName == space) &&
pKid->m_TagName == tag) {
count++;
}
}
return count;
}
示例13: CountElements
FX_DWORD CXML_Element::CountElements(const CFX_ByteStringC& space, const CFX_ByteStringC& tag) const
{
int count = 0;
for (int i = 0; i < m_Children.GetSize(); i += 2) {
ChildType type = (ChildType)(uintptr_t)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;
}
示例14: GetNamespaceURI
CFX_ByteString CXML_Element::GetNamespaceURI(const CFX_ByteStringC& 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();
}
示例15: GetFontFace
FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const CFX_ByteStringC& bsFile,
int32_t iFaceIndex) {
if (bsFile.IsEmpty()) {
return nullptr;
}
if (iFaceIndex < 0) {
return nullptr;
}
FXFT_Open_Args args;
args.flags = FT_OPEN_PATHNAME;
args.pathname = const_cast<FT_String*>(bsFile.c_str());
FXFT_Face face;
if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face)) {
return FALSE;
}
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
}