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


C++ SWModule::Name方法代码示例

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


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

示例1: getModules

std::string SwordPluginAPI::getModules() {
    /*Get all installed modules or all modules of a specific type. Set modType to e.g. "Biblical Texts"
    getModules() returns a JSON string */
    refreshManagers();
    std::stringstream modules;
    ModMap::iterator it;

    modules << "[";

    for (it = displayLibrary->Modules.begin(); it != displayLibrary->Modules.end(); it++) {
        SWModule *module = (*it).second;
        if (it != displayLibrary->Modules.begin()) {
            modules << ", ";
        }
        modules << "{\"name\": \"" << module->Name() << "\", ";
        modules << "\"modType\":\"" << module->Type() << "\", ";
        if (module->getConfigEntry("Lang")) {
            modules << "\"lang\": \"" << module->getConfigEntry("Lang") << "\", ";
        }
        modules << "\"dataPath\":\"" << module->getConfigEntry("DataPath") << "\", ";
        modules << "\"descr\": \"" << convertString(module->Description()) << "\"}";
    }
    modules << "]";
    return modules.str();
}
开发者ID:zefanja,项目名称:biblez-plugin,代码行数:25,代码来源:SwordPluginAPI.cpp

示例2: RefreshBookList

void BookTreeCtrl::RefreshBookList(bool ShowLanguages)
{
  using namespace sword;

  ModMap::iterator it;
  SWModule *curMod = 0;
  ModMap *Modules;

  Modules = m_SwordTools->GetModuleMap();
  wxTreeItemId rootnode,
  childnode,
  langnode,
  curNode;

  std::map < string, wxTreeItemId > treenodes;
  std::map < string, wxTreeItemId > treelangnodes;

  string group,
  grouplang;

  wxString configEntry;

  rootnode = AddRoot(wxT("books"));
  for (it = Modules->begin(); it != Modules->end(); it++)
  {
    curMod = (*it).second;

    if (curMod == 0) {
      continue;
    }

    wxLogDebug(wxT("type %s"),
               (const wxChar *) wxString(curMod->Type(), wxConvUTF8));

    configEntry = wxT("");
    configEntry = wxString(curMod->getConfigEntry("Category"), wxConvUTF8);
    if (!configEntry.CompareTo(wxT("")))
    {
      childnode = treenodes[curMod->Type()];
      if (!childnode.IsOk())
      {
        wxLogDebug(wxT("appending type"));
        childnode =
          AppendItem(rootnode, wxString(curMod->Type(), wxConvUTF8),
                     ID_CLOSEDFOLDER_ICON, ID_CLOSEDFOLDER_ICON);
        treenodes[curMod->Type()] = childnode;
      }

      group = curMod->Type();
    }
    else
    {
      childnode = treenodes[(const char *) configEntry.mb_str()];
      if (!childnode.IsOk())
      {
        childnode =
          AppendItem(rootnode, configEntry, ID_CLOSEDFOLDER_ICON,
                     ID_CLOSEDFOLDER_ICON);
        treenodes[(const char *) configEntry.mb_str()] = childnode;
      }

      curMod->Type((const char *) configEntry.mb_str());
      group = (const char *) configEntry.mb_str();
    }

    grouplang = group;
    wxLogDebug(wxT("language %s"),
               (const wxChar *) wxString(curMod->Lang(), wxConvUTF8));
    grouplang.append(curMod->Lang());

    if (ShowLanguages)
    {
      langnode = treelangnodes[grouplang];
      if (!langnode.IsOk())
      {
        wxString language;

        wxLogDebug(wxT("appending language"));

        language =
          m_Languages.GetLanguage(wxString(curMod->Lang(), wxConvUTF8));

        langnode =
          AppendItem(childnode, language, ID_CLOSEDFOLDER_ICON,
                     ID_CLOSEDFOLDER_ICON);

        treelangnodes[grouplang] = langnode;
      }
    }
    else
    {
      langnode = childnode;
    }

    wxString modname = wxString(curMod->Name(), wxConvUTF8);

    modname += wxT(" - ");
    modname += wxString(curMod->Description(), wxConvUTF8);
    wxLogDebug(wxT("appending module %s"), (const wxChar *) modname);

//.........这里部分代码省略.........
开发者ID:lefticus,项目名称:BibleStudy,代码行数:101,代码来源:BookTreeCtrl.cpp


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