1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
---|
3 | <title>FCollada: FUtils/FUStatus.h Source File</title> |
---|
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.4.6-NO --> |
---|
8 | <div class="tabs"> |
---|
9 | <ul> |
---|
10 | <li><a href="index.html"><span>Main Page</span></a></li> |
---|
11 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
12 | <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
---|
13 | <li><a href="classes.html"><span>Classes</span></a></li> |
---|
14 | <li id="current"><a href="files.html"><span>Files</span></a></li> |
---|
15 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
16 | </ul></div> |
---|
17 | <div class="tabs"> |
---|
18 | <ul> |
---|
19 | <li><a href="files.html"><span>File List</span></a></li> |
---|
20 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
21 | </ul></div> |
---|
22 | <h1>FUtils/FUStatus.h</h1><a href="_f_u_status_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> |
---|
23 | <a name="l00002"></a>00002 <span class="comment"> Copyright (C) 2005-2006 Feeling Software Inc.</span> |
---|
24 | <a name="l00003"></a>00003 <span class="comment"> MIT License: http://www.opensource.org/licenses/mit-license.php</span> |
---|
25 | <a name="l00004"></a>00004 <span class="comment">*/</span> |
---|
26 | <a name="l00005"></a>00005 <span class="comment">/*</span> |
---|
27 | <a name="l00006"></a>00006 <span class="comment"> Based on the FS Import classes:</span> |
---|
28 | <a name="l00007"></a>00007 <span class="comment"> Copyright (C) 2005-2006 Feeling Software Inc</span> |
---|
29 | <a name="l00008"></a>00008 <span class="comment"> Copyright (C) 2005-2006 Autodesk Media Entertainment</span> |
---|
30 | <a name="l00009"></a>00009 <span class="comment"> MIT License: http://www.opensource.org/licenses/mit-license.php</span> |
---|
31 | <a name="l00010"></a>00010 <span class="comment">*/</span> |
---|
32 | <a name="l00011"></a>00011 |
---|
33 | <a name="l00017"></a>00017 <span class="preprocessor">#ifndef _FU_STATUS_H_</span> |
---|
34 | <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _FU_STATUS_H_</span> |
---|
35 | <a name="l00019"></a>00019 <span class="preprocessor"></span> |
---|
36 | <a name="l00029"></a><a class="code" href="class_f_u_status.html">00029</a> <span class="keyword">class </span>FCOLLADA_EXPORT <a class="code" href="class_f_u_status.html">FUStatus</a> |
---|
37 | <a name="l00030"></a>00030 { |
---|
38 | <a name="l00031"></a>00031 <span class="keyword">private</span>: |
---|
39 | <a name="l00032"></a>00032 fstring errorString; |
---|
40 | <a name="l00033"></a>00033 <span class="keywordtype">bool</span> callSuccessful; |
---|
41 | <a name="l00034"></a>00034 |
---|
42 | <a name="l00035"></a>00035 <span class="keyword">public</span>: |
---|
43 | <a name="l00039"></a><a class="code" href="class_f_u_status.html#95cc52f06f3c36cd598dc6493ff411ed">00039</a> <a class="code" href="class_f_u_status.html">FUStatus</a>(<span class="keywordtype">bool</span> _callSuccessful=<span class="keyword">true</span>) { callSuccessful = _callSuccessful; } |
---|
44 | <a name="l00040"></a>00040 |
---|
45 | <a name="l00044"></a><a class="code" href="class_f_u_status.html#8ed1c51f2a3cb594483e22dae22c2b74">00044</a> <a class="code" href="class_f_u_status.html">FUStatus</a>& Fail() { callSuccessful = <span class="keyword">false</span>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
46 | <a name="l00045"></a>00045 |
---|
47 | <a name="l00051"></a><a class="code" href="class_f_u_status.html#225b2b3fdafef154091fa333244131ed">00051</a> <a class="code" href="class_f_u_status.html">FUStatus</a>& Fail(<span class="keyword">const</span> fstring& str, size_t line=0) { callSuccessful = <span class="keyword">false</span>; AppendString(<a class="code" href="_f_u_string_8h.html#afc191eda457ff64f0e441d65311e4b8">FS</a>(<span class="stringliteral">"ERROR["</span>) + <a class="code" href="_f_u_string_8h.html#07704e1457df8a52db49b436f419d9f9">TO_FSTRING</a>(line) + <a class="code" href="_f_u_string_8h.html#afc191eda457ff64f0e441d65311e4b8">FS</a>(<span class="stringliteral">"]: "</span>) + str); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
48 | <a name="l00052"></a><a class="code" href="class_f_u_status.html#d736196ab7f2f99f6b7272dbfa8d1cf6">00052</a> <a class="code" href="class_f_u_status.html">FUStatus</a>& Fail(<span class="keyword">const</span> fchar* str, size_t line=0) { callSuccessful = <span class="keyword">false</span>; AppendString(<a class="code" href="_f_u_string_8h.html#afc191eda457ff64f0e441d65311e4b8">FS</a>(<span class="stringliteral">"ERROR["</span>) + <a class="code" href="_f_u_string_8h.html#07704e1457df8a52db49b436f419d9f9">TO_FSTRING</a>(line) + <a class="code" href="_f_u_string_8h.html#afc191eda457ff64f0e441d65311e4b8">FS</a>(<span class="stringliteral">"]: "</span>) + str); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
49 | <a name="l00059"></a><a class="code" href="class_f_u_status.html#4e02200571518e858fc7479a8d356fee">00059</a> <a class="code" href="class_f_u_status.html">FUStatus</a>& Warning(<span class="keyword">const</span> fstring& str, size_t line=0) { AppendString(<a class="code" href="_f_u_string_8h.html#afc191eda457ff64f0e441d65311e4b8">FS</a>(<span class="stringliteral">"WARNING["</span>) + <a class="code" href="_f_u_string_8h.html#07704e1457df8a52db49b436f419d9f9">TO_FSTRING</a>(line) + <a class="code" href="_f_u_string_8h.html#afc191eda457ff64f0e441d65311e4b8">FS</a>(<span class="stringliteral">"]: "</span>) + str); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
50 | <a name="l00060"></a><a class="code" href="class_f_u_status.html#78c9361cf78240d07febaa74c799c4d7">00060</a> <a class="code" href="class_f_u_status.html">FUStatus</a>& Warning(<span class="keyword">const</span> fchar* str, size_t line=0) { AppendString(<a class="code" href="_f_u_string_8h.html#afc191eda457ff64f0e441d65311e4b8">FS</a>(<span class="stringliteral">"WARNING["</span>) + <a class="code" href="_f_u_string_8h.html#07704e1457df8a52db49b436f419d9f9">TO_FSTRING</a>(line) + <a class="code" href="_f_u_string_8h.html#afc191eda457ff64f0e441d65311e4b8">FS</a>(<span class="stringliteral">"]: "</span>) + str); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
51 | <a name="l00066"></a><a class="code" href="class_f_u_status.html#ea95ead156fcd99b4517c175c7723215">00066</a> <span class="keywordtype">void</span> AppendStatus(<span class="keyword">const</span> <a class="code" href="class_f_u_status.html">FUStatus</a>& a) { AppendString(a.<a class="code" href="class_f_u_status.html#e36e8e8c0c6058ca76df55ffdde2e3b0">errorString</a>); callSuccessful &= a.<a class="code" href="class_f_u_status.html#1e0ea54066c8e5798922107e866be286">callSuccessful</a>; } |
---|
52 | <a name="l00067"></a>00067 |
---|
53 | <a name="l00071"></a><a class="code" href="class_f_u_status.html#f9be553d66c4eed961aa0cfba003e343">00071</a> <span class="keywordtype">void</span> AppendString(<span class="keyword">const</span> fstring& str) { AppendString(str.c_str()); } |
---|
54 | <a name="l00072"></a><a class="code" href="class_f_u_status.html#616204ac2234fa98dfb7c3efa42c31dc">00072</a> <span class="keywordtype">void</span> AppendString(<span class="keyword">const</span> fchar* str) { <span class="keywordflow">if</span> (*str != 0) { <span class="keywordflow">if</span> (!errorString.empty()) errorString += FC(<span class="stringliteral">"\r\n"</span>); errorString += str; } } |
---|
55 | <a name="l00076"></a><a class="code" href="class_f_u_status.html#7eb0eb84fdbd29571b6498847ad609bd">00076</a> <span class="keyword">const</span> fchar* GetErrorString()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> errorString.empty() ? (callSuccessful ? FC(<span class="stringliteral">"Success"</span>) : FC(<span class="stringliteral">"Failure"</span>)) : errorString.c_str(); } |
---|
56 | <a name="l00077"></a>00077 |
---|
57 | <a name="l00080"></a><a class="code" href="class_f_u_status.html#d42a14919d643345a864dc11c5d4c143">00080</a> <span class="keywordtype">bool</span> IsSuccessful()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> callSuccessful; } |
---|
58 | <a name="l00081"></a>00081 |
---|
59 | <a name="l00084"></a><a class="code" href="class_f_u_status.html#fad1ae342a9c6c4bba87d1e7ed1eb9dd">00084</a> <span class="keywordtype">bool</span> IsFailure()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !callSuccessful; } |
---|
60 | <a name="l00085"></a>00085 |
---|
61 | <a name="l00088"></a><a class="code" href="class_f_u_status.html#485abc5dd5eb7dd81d1d35fbe1fe2591">00088</a> operator bool()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> callSuccessful; } |
---|
62 | <a name="l00089"></a>00089 }; |
---|
63 | <a name="l00090"></a>00090 |
---|
64 | <a name="l00091"></a>00091 <span class="preprocessor">#endif // _FU_STATUS_H_</span> |
---|
65 | </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 12 16:44:39 2006 for FCollada by |
---|
66 | <a href="http://www.doxygen.org/index.html"> |
---|
67 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6-NO </small></address> |
---|
68 | </body> |
---|
69 | </html> |
---|