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


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

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


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

示例1: Tstring

freettcn::CType::CValue::CValue(const std::shared_ptr<const TciType> &type,
                                const Tstring &encoding,
                                const Tstring &encodingVariant):
  _type(type)
{
  if(encoding.empty() || encoding == type->getTypeEncoding())
    _encoding.reset(new Tstring(encoding));
  if(encodingVariant.empty() || encodingVariant == type->getTypeEncodingVariant())
    _encoding.reset(new Tstring(encodingVariant));
}
开发者ID:mpusz,项目名称:FreeTTCN,代码行数:10,代码来源:tciType.cpp

示例2: PopulateList

void CAdvancedPage::PopulateList() {
  // Populate the controls in the dialogue box based on the relevent parameters
  for(int ii = 0; ii<sizeof(menutable)/sizeof(menuentry); ii++)
  {
    if(m_pAppSettings->GetBoolParameter(menutable[ii].paramNum)) {
      SendMessage(GetDlgItem(m_hwnd, menutable[ii].idcNum), BM_SETCHECK, BST_CHECKED, 0);
    }
    else  {
      SendMessage(GetDlgItem(m_hwnd, menutable[ii].idcNum), BM_SETCHECK, BST_UNCHECKED, 0);
    }
  }

  
  switch(m_pAppSettings->GetLongParameter(APP_LP_STYLE)) {
    case APP_STYLE_TRAD:
      SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_STANDALONE), BM_SETCHECK, BST_CHECKED, 0);
      break;
    case APP_STYLE_COMPOSE:
      SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_COMPOSITION), BM_SETCHECK, BST_CHECKED, 0);
      break;
    case APP_STYLE_DIRECT:
      SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_DIRECT), BM_SETCHECK, BST_CHECKED, 0);
      break;
    case APP_STYLE_FULLSCREEN:
      SendMessage(GetDlgItem(m_hwnd, IDC_STYLE_FULL), BM_SETCHECK, BST_CHECKED, 0);
      break;
  }

  HWND ListBox = GetDlgItem(m_hwnd, IDC_CONTROLBOXES);
  auto CurrentControlBox = m_pAppSettings->GetStringParameter(SP_CONTROL_BOX_ID);
  // Add each string to list box and index each one
  bool SelectionSet = false;
  for (auto i = 0; i < m_ControlBoxItems.size(); i++) {
    Tstring Item;
    WinUTF8::UTF8string_to_wstring(m_ControlBoxItems[i], Item);
    if (Item.empty())
      Item = L"<default>";
    LRESULT Index = SendMessage(ListBox, LB_ADDSTRING, 0, (LPARAM)Item.c_str());
    SendMessage(ListBox, LB_SETITEMDATA, Index, (LPARAM)i);
    if (m_ControlBoxItems[i] == CurrentControlBox) {
      SendMessage(ListBox, LB_SETCURSEL, Index, 0);
      SelectionSet = true;
    }
  }
  if (SelectionSet == false) {
    SendMessage(ListBox, LB_SETCURSEL, 0, 0);
    LRESULT CurrentIndex = SendMessage(ListBox, LB_GETITEMDATA, 0, 0);
  }

 CWindow fileEncodingCb = GetDlgItem(m_hwnd, IDC_FILE_ENCODING);
 fileEncodingCb.SendMessage(CB_ADDSTRING, 0, (LPARAM)L"Windows Locale Encoding");
 fileEncodingCb.SendMessage(CB_ADDSTRING, 0, (LPARAM)L"UTF-8");
 fileEncodingCb.SendMessage(CB_ADDSTRING, 0, (LPARAM)L"Unicode little endian / UTF-16 LE");
 fileEncodingCb.SendMessage(CB_ADDSTRING, 0, (LPARAM)L"Unicode big endian / UTF-16 BE");

  switch (m_pAppSettings->GetLongParameter(APP_LP_FILE_ENCODING)) {
  case Opts::UTF8: 
    fileEncodingCb.SendMessage(CB_SETCURSEL, 1, 0);
    break;
  case Opts::UTF16LE: 
    fileEncodingCb.SendMessage(CB_SETCURSEL, 2, 0);
    break;
  case Opts::UTF16BE: 
    fileEncodingCb.SendMessage(CB_SETCURSEL, 3, 0);
    break;
  default:
    fileEncodingCb.SendMessage(CB_SETCURSEL, 0, 0);
    break;
  }
}
开发者ID:Afelio,项目名称:dasher,代码行数:70,代码来源:AdvancedPage.cpp


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