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


C++ cbC2U函数代码示例

本文整理汇总了C++中cbC2U函数的典型用法代码示例。如果您正苦于以下问题:C++ cbC2U函数的具体用法?C++ cbC2U怎么用?C++ cbC2U使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: cbC2U

void MSVC10Loader::HandleFilesAndExcludes(const TiXmlElement* e, ProjectFile* pf)
{
    if (!e || !pf)
        return;

    // add it to all configurations, not just the first
    for (HashProjectsConfs::iterator it=m_pc.begin(); it!=m_pc.end(); ++it)
        pf->AddBuildTarget(it->second.sName);

    // handle explicit exclusions like:
    // <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    // <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
    const TiXmlElement* excl = e->FirstChildElement("ExcludedFromBuild");
    for (; excl; excl=excl->NextSiblingElement("ExcludedFromBuild"))
    {
        const TiXmlText* do_excl = excl->ToText();
        if (do_excl)
        {
            const char* value = do_excl->Value();
            wxString  s_value = cbC2U(value);
            if (s_value.IsSameAs(_T("true"), false))
            {
                const char* cond = excl->Attribute("Condition");
                if (cond)
                {
                    wxString sName = cbC2U(cond); sName = SubstituteConfigMacros(sName);
                    pf->RemoveBuildTarget(sName);
                }
            }
        }
    }
}
开发者ID:stahta01,项目名称:codeblocks_sf,代码行数:32,代码来源:msvc10loader.cpp

示例2: while

void MSVC10Loader::HandleFilesAndExcludes(const TiXmlElement* e, ProjectFile* pf)
{
    if (!e || !pf)
        return;

    // add it to all configurations, not just the first
    for (size_t i=0; i<m_pcNames.Count(); ++i)
        pf->AddBuildTarget(m_pcNames.Item(i));

    // handle explicit exclusions like:
    // <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    // <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
    const TiXmlElement* excl = e->FirstChildElement("ExcludedFromBuild");
    // Operate existing excludes
    while (excl)
    {
        const TiXmlText* do_excl = excl->ToText();
        if (do_excl)
        {
            const char* value = do_excl->Value();
            wxString  s_value = cbC2U(value);
            if (s_value.MakeUpper().IsSameAs(_T("TRUE")))
            {
                const char* cond = excl->Attribute("Condition");
                if (cond)
                {
                    wxString sName = cbC2U(cond); sName = SubstituteConfigMacros(sName);
                    pf->RemoveBuildTarget(sName);
                }
            }
        }

        excl = excl->NextSiblingElement();
    }
}
开发者ID:Three-DS,项目名称:codeblocks-13.12,代码行数:35,代码来源:msvc10loader.cpp

示例3: SetUserClass

bool wxsCustomWidget::OnXmlRead(TiXmlElement* Element,bool IsXRC,bool IsExtra)
{
    bool Ret = wxsItem::OnXmlRead(Element,IsXRC,IsExtra);

    if ( IsXRC )
    {
        if ( !(GetPropertiesFlags() & flSource) )
        {
            SetUserClass(cbC2U(Element->Attribute("class")));
            m_XmlDataDoc.Clear();
            for ( TiXmlElement* Child = Element->FirstChildElement(); Child; Child = Child->NextSiblingElement() )
            {
                // Skipping all standard elements
                wxString Name = cbC2U(Child->Value());
                if ( Name != _T("pos") &&
                     Name != _T("size") &&
                     Name != _T("style") &&
                     Name != _T("enabled") &&
                     Name != _T("focused") &&
                     Name != _T("hidden") &&
                     Name != _T("fg") &&
                     Name != _T("bg") &&
                     Name != _T("font") &&
                     Name != _T("handler") )
                {
                    m_XmlDataDoc.InsertEndChild(*Child);
                }
            }
            RebuildXmlData();
        }
    }

    return Ret;
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:34,代码来源:wxscustomwidget.cpp

示例4: cbC2U

bool wxsToolBarItem::OnXmlRead(TiXmlElement* Element,bool IsXRC,bool IsExtra)
{
    bool Ret = wxsParent::OnXmlRead(Element,IsXRC,IsExtra);

    if ( IsXRC )
    {
        wxString Class = cbC2U(Element->Attribute("class"));
        if ( Class == _T("separator") )
        {
            m_Type = Separator;
        }
        else
        {
            // This will handle both wxMenu and wxToolBarItem
            TiXmlElement* Node = Element->FirstChildElement("radio");
            if ( Node && (cbC2U(Node->GetText())==_T("1")) )
            {
                m_Type = Radio;
            }
            else if ( (Node = Element->FirstChildElement("check")) &&
                      (cbC2U(Node->GetText())==_T("1")) )
            {
                m_Type = Check;
            }
            else
            {
                m_Type = Normal;
            }
        }
    }

    return Ret;
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:33,代码来源:wxstoolbaritem.cpp

示例5: cbC2U

bool wxsResource::ReadConfig(const TiXmlElement* Node)
{
    m_ResourceName = cbC2U(Node->Attribute("name"));
    m_Language = wxsCodeMarks::Id(cbC2U(Node->Attribute("language")));
    if ( GetResourceName().empty() ) return false;
    return OnReadConfig(Node);
}
开发者ID:Three-DS,项目名称:codeblocks-13.12,代码行数:7,代码来源:wxsresource.cpp

示例6: while

int xmlFile::GetChildList(wxArrayString& arrStr)
{
    arrStr.Clear();

    if(!m_pWorkingElement)
        return -1;

    TiXmlElement* elem = (TiXmlElement*)m_pWorkingElement->FirstChild();
    while(elem)
    {
        wxString name = cbC2U(elem->Value());
        if(!name.IsEmpty())  //Root??
        {
            if(elem->Attribute("alt_title"))
            {
                name = cbC2U(elem->Attribute("alt_title"));
                name.Replace(_T("\""), _T(""));
            }

            if(!name.IsEmpty())
                arrStr.Add(name);
        }
        elem = (TiXmlElement*)elem->NextSibling();
    }

    return arrStr.GetCount();
}
开发者ID:stahta01,项目名称:EmBlocks,代码行数:27,代码来源:sc_xml_handling.cpp

示例7: while

void ProjectTemplateLoader::DoOption(TiXmlElement* parentNode)
{
    TiXmlElement* node = parentNode->FirstChildElement("Option");
    while (node)
    {
        TemplateOption to;
        to.useDefaultCompiler = true;

        if (node->Attribute("name"))
            to.name = cbC2U(node->Attribute("name"));

        if (!to.name.IsEmpty())
        {
            TiXmlElement* tmpnode = node->FirstChildElement("Notice");
            if (tmpnode)
            {
                to.notice << _T("\n") << cbC2U(tmpnode->Attribute("value"));
                while (to.notice.Replace(_T("  "), _T(" ")))
                    ;
                to.notice.Replace(_T("\t"), _T(""));
                to.noticeMsgType = strncmp(tmpnode->Attribute("value"), "0", 1) == 0 ? wxICON_INFORMATION : wxICON_WARNING;
            }

            DoOptionProject(node, to);
            DoOptionCompiler(node, to);
            DoOptionLinker(node, to);
            m_TemplateOptions.Add(to);
        }

        node = node->NextSiblingElement("Option");
    }
}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:32,代码来源:projecttemplateloader.cpp

示例8: cbC2U

wxsResource* wxWidgetsResFactory::OnBuildExternal(const wxString& FileName)
{
    TiXmlDocument Doc;
    if ( !TinyXML::LoadDocument(FileName,&Doc) ) return 0;

    wxArrayString ResourcesFound;
    wxArrayElement XmlElements;
    TiXmlElement* Res = Doc.FirstChildElement("resource");
    if ( !Res )
    {
        // TODO: Some message box about invalid XRC resource structure
        return 0;
    }

    for ( TiXmlElement* Object = Res->FirstChildElement("object"); Object; Object=Object->NextSiblingElement("object") )
    {
        wxString Class = cbC2U(Object->Attribute("class"));
        wxString Name = cbC2U(Object->Attribute("name"));
        if ( !Name.empty() && Names.Index(Class) != wxNOT_FOUND )
        {
            ResourcesFound.Add(Name + _T(" (") + Class + _T(")"));
            XmlElements.Add(Object);
        }
    }

    if ( ResourcesFound.empty() )
    {
        // TODO: Message box that there are no resoures which could be edited here
        return 0;
    }

    int Choice = 0;
    if ( ResourcesFound.size() > 1 )
    {
        Choice = ::cbGetSingleChoiceIndex(
            _("There's more than one resource in this file.\n"
              "Please select which one should be edited."),
            _("Choose resource to edit"),
            ResourcesFound);
        if ( Choice<0 )
        {
            return 0;
        }
    }

    TiXmlElement* Object = XmlElements[Choice];
    if ( !Object ) return 0;

    wxString Class = cbC2U(Object->Attribute("class"));
    switch ( Names.Index(Class) )
    {
        case wxDialogId:          return new wxsDialogRes(FileName,Object);
        case wxScrollingDialogId: return new wxsScrollingDialogRes(FileName,Object);
        case wxFrameId:           return new wxsFrameRes(FileName,Object);
        case wxPanelId:           return new wxsPanelRes(FileName,Object);
        default:                  break;
    }
    return 0;
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:59,代码来源:wxwidgetsresfactory.cpp

示例9: cbC2U

void ProjectTemplateLoader::DoTemplateNotice(TiXmlElement* parentNode)
{
    TiXmlElement* node = parentNode->FirstChildElement("Notice");
    if (!node)
        return;
    m_Notice = cbC2U(node->Attribute("value"));
    while (m_Notice.Replace(_T("  "), _T(" ")))
        ;
    m_Notice.Replace(_T("\t"), _T(""));
    m_NoticeMsgType = cbC2U(node->Attribute("value")) == _T("0") ? wxICON_INFORMATION : wxICON_WARNING;
}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:11,代码来源:projecttemplateloader.cpp

示例10: naming

wxString ConfigManager::InvalidNameMessage(const wxString& what, const wxString& sub, TiXmlElement *localPath) const
{
    wxString s;
    s.Printf(_T("The %s %s (child of node \"%s\" in namespace \"%s\") does not meet the standard for path naming (must start with a letter)."),
    what.c_str(),
    sub.c_str(),
    cbC2U(localPath->Value()).c_str(),
    cbC2U(root->Value()).c_str());

    return s;
}
开发者ID:alpha0010,项目名称:codeblocks_sf,代码行数:11,代码来源:configmanager.cpp

示例11: wxFileName

bool MSVC7Loader::Open(const wxString& filename)
{
    LogManager* pMsg = Manager::Get()->GetLogManager();
    if (!pMsg)
        return false;

    /* NOTE (mandrav#1#): not necessary to ask for switches conversion... */
    m_ConvertSwitches = m_pProject->GetCompilerID().IsSameAs(_T("gcc"));
    m_ProjectName = wxFileName(filename).GetName();

    pMsg->DebugLog(F(_T("Importing MSVC 7.xx project: %s"), filename.wx_str()));

    TiXmlDocument doc(filename.mb_str());
    if (!doc.LoadFile())
        return false;

    pMsg->DebugLog(_T("Parsing project file..."));
    TiXmlElement* root;

    root = doc.FirstChildElement("VisualStudioProject");
    if (!root)
    {
        pMsg->DebugLog(_T("Not a valid MS Visual Studio project file..."));
        return false;
    }
    if (strcmp(root->Attribute("ProjectType"), "Visual C++") != 0)
    {
        pMsg->DebugLog(_T("Project is not Visual C++..."));
        return false;
    }

    wxString ver = cbC2U(root->Attribute("Version"));
    if (ver.IsSameAs(_T("7.0")) || ver.IsSameAs(_T("7.00"))) m_Version = 70;
    if (ver.IsSameAs(_T("7.1")) || ver.IsSameAs(_T("7.10"))) m_Version = 71;
    if (ver.IsSameAs(_T("8.0")) || ver.IsSameAs(_T("8.00"))) m_Version = 80;
    if ((m_Version!=70) && (m_Version!=71))
    {
        // seems to work with visual 8 too ;)
        pMsg->DebugLog(F(_T("Project version is '%s'. Although this loader was designed for version 7.xx, will try to import..."), ver.wx_str()));
    }

    m_pProject->ClearAllProperties();
    m_pProject->SetModified(true);
    m_pProject->SetTitle(cbC2U(root->Attribute("Name")));

    // delete all targets of the project (we 'll create new ones from the imported configurations)
    while (m_pProject->GetBuildTargetsCount())
        m_pProject->RemoveBuildTarget(0);

    return DoSelectConfiguration(root);
}
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:51,代码来源:msvc7loader.cpp

示例12: cbC2U

bool wxsMenuItem::OnXmlRead(TiXmlElement* Element,bool IsXRC,bool IsExtra)
{
    bool Ret = wxsParent::OnXmlRead(Element,IsXRC,IsExtra);

    if ( IsXRC )
    {
        wxString Class = cbC2U(Element->Attribute("class"));
        if ( Class == _T("separator") )
        {
            m_Type = Separator;
        }
        else if ( Class == _T("break") )
        {
            m_Type = Break;
        }
        else
        {
            // This will handle both wxMenu and wxMenuItem
            TiXmlElement* Node = Element->FirstChildElement("radio");
            if ( Node && (cbC2U(Node->GetText())==_T("1")) )
            {
                m_Type = Radio;
            }
            else
            {
                Node = Element->FirstChildElement("checkable");

                // Backward BUG-compatibility
                if ( !Node ) Node = Element->FirstChildElement("check");

                if ( Node && (cbC2U(Node->GetText())==_T("1")) )
                {
                    m_Type = Check;
                    // Now, we are going to check its state, either checked or not checked
                    TiXmlElement* checkedNode = Element->FirstChildElement("checked");
                    if (checkedNode && (cbC2U(checkedNode->GetText())==_T("1")))
                        m_Checked = true;
                    // otherwise, the m_Checked will default to false.
                }
                else
                {
                    m_Type = Normal;
                }
            }
        }
    }

    return Ret;
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:49,代码来源:wxsmenuitem.cpp

示例13: cbC2U

wxString ConfigManager::GetPath() const
{
    TiXmlElement *e = pathNode;
    wxString ret;
    ret.Alloc(64);

    ret = cbC2U(e->Value());
    while ((e = e->Parent()->ToElement()) && e != root)
    {
        ret.Prepend(_T('/'));
        ret.Prepend(cbC2U(e->Value()));
    }
    ret.Prepend(_T('/'));
    return ret;
}
开发者ID:alpha0010,项目名称:codeblocks_sf,代码行数:15,代码来源:configmanager.cpp

示例14: key

void ConfigManager::Read(const wxString& name, ConfigManagerContainer::StringToStringMap* map)
{
    wxString key(name);
    TiXmlElement* e = AssertPath(key);

    TiXmlHandle parentHandle(e);
    TiXmlNode *mNode = parentHandle.FirstChild(cbU2C(key)).FirstChild("ssmap").Node();

    TiXmlNode *curr = nullptr;
    if (mNode)
    {
        while ((curr = mNode->IterateChildren(curr)))
            (*map)[cbC2U(curr->Value())] = cbC2U(curr->FirstChild()->ToText()->Value());
    }
}
开发者ID:alpha0010,项目名称:codeblocks_sf,代码行数:15,代码来源:configmanager.cpp

示例15: cbC2U

void ProjectConfiguration::XmlLoad(TiXmlElement* Node,cbProject* Project)
{
    m_GlobalUsedLibs.Clear();
    m_TargetsUsedLibs.clear();
    m_DisableAuto = false;

    TiXmlElement* LibFinder = Node->FirstChildElement("lib_finder");
    if ( !LibFinder ) return;

    int noauto = 0;
    if ( (LibFinder->QueryIntAttribute("disable_auto",&noauto) == TIXML_SUCCESS) && noauto )
    {
        m_DisableAuto = true;
    }

    for ( TiXmlElement* Elem = LibFinder->FirstChildElement("lib");
          Elem;
          Elem = Elem->NextSiblingElement("lib") )
    {
        wxString LibName = cbC2U(Elem->Attribute("name"));
        if ( !LibName.IsEmpty() && m_GlobalUsedLibs.Index(LibName)==wxNOT_FOUND )
        {
            m_GlobalUsedLibs.Add(LibName);
        }
    }

    for ( TiXmlElement* Elem = LibFinder->FirstChildElement("target");
          Elem;
          Elem = Elem->NextSiblingElement("target") )
    {
        wxString TargetName = cbC2U(Elem->Attribute("name"));
        if ( !Project->GetBuildTarget(TargetName) ) continue;

        wxArrayString& Libs = m_TargetsUsedLibs[TargetName];
        for ( TiXmlElement* LibElem = Elem->FirstChildElement("lib");
              LibElem;
              LibElem = LibElem->NextSiblingElement("lib") )
        {
            wxString LibName = cbC2U(LibElem->Attribute("name"));
            if ( !LibName.IsEmpty() && Libs.Index(LibName)==wxNOT_FOUND )
            {
                Libs.Add(LibName);
            }
        }
    }

    // TODO: Invoke library settings check
}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:48,代码来源:projectconfiguration.cpp


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