本文整理汇总了C++中Weather::GetVals方法的典型用法代码示例。如果您正苦于以下问题:C++ Weather::GetVals方法的具体用法?C++ Weather::GetVals怎么用?C++ Weather::GetVals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weather
的用法示例。
在下文中一共展示了Weather::GetVals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JSONwCheck
static void JSONwCheck(const KVPairs & key_value_pairs, FILE * stream_file)
{
Weather w;
ServeHeader(stream_file, 200, "OK", false, "text/plain");
char key[17];
GetApiKey(key);
char pws[12] = {0};
GetPWS(pws);
const Weather::ReturnVals vals = w.GetVals(GetWUIP(), key, GetZip(), pws, GetUsePWS());
const int scale = w.GetScale(vals);
fprintf(stream_file, "{\n");
fprintf_P(stream_file, PSTR("\t\"valid\" : \"%s\",\n"), vals.valid ? "true" : "false");
fprintf_P(stream_file, PSTR("\t\"keynotfound\" : \"%s\",\n"), vals.keynotfound ? "true" : "false");
fprintf_P(stream_file, PSTR("\t\"minhumidity\" : \"%d\",\n"), vals.minhumidity);
fprintf_P(stream_file, PSTR("\t\"maxhumidity\" : \"%d\",\n"), vals.maxhumidity);
fprintf_P(stream_file, PSTR("\t\"meantempi\" : \"%d\",\n"), vals.meantempi);
fprintf_P(stream_file, PSTR("\t\"precip_today\" : \"%d\",\n"), vals.precip_today);
fprintf_P(stream_file, PSTR("\t\"precip\" : \"%d\",\n"), vals.precipi);
fprintf_P(stream_file, PSTR("\t\"wind_mph\" : \"%d\",\n"), vals.windmph);
fprintf_P(stream_file, PSTR("\t\"UV\" : \"%d\",\n"), vals.UV);
fprintf_P(stream_file, PSTR("\t\"scale\" : \"%d\"\n"), scale);
fprintf(stream_file, "}");
}