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


C++ Station::fileName方法代码示例

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


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

示例1: if

void
Config::LoadConfig(){
    std::cerr<<"LoadConfig"<<std::endl;
#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
    try{
#endif //LIBXMLCPP_EXCEPTIONS_ENABLED
    #ifdef LIBXML
        if(parser){
            //Walk the tree:
            const xmlpp::Node* pNode = parser->get_document()->get_root_node(); //deleted by DomParser.
            processNode(pNode);
        }
    #else //LIBXML
        QDomElement root = _doc.documentElement();

        QDomNodeList nodelist;
        QDomElement el = root.firstChildElement("base");
       // if (!el.isNull())
       //     _pathPrefix->assign(el.text().toStdString());
        el = root.firstChildElement("iconset");
        if (!el.isNull())
            _iconset->assign(el.text().toStdString());
        el = root.firstChildElement("current_station_id");
        if (!el.isNull()){
            _current_station_id = el.text().toInt();
            std::cerr<<"_CURRENT_STATION_ID "<<_current_station_id<<std::endl;
        }
        el = root.firstChildElement("temperature_unit");
        if (!el.isNull())
            this->TemperatureUnit(el.text().toStdString());
        el = root.firstChildElement("wind_speed_unit");
        if (!el.isNull())
            _wind_speed_unit->assign(el.text().toStdString());
        el = root.firstChildElement("pressure_unit");
        if (!el.isNull())
            _pressure_unit->assign(el.text().toStdString());
        el = root.firstChildElement("visible_unit");
        if (!el.isNull())
            _visible_unit->assign(el.text().toStdString());
        el = root.firstChildElement("language");
        if (!el.isNull())
            _language->assign(el.text().toStdString());
        el = root.firstChildElement("update_connect");
        if (!el.isNull())
            _update_connect = (el.text() == "true") ? true : false;
        el = root.firstChildElement("fullscreen");
        if (!el.isNull())
            _fullscreen = (el.text() == "true") ? true : false;
        el = root.firstChildElement("lockscreen");
        if (!el.isNull())
            _lockscreen = (el.text() == "true") ? true : false;
        el = root.firstChildElement("standbyscreen");
        if (!el.isNull())
            _standbyscreen = (el.text() == "true") ? true : false;
        el = root.firstChildElement("gps");
        if (!el.isNull())
            _gps = (el.text() == "true") ? true : false;
        el = root.firstChildElement("splash");
        if (!el.isNull())
            _splash = (el.text() == "true") ? true : false;
        el = root.firstChildElement("update_period");
        if (!el.isNull())
            _update_period = el.text().toInt();

        nodelist = root.elementsByTagName("station");
        for (int i=0; i<nodelist.count(); i++){
            QString source_name, station_name, station_id, country, region, forecastURL, fileName, converter, viewURL, detailURL, hoursURL, basemapURL,  mapURL, cookie, latitude, longitude;
            bool gps = false;
            bool splash = true;
            QDomElement e = nodelist.at(i).toElement();
            QDomNode n = e.firstChild();
            while (!n.isNull()){
                el = n.toElement();
                QString tag = el.tagName();

                if (tag == "source_name")
                    source_name = el.text();
                else if (tag == "station_name")
                    station_name = el.text();
                else if (tag == "station_id")
                    station_id = el.text();
                else if (tag == "country")
                    country = el.text();
                else if (tag == "region")
                    region = el.text();
                else if (tag == "file_name")
                    fileName = el.text();
                else if (tag == "forecast_url")
                    forecastURL = el.text();
                else if (tag == "cookie")
                    cookie = el.text();
                else if (tag == "detail_url")
                    detailURL = el.text();
                else if (tag == "hours_url")
                    hoursURL = el.text();
                else if (tag == "view_url")
                    viewURL = el.text();
                else if (tag == "map_url")
                    mapURL = el.text();
                else if (tag == "basemap_url")
//.........这里部分代码省略.........
开发者ID:Meecast,项目名称:meecast,代码行数:101,代码来源:config.cpp


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