blob: fe660529d4ff03d9459d2cdfbb2cad8c0bd96f24 (
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
<!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/cscriptparser.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 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/cscriptparser.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef CSCRIPTPARSER_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define CSCRIPTPARSER_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include <stdexcept></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include <string></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include <list></span>
<a name="l00014"></a>00014 <span class="preprocessor">#include <set></span>
<a name="l00015"></a>00015 <span class="preprocessor">#include "cfile.h"</span>
<a name="l00016"></a>00016
<a name="l00030"></a><a class="code" href="classCScriptparser.html">00030</a> <span class="keyword">class </span><a class="code" href="classCScriptparser.html" title="class for parsing simple scriptfiles">CScriptparser</a>
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 <span class="keyword">public</span>:
<a name="l00037"></a><a class="code" href="classCScriptparser_1_1ParserError.html">00037</a> <span class="keyword">class </span><a class="code" href="classCScriptparser_1_1ParserError.html" title="Exception thrown by CScriptparser.">ParserError</a> : <span class="keyword">public</span> std::invalid_argument {
<a name="l00038"></a>00038 <span class="keyword">public</span>:
<a name="l00048"></a><a class="code" href="classCScriptparser_1_1ParserError.html#97e361a51f998f19064ab2f407f343ce">00048</a> <a class="code" href="classCScriptparser_1_1ParserError.html#97e361a51f998f19064ab2f407f343ce" title="Default exception ctor.">ParserError</a>(<span class="keyword">const</span> std::string& what)
<a name="l00049"></a>00049 : std::invalid_argument(what), m_line(<span class="stringliteral">""</span>)
<a name="l00050"></a>00050 {}
<a name="l00051"></a>00051
<a name="l00062"></a><a class="code" href="classCScriptparser_1_1ParserError.html#83dc8bc537043d12d4c98e30f8d44f38">00062</a> <a class="code" href="classCScriptparser_1_1ParserError.html#97e361a51f998f19064ab2f407f343ce" title="Default exception ctor.">ParserError</a>(<span class="keyword">const</span> std::string& what, <span class="keyword">const</span> std::string& line)
<a name="l00063"></a>00063 : std::invalid_argument(what), m_line(line)
<a name="l00064"></a>00064 {}
<a name="l00065"></a>00065
<a name="l00075"></a><a class="code" href="classCScriptparser_1_1ParserError.html#191ff6b6f9d40dc40431308e4ff831ad">00075</a> <a class="code" href="classCScriptparser_1_1ParserError.html#191ff6b6f9d40dc40431308e4ff831ad" title="Default dtor.">~ParserError</a>() throw()
<a name="l00076"></a>00076 {}
<a name="l00077"></a>00077
<a name="l00086"></a><a class="code" href="classCScriptparser_1_1ParserError.html#103d0af66821f52e11a57391a21de2b8">00086</a> <span class="keyword">const</span> std::string &<a class="code" href="classCScriptparser_1_1ParserError.html#103d0af66821f52e11a57391a21de2b8" title="returns reference to currently parsed scriptline (if set)">getLine</a>()
<a name="l00087"></a>00087 {
<a name="l00088"></a>00088 <span class="keywordflow">return</span> m_line;
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090
<a name="l00091"></a>00091 <span class="keyword">private</span>:
<a name="l00092"></a>00092 <span class="comment">/* members*/</span>
<a name="l00093"></a>00093 std::string m_line;
<a name="l00094"></a>00094 };
<a name="l00095"></a>00095
<a name="l00105"></a>00105 <a class="code" href="classCScriptparser.html#634edff14e86240f53ff7451343c6c56" title="Default ctor.">CScriptparser</a>(<span class="keyword">const</span> std::string& scriptfile);
<a name="l00106"></a>00106
<a name="l00116"></a>00116 <a class="code" href="classCScriptparser.html#09591a8276fd376e04d4017f3c8d17d1" title="Default dtor.">~CScriptparser</a>();
<a name="l00117"></a>00117
<a name="l00127"></a>00127 <span class="keywordtype">void</span> <a class="code" href="classCScriptparser.html#d288fe020a67ade7914d7a3a77e16c42" title="Start parsing the scriptfile.">parse</a>();
<a name="l00128"></a>00128
<a name="l00129"></a>00129 <span class="keyword">protected</span>:
<a name="l00141"></a>00141 <span class="keywordtype">void</span> <a class="code" href="classCScriptparser.html#9318b7e1379de95a7c920f7d0b79eb7b" title="Delegates the function and its parameters to the correct method (internal or handler)...">callFunc</a>(<span class="keyword">const</span> std::string& func, <span class="keyword">const</span> std::list<std::string>& funcparams);
<a name="l00142"></a>00142
<a name="l00155"></a>00155 <span class="keywordtype">void</span> <a class="code" href="classCScriptparser.html#2f2aba481c11c38b85bb2e8306961c03" title="Handles/wrappes read-command. according to the filetype the read-method of the corresponding...">read</a>(std::list<std::string> funcparams);
<a name="l00156"></a>00156
<a name="l00169"></a>00169 <span class="keywordtype">void</span> <a class="code" href="classCScriptparser.html#a8ef12e68ca61acfd463e55a3fe8518c" title="Handles/wrappes write-command. according to the filetype the write-method of the...">write</a>(std::list<std::string> funcparams);
<a name="l00170"></a>00170
<a name="l00171"></a>00171 <span class="keyword">private</span>:
<a name="l00172"></a>00172 <span class="comment">/* members */</span>
<a name="l00173"></a>00173 std::set<CFile *> m_handlers;
<a name="l00174"></a>00174 std::string m_scriptfile;
<a name="l00175"></a>00175 std::string m_curline;
<a name="l00176"></a>00176 <a class="code" href="classCFile.html" title="Abstract class for handling files. Needed for generic use in CScriptparser.">CFile</a> *m_handler;
<a name="l00177"></a>00177 };
<a name="l00178"></a>00178
<a name="l00179"></a>00179 <span class="preprocessor">#endif</span>
<a name="l00180"></a>00180 <span class="preprocessor"></span>
<a name="l00181"></a>00181 <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
<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>
|