summaryrefslogtreecommitdiffstats
path: root/ue2/doxygen/cfile_8h-source.html
blob: 43bf78d1e42908de0e1d6e3a2160e6bb6b85c022 (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>imgsynth2: imgsynth2/cfile.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="annotated.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
  </ul>
</div>
<h1>imgsynth2/cfile.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00009"></a>00009 <span class="preprocessor">#ifndef CFILE_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define CFILE_H</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;set&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;list&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;stdexcept&gt;</span>
<a name="l00017"></a>00017 
<a name="l00029"></a><a class="code" href="classCFile.html">00029</a> <span class="keyword">class </span><a class="code" href="classCFile.html" title="Abstract class for handling files. Needed for generic use in CScriptparser.">CFile</a>
<a name="l00030"></a>00030 {
<a name="l00031"></a>00031   <span class="keyword">public</span>:
<a name="l00036"></a><a class="code" href="classCFile_1_1FileError.html">00036</a>     <span class="keyword">class </span><a class="code" href="classCFile_1_1FileError.html" title="Exception thrown by implemententations of CFile.">FileError</a> : <span class="keyword">public</span> std::invalid_argument {
<a name="l00037"></a>00037       <span class="keyword">public</span>:
<a name="l00047"></a><a class="code" href="classCFile_1_1FileError.html#3d86e28f4389bcf3d1422b461885c858">00047</a>         <a class="code" href="classCFile_1_1FileError.html#3d86e28f4389bcf3d1422b461885c858" title="Default exception ctor.">FileError</a>(<span class="keyword">const</span> std::string&amp; what)
<a name="l00048"></a>00048           : std::invalid_argument(what)
<a name="l00049"></a>00049         {}
<a name="l00050"></a>00050     };
<a name="l00051"></a>00051 
<a name="l00061"></a><a class="code" href="classCFile.html#ebb1693f8c740d139f553b58874f82c1">00061</a>     <span class="keyword">virtual</span> <a class="code" href="classCFile.html#ebb1693f8c740d139f553b58874f82c1" title="Default dtor (virtual).">~CFile</a>()
<a name="l00062"></a>00062     {};
<a name="l00063"></a>00063 
<a name="l00073"></a>00073     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCFile.html#fa8780b6d34045102aff06fceccaf075" title="Pure virtual method (interface). Should read data from filestream.">read</a>(std::ifstream&amp; in) = 0;
<a name="l00074"></a>00074 
<a name="l00084"></a>00084     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCFile.html#a77cd4604afac7b3b1384ca15ef4750e" title="Pure virtual method (interface). Should write data to filestream.">write</a>(std::ofstream&amp; out) = 0;
<a name="l00085"></a>00085 
<a name="l00097"></a>00097     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCFile.html#3991c5f43fab6365cc82ba80afccd791" title="Pure virtual method (interface). Should delegate the function and its parameters...">callFunc</a>(<span class="keyword">const</span> std::string&amp; func, <span class="keyword">const</span> std::list&lt;std::string&gt;&amp; params) = 0;
<a name="l00098"></a>00098 
<a name="l00108"></a><a class="code" href="classCFile.html#7a3148cb5797198cd856587bf001445f">00108</a>     <span class="keywordtype">bool</span> <a class="code" href="classCFile.html#7a3148cb5797198cd856587bf001445f" title="Check if filetype is supported by this implementation.">supportsType</a>(<span class="keyword">const</span> std::string&amp; type)
<a name="l00109"></a>00109     {
<a name="l00110"></a>00110       <span class="keywordflow">return</span> (<a class="code" href="classCFile.html#63719f47953108756b34b6c7e701f536">m_types</a>.find(type) == <a class="code" href="classCFile.html#63719f47953108756b34b6c7e701f536">m_types</a>.end()) ? <span class="keyword">false</span> : <span class="keyword">true</span>;
<a name="l00111"></a>00111     }
<a name="l00112"></a>00112 
<a name="l00113"></a>00113   <span class="keyword">protected</span>:
<a name="l00114"></a>00114     <span class="comment">/* members */</span>
<a name="l00116"></a><a class="code" href="classCFile.html#63719f47953108756b34b6c7e701f536">00116</a>     std::set&lt;std::string&gt; <a class="code" href="classCFile.html#63719f47953108756b34b6c7e701f536">m_types</a>;
<a name="l00117"></a>00117 };
<a name="l00118"></a>00118 
<a name="l00119"></a>00119 <span class="preprocessor">#endif</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span>
<a name="l00121"></a>00121 <span class="comment">/* vim: set et sw=2 ts=2: */</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sun May 3 19:16:26 2009 for imgsynth2 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>