_hue_exception_8h_source.html
15.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!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/HueException.h Source File</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
 <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="headertitle">
<div class="title">HueException.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="_hue_exception_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#ifndef INCLUDE_HUEPLUSPLUS_HUE_EXCEPTION_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#define INCLUDE_HUEPLUSPLUS_HUE_EXCEPTION_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <exception></span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <string></span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "json/json.hpp"</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keyword">namespace </span><a class="code" href="namespacehueplusplus.html">hueplusplus</a></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> {</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="structhueplusplus_1_1_file_info.html"> 34</a></span> <span class="keyword">struct </span><a class="code" href="structhueplusplus_1_1_file_info.html">FileInfo</a></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> {</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="structhueplusplus_1_1_file_info.html#a0e70a519d2b615963abf5cb2ff4bca4f"> 37</a></span>  std::string <a class="code" href="structhueplusplus_1_1_file_info.html#a0e70a519d2b615963abf5cb2ff4bca4f">filename</a>;</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="structhueplusplus_1_1_file_info.html#a0f10116b94c4038f6f0bb8c693c9026e"> 39</a></span>  <span class="keywordtype">int</span> <a class="code" href="structhueplusplus_1_1_file_info.html#a0f10116b94c4038f6f0bb8c693c9026e">line</a> = -1;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="structhueplusplus_1_1_file_info.html#a1da7fcb189d66c18492c4678d452b0fd"> 41</a></span>  std::string <a class="code" href="structhueplusplus_1_1_file_info.html#a1da7fcb189d66c18492c4678d452b0fd">func</a>;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  std::string <a class="code" href="structhueplusplus_1_1_file_info.html#a5a3d1e5f060dd5df626003504813f116">ToString</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> };</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="classhueplusplus_1_1_hue_exception.html"> 49</a></span> <span class="keyword">class </span><a class="code" href="classhueplusplus_1_1_hue_exception.html">HueException</a> : <span class="keyword">public</span> std::exception</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="classhueplusplus_1_1_hue_exception.html">HueException</a>(<a class="code" href="structhueplusplus_1_1_file_info.html">FileInfo</a> fileInfo, <span class="keyword">const</span> std::string& message);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* what() <span class="keyword">const</span> noexcept <span class="keyword">override</span>;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keyword">const</span> <a class="code" href="structhueplusplus_1_1_file_info.html">FileInfo</a>& GetFile() <span class="keyword">const</span> noexcept;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">protected</span>:</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <a class="code" href="classhueplusplus_1_1_hue_exception.html">HueException</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* exceptionName, <a class="code" href="structhueplusplus_1_1_file_info.html">FileInfo</a> fileInfo, <span class="keyword">const</span> std::string& message);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">private</span>:</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  std::string whatMessage;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <a class="code" href="structhueplusplus_1_1_file_info.html">FileInfo</a> fileInfo;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> };</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classhueplusplus_1_1_hue_a_p_i_response_exception.html"> 83</a></span> <span class="keyword">class </span><a class="code" href="classhueplusplus_1_1_hue_a_p_i_response_exception.html">HueAPIResponseException</a> : <span class="keyword">public</span> <a class="code" href="classhueplusplus_1_1_hue_exception.html">HueException</a></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> {</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="classhueplusplus_1_1_hue_a_p_i_response_exception.html">HueAPIResponseException</a>(<a class="code" href="structhueplusplus_1_1_file_info.html">FileInfo</a> fileInfo, <span class="keywordtype">int</span> error, std::string address, std::string description);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordtype">int</span> GetErrorNumber() <span class="keyword">const</span> noexcept;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keyword">const</span> std::string& GetAddress() <span class="keyword">const</span> noexcept;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keyword">const</span> std::string& GetDescription() <span class="keyword">const</span> noexcept;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keyword">static</span> <a class="code" href="classhueplusplus_1_1_hue_a_p_i_response_exception.html">HueAPIResponseException</a> Create(<a class="code" href="structhueplusplus_1_1_file_info.html">FileInfo</a> fileInfo, <span class="keyword">const</span> nlohmann::json& response);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="keyword">private</span>:</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keyword">static</span> std::string GetMessage(<span class="keywordtype">int</span> error, <span class="keyword">const</span> std::string& addr, <span class="keyword">const</span> std::string& description);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> </div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="keyword">private</span>:</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordtype">int</span> error;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  std::string address;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  std::string description;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> };</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> } <span class="comment">// namespace hueplusplus</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="preprocessor">#endif</span></div><div class="ttc" id="classhueplusplus_1_1_hue_exception_html"><div class="ttname"><a href="classhueplusplus_1_1_hue_exception.html">hueplusplus::HueException</a></div><div class="ttdoc">Exception class with file information. Base class of all custom exception classes. </div><div class="ttdef"><b>Definition:</b> HueException.h:49</div></div>
<div class="ttc" id="structhueplusplus_1_1_file_info_html_a1da7fcb189d66c18492c4678d452b0fd"><div class="ttname"><a href="structhueplusplus_1_1_file_info.html#a1da7fcb189d66c18492c4678d452b0fd">hueplusplus::FileInfo::func</a></div><div class="ttdeci">std::string func</div><div class="ttdoc">Current function from func. Empty if unknown. </div><div class="ttdef"><b>Definition:</b> HueException.h:41</div></div>
<div class="ttc" id="structhueplusplus_1_1_file_info_html_a5a3d1e5f060dd5df626003504813f116"><div class="ttname"><a href="structhueplusplus_1_1_file_info.html#a5a3d1e5f060dd5df626003504813f116">hueplusplus::FileInfo::ToString</a></div><div class="ttdeci">std::string ToString() const</div><div class="ttdoc">String representation of func, file and line. </div><div class="ttdef"><b>Definition:</b> HueException.cpp:104</div></div>
<div class="ttc" id="namespacehueplusplus_html"><div class="ttname"><a href="namespacehueplusplus.html">hueplusplus</a></div><div class="ttdoc">Namespace for the hueplusplus library. </div><div class="ttdef"><b>Definition:</b> Action.h:27</div></div>
<div class="ttc" id="structhueplusplus_1_1_file_info_html_a0e70a519d2b615963abf5cb2ff4bca4f"><div class="ttname"><a href="structhueplusplus_1_1_file_info.html#a0e70a519d2b615963abf5cb2ff4bca4f">hueplusplus::FileInfo::filename</a></div><div class="ttdeci">std::string filename</div><div class="ttdoc">Current file name from FILE. Empty if unknown. </div><div class="ttdef"><b>Definition:</b> HueException.h:37</div></div>
<div class="ttc" id="structhueplusplus_1_1_file_info_html"><div class="ttname"><a href="structhueplusplus_1_1_file_info.html">hueplusplus::FileInfo</a></div><div class="ttdoc">Contains information about error location, use CURRENT_FILE_INFO to create. </div><div class="ttdef"><b>Definition:</b> HueException.h:34</div></div>
<div class="ttc" id="structhueplusplus_1_1_file_info_html_a0f10116b94c4038f6f0bb8c693c9026e"><div class="ttname"><a href="structhueplusplus_1_1_file_info.html#a0f10116b94c4038f6f0bb8c693c9026e">hueplusplus::FileInfo::line</a></div><div class="ttdeci">int line</div><div class="ttdoc">Current line number from LINE. -1 if unknown. </div><div class="ttdef"><b>Definition:</b> HueException.h:39</div></div>
<div class="ttc" id="classhueplusplus_1_1_hue_a_p_i_response_exception_html"><div class="ttname"><a href="classhueplusplus_1_1_hue_a_p_i_response_exception.html">hueplusplus::HueAPIResponseException</a></div><div class="ttdoc">Exception caused by a Hue API "error" response with additional information. </div><div class="ttdef"><b>Definition:</b> HueException.h:83</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>