threed-beam-fea/docs/html/classfea_1_1_c_s_v_parser.html

253 lines
12 KiB
HTML

<!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.10"/>
<title>3D Beam Finite Element Code: fea::CSVParser Class Reference</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>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.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="projectlogo"><img alt="Logo" src="logo_64x64.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">3D Beam Finite Element Code
&#160;<span id="projectnumber">1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</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="namespacefea.html">fea</a></li><li class="navelem"><a class="el" href="classfea_1_1_c_s_v_parser.html">CSVParser</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classfea_1_1_c_s_v_parser-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">fea::CSVParser Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Reads data from a csv file into an <code>std::vector</code> and writes the contents of an <code>std::vector</code> to a file.
<a href="classfea_1_1_c_s_v_parser.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="csv__parser_8h_source.html">csv_parser.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4c3a97a78d9ad2254eeb2682e8fa4070"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a4c3a97a78d9ad2254eeb2682e8fa4070"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classfea_1_1_c_s_v_parser.html#a4c3a97a78d9ad2254eeb2682e8fa4070">parseToVector</a> (std::string filename, std::vector&lt; T &gt; &amp;data)</td></tr>
<tr class="memdesc:a4c3a97a78d9ad2254eeb2682e8fa4070"><td class="mdescLeft">&#160;</td><td class="mdescRight">parses the contents of <code>file_name</code> into <code>data</code>. <a href="#a4c3a97a78d9ad2254eeb2682e8fa4070">More...</a><br /></td></tr>
<tr class="separator:a4c3a97a78d9ad2254eeb2682e8fa4070"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a249d913f7e14f3946e376e2c7b346576"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a249d913f7e14f3946e376e2c7b346576"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classfea_1_1_c_s_v_parser.html#a249d913f7e14f3946e376e2c7b346576">write</a> (const std::string &amp;filename, const std::vector&lt; std::vector&lt; T &gt; &gt; &amp;data, unsigned int precision, const std::string &amp;delimiter)</td></tr>
<tr class="separator:a249d913f7e14f3946e376e2c7b346576"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Reads data from a csv file into an <code>std::vector</code> and writes the contents of an <code>std::vector</code> to a file. </p>
<dl class="section note"><dt>Note</dt><dd>The parser assumes the data is comma delimited when reading data from a file. </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a4c3a97a78d9ad2254eeb2682e8fa4070"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void fea::CSVParser::parseToVector </td>
<td>(</td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::vector&lt; T &gt; &amp;&#160;</td>
<td class="paramname"><em>data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>parses the contents of <code>file_name</code> into <code>data</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">file_name</td><td><code>std::string</code>. The file specified is opened and the contained information is parsed into <code>data</code>. </td></tr>
<tr><td class="paramdir"></td><td class="paramname">data</td><td><code>std::vector&lt;T&gt;</code>. Variable updated in place that will fold the data of the specified file. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a249d913f7e14f3946e376e2c7b346576"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void fea::CSVParser::write </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; std::vector&lt; T &gt; &gt; &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>precision</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>delimiter</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes the 2D vector <code>data</code> to the file specified by <code>filename</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td><code>std::string</code>. The file to write data to. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td><code>std::vector&lt; std::vector&lt; T &gt; &gt;</code>. Data to write to file. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">precision</td><td><code>unsigned int</code>. The number of decimal places to use when writing the data to file. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">demlimiter</td><td><code>std::string</code>. The delimiter to use between data entries. </td></tr>
</table>
</dd>
</dl>
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classfea_1_1_c_s_v_parser_a249d913f7e14f3946e376e2c7b346576_icgraph.png" border="0" usemap="#classfea_1_1_c_s_v_parser_a249d913f7e14f3946e376e2c7b346576_icgraph" alt=""/></div>
<map name="classfea_1_1_c_s_v_parser_a249d913f7e14f3946e376e2c7b346576_icgraph" id="classfea_1_1_c_s_v_parser_a249d913f7e14f3946e376e2c7b346576_icgraph">
<area shape="rect" id="node2" href="namespacefea.html#aca9724c7cab58b0671b29f3f4318e599" title="Solves the finite element analysis defined by the input Job, boundary conditions, and prescribed noda..." alt="" coords="207,31,289,57"/>
<area shape="rect" id="node3" href="cantilever__beam__with__ties_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97" title="main" alt="" coords="359,5,411,32"/>
<area shape="rect" id="node4" href="cmd_8cpp.html#ab7c3e62134c4637270fa4f9e59fe7b7a" title="runAnalysis" alt="" coords="337,56,432,83"/>
<area shape="rect" id="node5" href="cmd_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97" title="main" alt="" coords="480,56,532,83"/>
</map>
</div>
</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/<a class="el" href="csv__parser_8h_source.html">csv_parser.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Nov 5 2015 10:34:37 for 3D Beam Finite Element Code by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>