本文整理汇总了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")
//.........这里部分代码省略.........