_utils_8h.html 12 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>hueplusplus: include/hueplusplus/Utils.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">hueplusplus
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e05b4b7707bd5f9fd045e8be02b17d0a.html">hueplusplus</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Utils.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;json/json.hpp&quot;</code><br />
</div><div class="textblock"><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Include dependency graph for Utils.h:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="_utils_8h__incl.png" border="0" usemap="#include_2hueplusplus_2_utils_8h" alt=""/></div>
<map name="include_2hueplusplus_2_utils_8h" id="include_2hueplusplus_2_utils_8h">
</map>
</div>
</div><div class="textblock"><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="closed.png" alt="+"/> This graph shows which files directly or indirectly include this file:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="_utils_8h__dep__incl.png" border="0" usemap="#include_2hueplusplus_2_utils_8hdep" alt=""/></div>
<map name="include_2hueplusplus_2_utils_8hdep" id="include_2hueplusplus_2_utils_8hdep">
<area shape="rect" id="node2" href="_resource_list_8h.html" title="include/hueplusplus\l/ResourceList.h" alt="" coords="699,95,850,136"/>
<area shape="rect" id="node3" href="_bridge_8h.html" title="include/hueplusplus\l/Bridge.h" alt="" coords="643,273,794,315"/>
<area shape="rect" id="node6" href="_bridge_8cpp.html" title="src/Bridge.cpp" alt="" coords="1080,370,1195,397"/>
<area shape="rect" id="node12" href="_base_device_8cpp.html" title="src/BaseDevice.cpp" alt="" coords="976,102,1125,129"/>
<area shape="rect" id="node13" href="_extended_color_temperature_strategy_8cpp.html" title="src/ExtendedColorTemperature\lStrategy.cpp" alt="" coords="1150,95,1373,136"/>
<area shape="rect" id="node14" href="_hue_device_types_8cpp.html" title="src/HueDeviceTypes.cpp" alt="" coords="1397,102,1577,129"/>
<area shape="rect" id="node15" href="_light_8cpp.html" title="src/Light.cpp" alt="" coords="1601,102,1705,129"/>
<area shape="rect" id="node16" href="_sensor_8cpp.html" title="src/Sensor.cpp" alt="" coords="1729,102,1844,129"/>
<area shape="rect" id="node17" href="_simple_brightness_strategy_8cpp.html" title="src/SimpleBrightnessStrategy.cpp" alt="" coords="1869,102,2107,129"/>
<area shape="rect" id="node18" href="_simple_color_hue_strategy_8cpp.html" title="src/SimpleColorHueStrategy.cpp" alt="" coords="2131,102,2362,129"/>
<area shape="rect" id="node19" href="_simple_color_temperature_strategy_8cpp.html" title="src/SimpleColorTemperature\lStrategy.cpp" alt="" coords="2386,95,2593,136"/>
<area shape="rect" id="node20" href="_state_transaction_8cpp.html" title="src/StateTransaction.cpp" alt="" coords="2617,102,2797,129"/>
<area shape="rect" id="node21" href="_utils_8cpp.html" title="src/Utils.cpp" alt="" coords="2821,102,2923,129"/>
<area shape="rect" id="node11" href="_sensor_list_8h.html" title="include/hueplusplus\l/SensorList.h" alt="" coords="699,184,850,225"/>
<area shape="rect" id="node4" href="_entertainment_mode_8h.html" title="include/hueplusplus\l/EntertainmentMode.h" alt="" coords="22,363,189,404"/>
<area shape="rect" id="node7" href="_bridge_setup_8cpp.html" title="examples/BridgeSetup.cpp" alt="" coords="213,370,409,397"/>
<area shape="rect" id="node8" href="_lights_off_8cpp.html" title="examples/LightsOff.cpp" alt="" coords="433,370,607,397"/>
<area shape="rect" id="node9" href="_snippets_8cpp.html" title="Contains code snippets used in the documentation, performs no useful functions. " alt="" coords="632,370,805,397"/>
<area shape="rect" id="node10" href="_username_config_8cpp.html" title="examples/UsernameConfig.cpp" alt="" coords="830,370,1055,397"/>
<area shape="rect" id="node5" href="_entertainment_mode_8cpp.html" title="src/EntertainmentMode.cpp" alt="" coords="5,452,205,479"/>
</map>
</div>
</div>
<p><a href="_utils_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacehueplusplus"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehueplusplus.html">hueplusplus</a></td></tr>
<tr class="memdesc:namespacehueplusplus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Namespace for the hueplusplus library. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacehueplusplus_1_1utils"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehueplusplus_1_1utils.html">hueplusplus::utils</a></td></tr>
<tr class="memdesc:namespacehueplusplus_1_1utils"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility functions used in multiple places. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:abc293509e3c09a90a1324e2f657dcce7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehueplusplus_1_1utils.html#abc293509e3c09a90a1324e2f657dcce7">hueplusplus::utils::validatePUTReply</a> (const std::string &amp;path, const nlohmann::json &amp;request, const nlohmann::json &amp;reply)</td></tr>
<tr class="memdesc:abc293509e3c09a90a1324e2f657dcce7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for validating that a request was executed correctly.  <a href="namespacehueplusplus_1_1utils.html#abc293509e3c09a90a1324e2f657dcce7">More...</a><br /></td></tr>
<tr class="separator:abc293509e3c09a90a1324e2f657dcce7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97489af5c31e43274bc4b502293cad33"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehueplusplus_1_1utils.html#a97489af5c31e43274bc4b502293cad33">hueplusplus::utils::validateReplyForLight</a> (const nlohmann::json &amp;request, const nlohmann::json &amp;reply, int lightId)</td></tr>
<tr class="separator:a97489af5c31e43274bc4b502293cad33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd53f5a43053f94209d8195fc4674665"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacehueplusplus_1_1utils.html#abd53f5a43053f94209d8195fc4674665">hueplusplus::utils::floatEquals</a> (float lhs, float rhs)</td></tr>
<tr class="memdesc:abd53f5a43053f94209d8195fc4674665"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks equality to 4 decimal places.  <a href="namespacehueplusplus_1_1utils.html#abd53f5a43053f94209d8195fc4674665">More...</a><br /></td></tr>
<tr class="separator:abd53f5a43053f94209d8195fc4674665"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6268e7923eee8d5300471820c3d8094"><td class="memTemplParams" colspan="2">template&lt;typename... Paths&gt; </td></tr>
<tr class="memitem:ae6268e7923eee8d5300471820c3d8094"><td class="memTemplItemLeft" align="right" valign="top">nlohmann::json&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacehueplusplus_1_1utils.html#ae6268e7923eee8d5300471820c3d8094">hueplusplus::utils::safeGetMember</a> (const nlohmann::json &amp;json, Paths &amp;&amp;... paths)</td></tr>
<tr class="memdesc:ae6268e7923eee8d5300471820c3d8094"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the object/array member or null if it does not exist.  <a href="namespacehueplusplus_1_1utils.html#ae6268e7923eee8d5300471820c3d8094">More...</a><br /></td></tr>
<tr class="separator:ae6268e7923eee8d5300471820c3d8094"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Copyright Notice<br />
Copyright (C) 2020 Jan Rogall - developer<br />
Copyright (C) 2020 Moritz Wirger - developer<br />
 This file is part of hueplusplus.</p>
<p>hueplusplus is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>hueplusplus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</p>
<p>You should have received a copy of the GNU Lesser General Public License along with hueplusplus. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>