当前位置: 首页>>代码示例>>C++>>正文


C++ CFX_ByteStringC::IsEmpty方法代码示例

本文整理汇总了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;
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:7,代码来源:fx_basic_bstring.cpp

示例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;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:31,代码来源:fpdf_parser_utility.cpp

示例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);
            }
        }
    }
}
开发者ID:witwall,项目名称:pdfium,代码行数:35,代码来源:fpdf_page_func.cpp

示例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));
      }
    }
  }
}
开发者ID:gradescope,项目名称:pdfium,代码行数:33,代码来源:fpdf_page_func.cpp

示例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);
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:29,代码来源:value.cpp

示例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;
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:28,代码来源:fx_basic_bstring.cpp

示例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;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:7,代码来源:fx_xml_composer.cpp

示例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;
    }
  }
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:46,代码来源:fpdf_page_parser.cpp

示例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;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:12,代码来源:fpdf_parser_utility.cpp

示例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;
        }
    }
}
开发者ID:abbro-ca,项目名称:pdfium,代码行数:13,代码来源:fx_xml_parser.cpp

示例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;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:22,代码来源:fpdf_parser_utility.cpp

示例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;
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:15,代码来源:fx_xml_parser.cpp

示例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;
}
开发者ID:abbro-ca,项目名称:pdfium,代码行数:15,代码来源:fx_xml_parser.cpp

示例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();
}
开发者ID:abbro-ca,项目名称:pdfium,代码行数:17,代码来源:fx_xml_parser.cpp

示例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;
}
开发者ID:gradescope,项目名称:pdfium,代码行数:18,代码来源:fpf_skiafontmgr.cpp


注:本文中的CFX_ByteStringC::IsEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。