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


C++ WideString::empty方法代码示例

本文整理汇总了C++中WideString::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ WideString::empty方法的具体用法?C++ WideString::empty怎么用?C++ WideString::empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WideString的用法示例。


在下文中一共展示了WideString::empty方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: append_candidate

bool
SKKCandList::append_candidate (const WideString &cand,
                               const WideString &annot,
                               const WideString &cand_orig,
                               const AttributeList &attrs)
{
    if (cand.length() == 0)
        return false;

    if (m_candvec.size() < candvec_size) {
        m_candvec.push_back(CandEnt(cand, annot, cand_orig));
        return true;
    } else {
        m_annot_buf->m_index.push_back(m_annot_buf->m_buffer.size());
        if (!annot.empty())
            m_annot_buf->m_buffer.insert(m_annot_buf->m_buffer.end(),
                                      annot.begin(), annot.end());
        m_cand_orig_buf->m_index.push_back(m_cand_orig_buf->m_buffer.size());
        if (!cand_orig.empty())
            m_cand_orig_buf->m_buffer.insert(m_cand_orig_buf->m_buffer.end(),
                                             cand_orig.begin(),
                                             cand_orig.end());
        return CommonLookupTable::append_candidate(cand, attrs);
    }
}
开发者ID:tzhuan,项目名称:scim-skk,代码行数:25,代码来源:scim_skk_lookup_table.cpp

示例2: ASSERT

 /**
  * Constructs a secure random number generator (RNG) implementing the named
  * random number algorithm if specified
  */
 SecureRandom::SecureRandom(const WideString& algorithm)   
     : m_lock(new Mutex),
       m_impl(SecureRandomBase::createInstance(TextConvert::WideToNarrow(AlgorithmName::normalizeAlgorithm(algorithm)), nullptr, 0))
 {
     ASSERT( !algorithm.empty() );
     ASSERT(m_lock.get() != nullptr);
     ASSERT(m_impl.get() != nullptr);
 }
开发者ID:dreadlock,项目名称:owasp-esapi-cplusplus,代码行数:12,代码来源:SecureRandom.cpp

示例3:

void
SKKInstance::update_candidates (void)
{
    if (m_skkcore.has_commit_string()) {
        commit_string(m_skkcore.get_commit_string());
        m_skkcore.clear_commit();
    }

    WideString preedit;
    AttributeList alist;
    m_skkcore.get_preedit_string(preedit);
    m_skkcore.get_preedit_attributes(alist);
    update_preedit_string(preedit, alist);
    if (!preedit.empty()) {
        update_preedit_caret(m_skkcore.caret_pos());
        show_preedit_string();
    } else {
        hide_preedit_string();
    }

    if (annot_view && !annot_pos &&
            m_skkcore.get_input_mode() == INPUT_MODE_CONVERTING) {
        WideString auxstr;
        m_skkcore.get_lookup_table().get_annot_string(auxstr);
        update_aux_string(auxstr);
        if (!auxstr.empty())
            show_aux_string();
        else
            hide_aux_string();
    } else {
        update_aux_string(WideString());
        hide_aux_string();
    }

    if (m_skkcore.get_input_mode() == INPUT_MODE_CONVERTING &&
            m_skkcore.lookup_table_visible()) {
        update_lookup_table(m_skkcore.get_lookup_table());
        show_lookup_table();
    } else {
        hide_lookup_table();
    }
}
开发者ID:tzhuan,项目名称:scim-skk,代码行数:42,代码来源:scim_skk_imengine.cpp

示例4: NoSuchAlgorithmException

  AlgorithmName::AlgorithmName(const WideString& algorithm, bool cipherOnly)
    : m_normal(TextConvert::WideToNarrow(normalizeAlgorithm(algorithm)))
  {
    ASSERT( !algorithm.empty() );

    // We'd prefer to throw in the ctor, but its a limitation, not a feature!
    // Actually, we need to narmalize first (in case of throw), so maybe it is a feature.
    NarrowString cipher;
    getCipher(cipher);

    if(cipherOnly && m_normal != cipher)
      throw NoSuchAlgorithmException(m_normal + " not available");
  }
开发者ID:dreadlock,项目名称:owasp-esapi-cplusplus,代码行数:13,代码来源:AlgorithmName.cpp

示例5:

WideString
SKKCandList::get_candidate (int index) const
{
    WideString cand = CommonLookupTable::get_candidate(index);
    if (annot_view && annot_pos &&
        (annot_target || get_cursor_pos() == index)) {
        WideString annot = get_annot(index);
        if (!annot.empty()) {
            if (!annot_highlight)
                cand += utf8_mbstowcs(";");
            cand += get_annot(index);
        }
    }
    return cand;
}
开发者ID:tzhuan,项目名称:scim-skk,代码行数:15,代码来源:scim_skk_lookup_table.cpp

示例6: SendEmail

bool MailSender::SendEmail(const WideString& email, const WideString& subject, const WideString& messageText)
{
	// Don't try to send email if recipient is not set
	if (email.empty() || email == L"")
		return false;
	WideString mailtoText = L"";
	
	// Create mailto text
	mailtoText = Format(L"mailto:?to=%s&subject=%s&body=%s", email.c_str(), subject.c_str(), messageText.c_str());
	// Call default mail client
	int result = (int)ShellExecute(NULL, L"open", mailtoText.c_str(), NULL, NULL, SW_SHOWNORMAL);
	
	// If the function succeeds, it returns a value greater than 32.
	// If the function fails, it returns an error value that indicates the cause of the failure. 
	return (result > 32);
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:16,代码来源:MailSender.cpp

示例7: table

D2Data::D2Data()
  : itemTypes(DictionaryMap::alNum)
  , baseItems(DictionaryMap::alNum)
  , images(DictionaryMap::pathName)
  , fonts(DictionaryMap::pathName)
{
  WideString path = cfg.getwstr("d2path");
  if (path.empty()) path = getAppPath();
  int loaded = !!loader.loadArchive(WideString::buildFullName(path, L"resources.mpq"));
  loaded += !!loader.loadArchive(WideString::buildFullName(path, L"d2data.mpq"));
  loaded += !!loader.loadArchive(WideString::buildFullName(path, L"d2exp.mpq"));
  loaded += !!loader.loadArchive(WideString::buildFullName(path, L"patch_d2.mpq"));
  if (!loaded)
  {
    path = getAppPath();
    loaded = !!loader.loadArchive(WideString::buildFullName(path, L"resources.mpq"));
  }
  if (!loaded) return;
  cfg.setwstr("d2path", path);

  for (int f = 0; f < 10; f++)
    for (int t = 0; t < 21; t++)
      for (int i = 0; i < 256; i++)
        tints[f][t][i] = i;
  TempFile(loader.load("data\\global\\items\\Palette\\grey.dat"))->read(tints[1], 256 * 21);
  TempFile(loader.load("data\\global\\items\\Palette\\grey2.dat"))->read(tints[2], 256 * 21);
  TempFile(loader.load("data\\global\\items\\Palette\\gold.dat"))->read(tints[3], 256 * 21);
  TempFile(loader.load("data\\global\\items\\Palette\\brown.dat"))->read(tints[4], 256 * 21);
  TempFile(loader.load("data\\global\\items\\Palette\\greybrown.dat"))->read(tints[5], 256 * 21);
  TempFile(loader.load("data\\global\\items\\Palette\\invgrey.dat"))->read(tints[6], 256 * 21);
  TempFile(loader.load("data\\global\\items\\Palette\\invgrey2.dat"))->read(tints[7], 256 * 21);
  TempFile(loader.load("data\\global\\items\\Palette\\invgreybrown.dat"))->read(tints[8], 256 * 21);
  LocalPtr<File> pal = loader.load("data\\global\\palette\\ACT1\\pal.dat");
  for (int i = 0; i < 256; i++)
  {
    int b = pal->getc(), g = pal->getc(), r = pal->getc();//, a = pal->getc();
    palette[i] = Image::clr(r, g, b);
  }

  memset(textColor, 0xFF, sizeof textColor);
  {
    LocalPtr<File> pl2 = loader.load("data\\global\\palette\\ACT1\\Pal.PL2");
    pl2->seek(1024 + 49 * 256, SEEK_SET);
    pl2->read(blendTable, sizeof blendTable);
    pl2->seek(1024 + 1714 * 256, SEEK_SET);
    for (int i = 0; i < 13; i++)
    {
      int r = pl2->getc(), g = pl2->getc(), b = pl2->getc();
      textColor[i] = Image::clr(r, g, b);
    }
    pl2->seek(256, SEEK_CUR);
    for (int i = 1; i < 13; i++)
      pl2->read(tints[9][i], 256);
  }

  strings.load(TempFile(loader.load("data\\local\\lng\\eng\\string.tbl")), 0);
  strings.load(TempFile(loader.load("data\\local\\lng\\eng\\expansionstring.tbl")), 20000);
  strings.load(TempFile(loader.load("data\\local\\lng\\eng\\patchstring.tbl")), 10000);

  rootType.name = "All Items";
  loadTypes(TempFile(loader.load("data\\global\\excel\\ItemTypes.txt")));
  loadBase(TempFile(loader.load("data\\global\\excel\\weapons.txt")));
  loadBase(TempFile(loader.load("data\\global\\excel\\armor.txt")));
  loadBase(TempFile(loader.load("data\\global\\excel\\misc.txt")));
  baseMatch.build();

  itemTypes.get("h2h2").bases = 0;
  itemTypes.get("mcha").name = strings.byIndex(20436);
  itemTypes.get("lcha").name = strings.byIndex(20437);
  itemTypes.get("ques").setType(D2Item::tMisc, 0, 0);
  itemTypes.get("key").setType(D2Item::tMisc, 0, 0);
  itemTypes.get("weap").setType(D2Item::tAuto, 0);
  itemTypes.get("armo").setType(D2Item::tAuto, 1);
  itemTypes.get("ring").setType(D2Item::tAuto, 2);
  itemTypes.get("amul").setType(D2Item::tAuto, 2);
  itemTypes.get("char").setType(D2Item::tCharm, 0);
  itemTypes.get("gem").setType(D2Item::tSocket, 0, 0);
  itemTypes.get("rune").setType(D2Item::tSocket, 1, 0);
  itemTypes.get("jewl").setType(D2Item::tSocket, 2);
  for (uint32 cur = baseItems.enumStart(); cur; cur = baseItems.enumNext(cur))
  {
    D2BaseItem* base = &baseItems.enumGetValue(cur);
    while (base->type && base->type->bases == 0)
      base->type = base->type->parent;
  }
  mergeType(&rootType);

  {
    D2Excel table(TempFile(loader.load("data\\global\\excel\\PlayerClass.txt")));
    int id = 0;
    for (int i = 0; i < table.rows(); i++)
    {
      if (!*table.value(i, 1))
        continue;
      charClass.set(table.value(i, 1), id);
      classNames[id] = strings.byName(table.value(i, 0));
      id++;
    }
  }
  statData = new D2StatData(this);
//.........这里部分代码省略.........
开发者ID:NateChambers,项目名称:mule-view,代码行数:101,代码来源:d2data.cpp

示例8: getInstance

 /**
 * Returns a KeyGenerator object that generates secret keys for the specified algorithm.
 */
 KeyGenerator KeyGenerator::getInstance(const WideString& algorithm)
 {
   ASSERT( !algorithm.empty() );
   return KeyGenerator::getInstance(TextConvert::WideToNarrow(algorithm));
 }
开发者ID:dreadlock,项目名称:owasp-esapi-cplusplus,代码行数:8,代码来源:KeyGenerator.cpp

示例9: getInstance

 /**
  * Returns a SecureRandom object that implements the specified Random Number Generator (RNG) algorithm.
  */
 SecureRandom SecureRandom::getInstance(const WideString& algorithm)   
 {
     ASSERT( !algorithm.empty() );
     return getInstance(TextConvert::WideToNarrow(algorithm));
 }
开发者ID:dreadlock,项目名称:owasp-esapi-cplusplus,代码行数:8,代码来源:SecureRandom.cpp


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