-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_parse_8h_source.html
More file actions
76 lines (76 loc) · 7.07 KB
/
_parse_8h_source.html
File metadata and controls
76 lines (76 loc) · 7.07 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
<!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"/>
<title>naowalkoptimiser: /Users/jason/Code/naowalkoptimiser/src/Parse.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.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>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<h1>/Users/jason/Code/naowalkoptimiser/src/Parse.h</h1><a href="_parse_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef PARSE_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define PARSE_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include <vector></span>
<a name="l00005"></a>00005 <span class="preprocessor">#include <stdlib.h></span>
<a name="l00006"></a>00006 <span class="preprocessor">#include <stdio.h></span>
<a name="l00007"></a>00007
<a name="l00008"></a>00008 <span class="comment">// these define the maximum number of characters in a key, and in a value</span>
<a name="l00009"></a><a class="code" href="_parse_8h.html#a19eb8787f5e9070ef2249bb450cc963e">00009</a> <span class="preprocessor">#define MAX_KEYLENGTH 64</span>
<a name="l00010"></a><a class="code" href="_parse_8h.html#a14feecd1195407ae2d85f75d7f775939">00010</a> <span class="preprocessor"></span><span class="preprocessor">#define MAX_VALLENGTH 64</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="keyword">using namespace </span>std;
<a name="l00013"></a>00013
<a name="l00014"></a><a class="code" href="struct_pair.html">00014</a> <span class="keyword">struct </span><a class="code" href="struct_pair.html">Pair</a> {
<a name="l00015"></a><a class="code" href="struct_pair.html#abc106eca73b5945600863a3cb9fc1913">00015</a> <span class="keywordtype">char</span>* <a class="code" href="struct_pair.html#abc106eca73b5945600863a3cb9fc1913">key</a>; <span class="comment">// note max lengths above</span>
<a name="l00016"></a><a class="code" href="struct_pair.html#a5827e60da15d087a828a2abebda59639">00016</a> <span class="keywordtype">char</span>* <a class="code" href="struct_pair.html#a5827e60da15d087a828a2abebda59639">val</a>;
<a name="l00017"></a>00017 };
<a name="l00018"></a>00018
<a name="l00019"></a><a class="code" href="class_parse.html">00019</a> <span class="keyword">class </span><a class="code" href="class_parse.html">Parse</a> {
<a name="l00020"></a>00020 <span class="keyword">public</span>:
<a name="l00021"></a>00021 <a class="code" href="class_parse.html#ab44bf754dbe7e6fc008af31af8ca75fb">Parse</a>();
<a name="l00022"></a>00022 <span class="keywordtype">void</span> <a class="code" href="class_parse.html#a0c3429229bfa3a98482a9219192c97c0">WriteFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename, <span class="keyword">const</span> <span class="keywordtype">char</span>* buffer, <span class="keywordtype">int</span> buffersize);
<a name="l00023"></a>00023 <span class="keywordtype">bool</span> <a class="code" href="class_parse.html#ac9163da35a67f79f85c1433a6084beae">ParseFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename);
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="comment">// probably should never call this externally, but there's no technical reason why you can't ...</span>
<a name="l00026"></a>00026 <span class="keywordtype">void</span> <a class="code" href="class_parse.html#a7b0eb26e76e6e561741bcad17d4a05f8">RegisterPair</a>(<span class="keywordtype">char</span>* k, <span class="keywordtype">char</span>* v);
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="keywordtype">int</span> <a class="code" href="class_parse.html#a161364f4beae454013372ed4fd330c48">GetAsInt</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* k);
<a name="l00029"></a>00029 <span class="keywordtype">bool</span> <a class="code" href="class_parse.html#a7f30e3db760b4d15b28ed1ffbb2d3341">GetAsBool</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* k);
<a name="l00030"></a>00030 <span class="keywordtype">char</span>* <a class="code" href="class_parse.html#aa6904f21adffa6089f8bdf68ae04c32d">GetAsString</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* k);
<a name="l00031"></a>00031 <span class="keywordtype">double</span> <a class="code" href="class_parse.html#a4f023fa1119478aab673050c1a0330ca">GetAsDouble</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* k);
<a name="l00032"></a>00032 <span class="keywordtype">bool</span> <a class="code" href="class_parse.html#aa7aef6785f03ad433c2729c1e2e35e53">HasKey</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* k);
<a name="l00033"></a>00033 <span class="keyword">private</span>:
<a name="l00034"></a>00034 <span class="comment">// don't mess with this.</span>
<a name="l00035"></a>00035 <a class="code" href="struct_pair.html">Pair</a>* FindPair(<span class="keyword">const</span> <span class="keywordtype">char</span>* k);
<a name="l00036"></a>00036 <a class="code" href="struct_pair.html">Pair</a>* FindPairFailFast(<span class="keyword">const</span> <span class="keywordtype">char</span>* k);
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keywordtype">bool</span> IsTerminator(<span class="keyword">const</span> <span class="keywordtype">char</span> c);
<a name="l00039"></a>00039 <span class="keywordtype">bool</span> IsLF(<span class="keyword">const</span> <span class="keywordtype">char</span> c);
<a name="l00040"></a>00040 <span class="keywordtype">bool</span> IsSpace(<span class="keyword">const</span> <span class="keywordtype">char</span> c);
<a name="l00041"></a>00041
<a name="l00042"></a>00042 vector<Pair> keyValuePairs;
<a name="l00043"></a>00043 };
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Fri Oct 9 13:42:11 2009 for naowalkoptimiser by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>