|
|
- <!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>WORM: src/sql/wsqltable.cpp Source File</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/search.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css"/>
- </head>
- <body onload='searchBox.OnSelectItem(0);'>
- <!-- Generated by Doxygen 1.7.3 -->
- <script type="text/javascript"><!--
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- --></script>
- <script type="text/javascript">
- function hasClass(ele,cls) {
- return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
- }
-
- function addClass(ele,cls) {
- if (!this.hasClass(ele,cls)) ele.className += " "+cls;
- }
-
- function removeClass(ele,cls) {
- if (hasClass(ele,cls)) {
- var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
- ele.className=ele.className.replace(reg,' ');
- }
- }
-
- function toggleVisibility(linkObj) {
- var base = linkObj.getAttribute('id');
- var summary = document.getElementById(base + '-summary');
- var content = document.getElementById(base + '-content');
- var trigger = document.getElementById(base + '-trigger');
- if ( hasClass(linkObj,'closed') ) {
- summary.style.display = 'none';
- content.style.display = 'block';
- trigger.src = 'open.png';
- removeClass(linkObj,'closed');
- addClass(linkObj,'opened');
- } else if ( hasClass(linkObj,'opened') ) {
- summary.style.display = 'block';
- content.style.display = 'none';
- trigger.src = 'closed.png';
- removeClass(linkObj,'opened');
- addClass(linkObj,'closed');
- }
- return false;
- }
- </script>
- <div id="top">
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectlogo"><img alt="Logo" src="worm_sm.png"></td>
- <td style="padding-left: 0.5em;">
- <div id="projectname">WORM <span id="projectnumber">0.2</span></div>
- <div id="projectbrief">A C++ DAL/ORM code generation framework</div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="navrow1" class="tabs">
- <ul class="tablist">
- <li><a href="index.html"><span>Main Page</span></a></li>
- <li><a href="pages.html"><span>Related Pages</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>
- <li id="searchli">
- <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="files.html"><span>File List</span></a></li>
- <li><a href="globals.html"><span>File Members</span></a></li>
- </ul>
- </div>
- <div class="header">
- <div class="headertitle">
- <h1>src/sql/wsqltable.cpp</h1> </div>
- </div>
- <div class="contents">
- <a href="wsqltable_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
- <a name="l00002"></a>00002 <span class="comment"> WORM - a DAL/ORM code generation framework</span>
- <a name="l00003"></a>00003 <span class="comment"> Copyright (C) 2011 Erik Winn <erikwinnmail@yahoo.com></span>
- <a name="l00004"></a>00004 <span class="comment"></span>
- <a name="l00005"></a>00005 <span class="comment"> This program is free software: you can redistribute it and/or modify</span>
- <a name="l00006"></a>00006 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
- <a name="l00007"></a>00007 <span class="comment"> the Free Software Foundation, either version 3 of the License, or</span>
- <a name="l00008"></a>00008 <span class="comment"> (at your option) any later version.</span>
- <a name="l00009"></a>00009 <span class="comment"></span>
- <a name="l00010"></a>00010 <span class="comment"> This program is distributed in the hope that it will be useful,</span>
- <a name="l00011"></a>00011 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
- <a name="l00012"></a>00012 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
- <a name="l00013"></a>00013 <span class="comment"> GNU General Public License for more details.</span>
- <a name="l00014"></a>00014 <span class="comment"></span>
- <a name="l00015"></a>00015 <span class="comment"> You should have received a copy of the GNU General Public License</span>
- <a name="l00016"></a>00016 <span class="comment"> along with this program. If not, see <http://www.gnu.org/licenses/>.</span>
- <a name="l00017"></a>00017 <span class="comment">*/</span>
- <a name="l00018"></a>00018
- <a name="l00019"></a>00019 <span class="preprocessor">#include "<a class="code" href="wsqltable_8h.html">wsqltable.h</a>"</span>
- <a name="l00020"></a>00020
- <a name="l00021"></a>00021 <span class="keyword">namespace </span>WSql {
- <a name="l00022"></a>00022
- <a name="l00071"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a4e36efa3adb37e512acb893a1780dacf">00071</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a4e36efa3adb37e512acb893a1780dacf">WSqlTable::WSqlTable</a>()
- <a name="l00072"></a>00072 {
- <a name="l00073"></a>00073 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a62b227cd91b507b8e7f6ec94632c7b06">_type</a> = <a class="code" href="class_w_sql_1_1_w_sql_table.html#ac5862c9bf927229c514f72faf4f0b6e0ad6db7bdb369ab911b49a5789fe92ca0c">NORMAL</a>;
- <a name="l00074"></a>00074 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a8f6fb992c32769856a9c2e827d40d502">_isValid</a> = <span class="keyword">false</span>;
- <a name="l00075"></a>00075 }
- <a name="l00081"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a101b8f8f5ac9436f0e87ffa4bf8b7d18">00081</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a4e36efa3adb37e512acb893a1780dacf">WSqlTable::WSqlTable</a>( <span class="keyword">const</span> std::string name )
- <a name="l00082"></a>00082 {
- <a name="l00083"></a>00083 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a62b227cd91b507b8e7f6ec94632c7b06">_type</a> = <a class="code" href="class_w_sql_1_1_w_sql_table.html#ac5862c9bf927229c514f72faf4f0b6e0ad6db7bdb369ab911b49a5789fe92ca0c">NORMAL</a>;
- <a name="l00084"></a>00084 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a6c004456d5f594925d1c4a431658f735">_name</a> = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a27a8e1e92061bebb56b1d3a79e216ff4">name</a>;
- <a name="l00085"></a>00085 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a8f6fb992c32769856a9c2e827d40d502">_isValid</a> = <span class="keyword">false</span>;
- <a name="l00086"></a>00086 }
- <a name="l00087"></a>00087
- <a name="l00091"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a03d7d34e06f95ec0b3380950452e09a4">00091</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a4e36efa3adb37e512acb893a1780dacf">WSqlTable::WSqlTable</a>( <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html" title="WSqlTable is an abstraction for a single table, collection or view in a database.">WSqlTable</a> &other )
- <a name="l00092"></a>00092 {
- <a name="l00093"></a>00093 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a62b227cd91b507b8e7f6ec94632c7b06">_type</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a62b227cd91b507b8e7f6ec94632c7b06">_type</a>;
- <a name="l00094"></a>00094 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a8f6fb992c32769856a9c2e827d40d502">_isValid</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a8f6fb992c32769856a9c2e827d40d502">_isValid</a>;
- <a name="l00095"></a>00095 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a6c004456d5f594925d1c4a431658f735">_name</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a6c004456d5f594925d1c4a431658f735">_name</a>;
- <a name="l00096"></a>00096 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a417e8429a135b3c2583ac39e9fdacbfd">_className</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a417e8429a135b3c2583ac39e9fdacbfd">_className</a>;
- <a name="l00097"></a>00097 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>;
- <a name="l00098"></a>00098 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>;
- <a name="l00099"></a>00099 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>;
- <a name="l00100"></a>00100 }
- <a name="l00104"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a82b219a43795f182c2b35529604910c0">00104</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html" title="WSqlTable is an abstraction for a single table, collection or view in a database.">WSqlTable</a>& <a class="code" href="class_w_sql_1_1_w_sql_table.html#a82b219a43795f182c2b35529604910c0">WSqlTable::operator=</a>( <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html" title="WSqlTable is an abstraction for a single table, collection or view in a database.">WSqlTable</a>& other )
- <a name="l00105"></a>00105 {
- <a name="l00106"></a>00106 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a62b227cd91b507b8e7f6ec94632c7b06">_type</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a62b227cd91b507b8e7f6ec94632c7b06">_type</a>;
- <a name="l00107"></a>00107 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a8f6fb992c32769856a9c2e827d40d502">_isValid</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a8f6fb992c32769856a9c2e827d40d502">_isValid</a>;
- <a name="l00108"></a>00108 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a6c004456d5f594925d1c4a431658f735">_name</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a6c004456d5f594925d1c4a431658f735">_name</a>;
- <a name="l00109"></a>00109 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a417e8429a135b3c2583ac39e9fdacbfd">_className</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a417e8429a135b3c2583ac39e9fdacbfd">_className</a>;
- <a name="l00110"></a>00110 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>;
- <a name="l00111"></a>00111 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>;
- <a name="l00112"></a>00112 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a> = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>;
- <a name="l00113"></a>00113 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
- <a name="l00114"></a>00114 }
- <a name="l00118"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a2900fb34a62be6f0003114533d94b4b5">00118</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a2900fb34a62be6f0003114533d94b4b5">WSqlTable::~WSqlTable</a>()
- <a name="l00119"></a>00119 {
- <a name="l00120"></a>00120 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.clear();
- <a name="l00121"></a>00121 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.clear();
- <a name="l00122"></a>00122 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.clear();
- <a name="l00123"></a>00123 }
- <a name="l00139"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#ab811795209f076f189df005fda7030b3">00139</a> <span class="keywordtype">bool</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#ab811795209f076f189df005fda7030b3">WSqlTable::operator==</a>( <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html" title="WSqlTable is an abstraction for a single table, collection or view in a database.">WSqlTable</a> &other )<span class="keyword"> const</span>
- <a name="l00140"></a>00140 <span class="keyword"></span>{
- <a name="l00141"></a>00141 <span class="keywordflow">if</span>(<a class="code" href="class_w_sql_1_1_w_sql_table.html#a8f6fb992c32769856a9c2e827d40d502">_isValid</a> != other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a8f6fb992c32769856a9c2e827d40d502">_isValid</a>)
- <a name="l00142"></a>00142 <span class="keywordflow">return</span> <span class="keyword">false</span>;
- <a name="l00143"></a>00143 <span class="keywordflow">if</span>(<a class="code" href="class_w_sql_1_1_w_sql_table.html#a62b227cd91b507b8e7f6ec94632c7b06">_type</a> != other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a62b227cd91b507b8e7f6ec94632c7b06">_type</a>)
- <a name="l00144"></a>00144 <span class="keywordflow">return</span> <span class="keyword">false</span>;
- <a name="l00145"></a>00145 <span class="keywordflow">if</span> ( <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.size() != other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.size()
- <a name="l00146"></a>00146 || <a class="code" href="class_w_sql_1_1_w_sql_table.html#a6c004456d5f594925d1c4a431658f735">_name</a>.compare( other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a6c004456d5f594925d1c4a431658f735">_name</a> ) != 0 )
- <a name="l00147"></a>00147 <span class="keywordflow">return</span> <span class="keyword">false</span>;
- <a name="l00148"></a>00148
- <a name="l00149"></a>00149 std::vector<WSqlColumn>::const_iterator it;
- <a name="l00150"></a>00150 std::vector<WSqlColumn>::const_iterator ito = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin();
- <a name="l00151"></a>00151 <span class="keywordflow">for</span> ( it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin();it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.end();++it )
- <a name="l00152"></a>00152 {
- <a name="l00153"></a>00153 <span class="keywordflow">if</span> ( ito == other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.end() || *( it ) != *( ito ) )
- <a name="l00154"></a>00154 <span class="keywordflow">return</span> <span class="keyword">false</span>;
- <a name="l00155"></a>00155 <span class="keywordflow">else</span>
- <a name="l00156"></a>00156 ito++;
- <a name="l00157"></a>00157 }
- <a name="l00158"></a>00158 std::vector<WSqlForeignKey>::const_iterator fit;
- <a name="l00159"></a>00159 std::vector<WSqlForeignKey>::const_iterator fito = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.begin();
- <a name="l00160"></a>00160 <span class="keywordflow">for</span> ( fit = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.begin(); fit != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.end(); ++fit )
- <a name="l00161"></a>00161 {
- <a name="l00162"></a>00162 <span class="keywordflow">if</span> ( fito == other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.end() || *( fit ) != *( fito ) )
- <a name="l00163"></a>00163 <span class="keywordflow">return</span> <span class="keyword">false</span>;
- <a name="l00164"></a>00164 <span class="keywordflow">else</span>
- <a name="l00165"></a>00165 fito++;
- <a name="l00166"></a>00166 }
- <a name="l00167"></a>00167 std::vector<WSqlReferencedKey>::const_iterator rfit;
- <a name="l00168"></a>00168 std::vector<WSqlReferencedKey>::const_iterator rfito = other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.begin();
- <a name="l00169"></a>00169 <span class="keywordflow">for</span> ( rfit = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.begin();rfit != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.end();++rfit )
- <a name="l00170"></a>00170 {
- <a name="l00171"></a>00171 <span class="keywordflow">if</span> ( rfito == other.<a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.end() || *( rfit ) != *( rfito ) )
- <a name="l00172"></a>00172 <span class="keywordflow">return</span> <span class="keyword">false</span>;
- <a name="l00173"></a>00173 <span class="keywordflow">else</span>
- <a name="l00174"></a>00174 rfito++;
- <a name="l00175"></a>00175 }
- <a name="l00176"></a>00176 <span class="keywordflow">return</span> <span class="keyword">true</span>;
- <a name="l00177"></a>00177 }
- <a name="l00178"></a>00178
- <a name="l00183"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a32223945501143ee0d909a3dd83f8c2c">00183</a> <span class="keyword">const</span> std::string <a class="code" href="class_w_sql_1_1_w_sql_table.html#a32223945501143ee0d909a3dd83f8c2c">WSqlTable::columnName</a>( <span class="keywordtype">int</span> index )<span class="keyword"> const</span>
- <a name="l00184"></a>00184 <span class="keyword"></span>{
- <a name="l00185"></a>00185 std::string strToReturn;
- <a name="l00186"></a>00186 <span class="keywordtype">int</span> sz = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.size();
- <a name="l00187"></a>00187 <span class="keywordflow">if</span> ( !sz || index < 0 || index > sz - 1 )
- <a name="l00188"></a>00188 <span class="keywordflow">return</span> strToReturn;
- <a name="l00189"></a>00189 std::vector<WSqlColumn>::const_iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin();
- <a name="l00190"></a>00190 it += index;
- <a name="l00191"></a>00191 <span class="keywordflow">return</span> it->columnName();
- <a name="l00192"></a>00192 }
- <a name="l00193"></a>00193
- <a name="l00198"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a48122a3390e8d6938948707cee2b6ca7">00198</a> <a class="code" href="class_w_sql_1_1_w_sql_column.html" title="The WSqlColumn class represents a column in SQL database tables.">WSqlColumn</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a48122a3390e8d6938948707cee2b6ca7">WSqlTable::column</a>( <span class="keywordtype">int</span> index )<span class="keyword"> const</span>
- <a name="l00199"></a>00199 <span class="keyword"></span>{
- <a name="l00200"></a>00200 <a class="code" href="class_w_sql_1_1_w_sql_column.html" title="The WSqlColumn class represents a column in SQL database tables.">WSqlColumn</a> clmToReturn;
- <a name="l00201"></a>00201 <span class="keywordtype">int</span> sz = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.size();
- <a name="l00202"></a>00202 <span class="keywordflow">if</span> ( !sz || index < 0 || index > sz - 1 )
- <a name="l00203"></a>00203 <span class="keywordflow">return</span> clmToReturn;
- <a name="l00204"></a>00204 std::vector<WSqlColumn>::const_iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin();
- <a name="l00205"></a>00205 it += index;
- <a name="l00206"></a>00206 <span class="keywordflow">return</span> *it;
- <a name="l00207"></a>00207 }
- <a name="l00208"></a>00208
- <a name="l00213"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a5b08f94b4824dc08d2d46e19920c85bf">00213</a> <a class="code" href="class_w_sql_1_1_w_sql_column.html" title="The WSqlColumn class represents a column in SQL database tables.">WSqlColumn</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a48122a3390e8d6938948707cee2b6ca7">WSqlTable::column</a>( <span class="keyword">const</span> std::string &fldname )<span class="keyword"> const</span>
- <a name="l00214"></a>00214 <span class="keyword"></span>{
- <a name="l00215"></a>00215 <a class="code" href="class_w_sql_1_1_w_sql_column.html" title="The WSqlColumn class represents a column in SQL database tables.">WSqlColumn</a> clmToReturn;
- <a name="l00216"></a>00216 <span class="keywordflow">if</span> ( <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.empty() )
- <a name="l00217"></a>00217 <span class="keywordflow">return</span> clmToReturn;
- <a name="l00218"></a>00218
- <a name="l00219"></a>00219 std::vector<WSqlColumn>::const_iterator it;
- <a name="l00220"></a>00220 <span class="keywordflow">for</span> ( it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin(); it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.end(); ++it )
- <a name="l00221"></a>00221 {
- <a name="l00222"></a>00222 <span class="keywordflow">if</span> ( it->columnName().compare( fldname ) == 0 )
- <a name="l00223"></a>00223 {
- <a name="l00224"></a>00224 clmToReturn = *it;
- <a name="l00225"></a>00225 <span class="keywordflow">break</span>;
- <a name="l00226"></a>00226 }
- <a name="l00227"></a>00227 }
- <a name="l00228"></a>00228 <span class="keywordflow">return</span> clmToReturn;
- <a name="l00229"></a>00229 }
- <a name="l00230"></a>00230
- <a name="l00234"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#acfdf1961dd9401c8c6946a03d1da5651">00234</a> <span class="keyword">const</span> std::vector<WSqlColumn>& <a class="code" href="class_w_sql_1_1_w_sql_table.html#acfdf1961dd9401c8c6946a03d1da5651">WSqlTable::columns</a>()<span class="keyword"> const</span>
- <a name="l00235"></a>00235 <span class="keyword"></span>{
- <a name="l00236"></a>00236 <span class="keywordflow">return</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>;
- <a name="l00237"></a>00237 }
- <a name="l00241"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a3fd968486fd12d94984745b27f6089dc">00241</a> std::vector<std::string> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a3fd968486fd12d94984745b27f6089dc">WSqlTable::columnNames</a>()<span class="keyword"> const</span>
- <a name="l00242"></a>00242 <span class="keyword"></span>{
- <a name="l00243"></a>00243 std::vector<std::string> vecToReturn;
- <a name="l00244"></a>00244 std::vector<WSqlColumn>::const_iterator it;
- <a name="l00245"></a>00245 <span class="keywordflow">for</span> ( it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin(); it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.end(); ++it )
- <a name="l00246"></a>00246 vecToReturn.push_back( it->columnName() );
- <a name="l00247"></a>00247 <span class="keywordflow">return</span> vecToReturn;
- <a name="l00248"></a>00248 }
- <a name="l00249"></a>00249
- <a name="l00250"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a4c53fbdf178b24407b61cf15d7fe52a9">00250</a> <span class="keywordtype">int</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a4c53fbdf178b24407b61cf15d7fe52a9">WSqlTable::count</a>()<span class="keyword"> const</span>
- <a name="l00251"></a>00251 <span class="keyword"></span>{
- <a name="l00252"></a>00252 <span class="keywordflow">return</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.size();
- <a name="l00253"></a>00253 }
- <a name="l00254"></a>00254
- <a name="l00255"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#af45eb1210cd44aac73078589e6642214">00255</a> <span class="keywordtype">int</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#af45eb1210cd44aac73078589e6642214">WSqlTable::indexOf</a>( <span class="keyword">const</span> std::string &columnname )<span class="keyword"> const</span>
- <a name="l00256"></a>00256 <span class="keyword"></span>{
- <a name="l00257"></a>00257 <span class="keywordtype">int</span> intToReturn = -1;
- <a name="l00258"></a>00258 <span class="keywordflow">if</span> ( <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.empty() )
- <a name="l00259"></a>00259 <span class="keywordflow">return</span> intToReturn;
- <a name="l00260"></a>00260 <span class="keywordtype">int</span> i = 0;
- <a name="l00261"></a>00261 std::vector<WSqlColumn>::const_iterator it;
- <a name="l00262"></a>00262 <span class="keywordflow">for</span> ( it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin(); it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.end() ; ++it ) {
- <a name="l00263"></a>00263 <span class="keywordflow">if</span> ( it->columnName().compare( columnname ) == 0 ) {
- <a name="l00264"></a>00264 intToReturn = i;
- <a name="l00265"></a>00265 <span class="keywordflow">break</span>;
- <a name="l00266"></a>00266 }
- <a name="l00267"></a>00267 ++i;
- <a name="l00268"></a>00268 }
- <a name="l00269"></a>00269 <span class="keywordflow">return</span> intToReturn;
- <a name="l00270"></a>00270 }
- <a name="l00271"></a>00271
- <a name="l00272"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#aa1d6590c55861ff4cc5d8817b5514ccb">00272</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#aa1d6590c55861ff4cc5d8817b5514ccb">WSqlTable::append</a>( <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_column.html" title="The WSqlColumn class represents a column in SQL database tables.">WSqlColumn</a>& column )
- <a name="l00273"></a>00273 {
- <a name="l00274"></a>00274 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.push_back( column );
- <a name="l00275"></a>00275 }
- <a name="l00276"></a>00276
- <a name="l00277"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#adbe33d5ad790813796d6dc6002de9d87">00277</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#adbe33d5ad790813796d6dc6002de9d87">WSqlTable::replace</a>( <span class="keywordtype">int</span> pos, <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_column.html" title="The WSqlColumn class represents a column in SQL database tables.">WSqlColumn</a>& column )
- <a name="l00278"></a>00278 {
- <a name="l00279"></a>00279 <a class="code" href="class_w_sql_1_1_w_sql_table.html#ad097d7bca78b23a7c85426ddfa216579">insert</a>( pos, column, <span class="keyword">true</span> );
- <a name="l00280"></a>00280 }
- <a name="l00281"></a>00281
- <a name="l00282"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#ad097d7bca78b23a7c85426ddfa216579">00282</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#ad097d7bca78b23a7c85426ddfa216579">WSqlTable::insert</a>( <span class="keywordtype">int</span> pos, <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_column.html" title="The WSqlColumn class represents a column in SQL database tables.">WSqlColumn</a>& column, <span class="keywordtype">bool</span> replace )
- <a name="l00283"></a>00283 {
- <a name="l00284"></a>00284 <span class="keywordtype">int</span> sz = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.size();
- <a name="l00285"></a>00285 <span class="keywordflow">if</span> ( !sz || pos < 0 || pos > sz - 1 )
- <a name="l00286"></a>00286 <span class="keywordflow">return</span>;
- <a name="l00287"></a>00287 std::vector<WSqlColumn>::iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin();
- <a name="l00288"></a>00288 it += pos;
- <a name="l00289"></a>00289 <span class="keywordflow">if</span> ( replace )
- <a name="l00290"></a>00290 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.erase( it );
- <a name="l00291"></a>00291 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.insert( it, 1, column );
- <a name="l00292"></a>00292 }
- <a name="l00293"></a>00293
- <a name="l00294"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#aec573fab055de6512cfded111d3f5196">00294</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#aec573fab055de6512cfded111d3f5196">WSqlTable::remove</a>( <span class="keywordtype">int</span> pos )
- <a name="l00295"></a>00295 {
- <a name="l00296"></a>00296 <span class="keywordtype">int</span> sz = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.size();
- <a name="l00297"></a>00297 <span class="keywordflow">if</span> ( !sz || pos < 0 || pos > sz - 1 )
- <a name="l00298"></a>00298 <span class="keywordflow">return</span>;
- <a name="l00299"></a>00299 std::vector<WSqlColumn>::iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.begin();
- <a name="l00300"></a>00300 it += pos;
- <a name="l00301"></a>00301 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.erase( it );
- <a name="l00302"></a>00302 }
- <a name="l00303"></a>00303
- <a name="l00304"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a0fa57a9d078b8576783f40d2bba04570">00304</a> <span class="keywordtype">bool</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a0fa57a9d078b8576783f40d2bba04570">WSqlTable::isEmpty</a>()<span class="keyword"> const</span>
- <a name="l00305"></a>00305 <span class="keyword"></span>{
- <a name="l00306"></a>00306 <span class="keywordflow">return</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a5762583ffe7df901878b0a34db326cec">_columns</a>.empty();
- <a name="l00307"></a>00307 }
- <a name="l00308"></a>00308
- <a name="l00309"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#ae528a636ec431a6cb8ea53d62d2cb34c">00309</a> <a class="code" href="class_w_sql_1_1_w_sql_foreign_key.html" title="WSqlForeignKey provides an abstraction of a foreign key in a database.">WSqlForeignKey</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html#ae528a636ec431a6cb8ea53d62d2cb34c">WSqlTable::foreignKey</a>( <span class="keyword">const</span> std::string columnname )<span class="keyword"> const</span>
- <a name="l00310"></a>00310 <span class="keyword"></span>{
- <a name="l00311"></a>00311 std::vector<WSqlForeignKey>::const_iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.begin();
- <a name="l00312"></a>00312 <span class="keywordflow">for</span>(;it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.end(); ++it)
- <a name="l00313"></a>00313 {
- <a name="l00314"></a>00314 <span class="keywordflow">if</span> (it->columnName().compare(columnname) == 0)
- <a name="l00315"></a>00315 {
- <a name="l00316"></a>00316 <span class="keywordflow">return</span> *it;
- <a name="l00317"></a>00317 }
- <a name="l00318"></a>00318 }
- <a name="l00319"></a>00319 <span class="keywordflow">return</span> <a class="code" href="class_w_sql_1_1_w_sql_foreign_key.html" title="WSqlForeignKey provides an abstraction of a foreign key in a database.">WSqlForeignKey</a>();
- <a name="l00320"></a>00320 }
- <a name="l00321"></a>00321
- <a name="l00322"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#af064811df7146addf2045f083944a735">00322</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#af064811df7146addf2045f083944a735">WSqlTable::addForeignKey</a>( <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_foreign_key.html" title="WSqlForeignKey provides an abstraction of a foreign key in a database.">WSqlForeignKey</a>& fk )
- <a name="l00323"></a>00323 {
- <a name="l00324"></a>00324 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.push_back(fk);
- <a name="l00325"></a>00325 }
- <a name="l00326"></a>00326
- <a name="l00327"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a6376a1c1783991391d0ae0224e4e7279">00327</a> <span class="keyword">const</span> std::vector< WSqlForeignKey >& <a class="code" href="class_w_sql_1_1_w_sql_table.html#a6376a1c1783991391d0ae0224e4e7279">WSqlTable::foreignKeys</a>()<span class="keyword"> const</span>
- <a name="l00328"></a>00328 <span class="keyword"></span>{
- <a name="l00329"></a>00329 <span class="keywordflow">return</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>;
- <a name="l00330"></a>00330 }
- <a name="l00331"></a>00331
- <a name="l00332"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a8056ef9c6ac60b83e54a14e75bb1fe33">00332</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a8056ef9c6ac60b83e54a14e75bb1fe33">WSqlTable::removeForeignKey</a>( <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_foreign_key.html" title="WSqlForeignKey provides an abstraction of a foreign key in a database.">WSqlForeignKey</a>& fk )
- <a name="l00333"></a>00333 {
- <a name="l00334"></a>00334 std::vector<WSqlForeignKey>::iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.begin();
- <a name="l00335"></a>00335 <span class="keywordflow">for</span>(;it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.end(); ++it)
- <a name="l00336"></a>00336 {
- <a name="l00337"></a>00337 <span class="keywordflow">if</span> (*(it) == fk)
- <a name="l00338"></a>00338 {
- <a name="l00339"></a>00339 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.erase(it);
- <a name="l00340"></a>00340 <span class="keywordflow">break</span>;
- <a name="l00341"></a>00341 }
- <a name="l00342"></a>00342 }
- <a name="l00343"></a>00343 }
- <a name="l00344"></a>00344
- <a name="l00345"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a7cb940303afa44771fe88cf26a1aba99">00345</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a8056ef9c6ac60b83e54a14e75bb1fe33">WSqlTable::removeForeignKey</a>( <span class="keywordtype">int</span> pos )
- <a name="l00346"></a>00346 {
- <a name="l00347"></a>00347 <span class="keywordtype">int</span> sz = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.size();
- <a name="l00348"></a>00348 <span class="keywordflow">if</span> ( !sz || pos < 0 || pos > sz - 1 )
- <a name="l00349"></a>00349 <span class="keywordflow">return</span>;
- <a name="l00350"></a>00350 std::vector<WSqlForeignKey>::iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.begin();
- <a name="l00351"></a>00351 it += pos;
- <a name="l00352"></a>00352 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.erase( it );
- <a name="l00353"></a>00353 }
- <a name="l00354"></a>00354
- <a name="l00355"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a413d60fe5e437bb39691f34237e9b0c5">00355</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a8056ef9c6ac60b83e54a14e75bb1fe33">WSqlTable::removeForeignKey</a>( <span class="keyword">const</span> std::string& keyname )
- <a name="l00356"></a>00356 {
- <a name="l00357"></a>00357 <span class="keywordflow">if</span> ( <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.empty() )
- <a name="l00358"></a>00358 <span class="keywordflow">return</span>;
- <a name="l00359"></a>00359
- <a name="l00360"></a>00360 std::vector<WSqlForeignKey>::iterator it;
- <a name="l00361"></a>00361 <span class="keywordflow">for</span> ( it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.begin(); it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.end(); ++it )
- <a name="l00362"></a>00362 {
- <a name="l00363"></a>00363 <span class="keywordflow">if</span> ( it->keyName().compare( keyname ) == 0 )
- <a name="l00364"></a>00364 {
- <a name="l00365"></a>00365 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a59714e39906fd5d256bf4c69e90c1467">_foreignKeys</a>.erase(it);
- <a name="l00366"></a>00366 <span class="keywordflow">break</span>;
- <a name="l00367"></a>00367 }
- <a name="l00368"></a>00368 }
- <a name="l00369"></a>00369 }
- <a name="l00370"></a>00370
- <a name="l00371"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a55543a7a1dd2a3a03b23900aa18c1496">00371</a> <a class="code" href="class_w_sql_1_1_w_sql_referenced_key.html" title="WSqlReferencedKey provides an abstraction of a referenced column in a database.">WSqlReferencedKey</a> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a55543a7a1dd2a3a03b23900aa18c1496">WSqlTable::referencedKey</a>( <span class="keyword">const</span> std::string columnname )<span class="keyword"> const</span>
- <a name="l00372"></a>00372 <span class="keyword"></span>{
- <a name="l00373"></a>00373 std::vector<WSqlReferencedKey>::const_iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.begin();
- <a name="l00374"></a>00374 <span class="keywordflow">for</span>(;it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.end(); ++it)
- <a name="l00375"></a>00375 <span class="keywordflow">if</span> (it->columnName().compare(columnname) == 0)
- <a name="l00376"></a>00376 <span class="keywordflow">return</span> *it;
- <a name="l00377"></a>00377 <span class="keywordflow">return</span> <a class="code" href="class_w_sql_1_1_w_sql_referenced_key.html" title="WSqlReferencedKey provides an abstraction of a referenced column in a database.">WSqlReferencedKey</a>(<a class="code" href="class_w_sql_1_1_w_sql_foreign_key.html" title="WSqlForeignKey provides an abstraction of a foreign key in a database.">WSqlForeignKey</a>());
- <a name="l00378"></a>00378 }
- <a name="l00379"></a>00379
- <a name="l00380"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a57cf58dd712f9adfa7f98e395447b5ab">00380</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a57cf58dd712f9adfa7f98e395447b5ab">WSqlTable::addReferencedKey</a>( <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_referenced_key.html" title="WSqlReferencedKey provides an abstraction of a referenced column in a database.">WSqlReferencedKey</a>& fk )
- <a name="l00381"></a>00381 {
- <a name="l00382"></a>00382 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.push_back(fk);
- <a name="l00383"></a>00383 }
- <a name="l00384"></a>00384
- <a name="l00385"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#aeb424ef06d4e5978e861be12f3689fa5">00385</a> <span class="keyword">const</span> std::vector< WSqlReferencedKey >& <a class="code" href="class_w_sql_1_1_w_sql_table.html#aeb424ef06d4e5978e861be12f3689fa5">WSqlTable::referencedKeys</a>()<span class="keyword"> const</span>
- <a name="l00386"></a>00386 <span class="keyword"></span>{
- <a name="l00387"></a>00387 <span class="keywordflow">return</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>;
- <a name="l00388"></a>00388 }
- <a name="l00389"></a>00389
- <a name="l00390"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a48b2751a5ed33804724fdcc2e398a025">00390</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a48b2751a5ed33804724fdcc2e398a025">WSqlTable::removeReferencedKey</a>( <span class="keyword">const</span> <a class="code" href="class_w_sql_1_1_w_sql_referenced_key.html" title="WSqlReferencedKey provides an abstraction of a referenced column in a database.">WSqlReferencedKey</a>& rk )
- <a name="l00391"></a>00391 {
- <a name="l00392"></a>00392 std::vector<WSqlReferencedKey>::iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.begin();
- <a name="l00393"></a>00393 <span class="keywordflow">for</span>(;it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.end(); ++it)
- <a name="l00394"></a>00394 {
- <a name="l00395"></a>00395 <span class="keywordflow">if</span> (*(it) == rk)
- <a name="l00396"></a>00396 {
- <a name="l00397"></a>00397 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.erase(it);
- <a name="l00398"></a>00398 <span class="keywordflow">break</span>;
- <a name="l00399"></a>00399 }
- <a name="l00400"></a>00400 }
- <a name="l00401"></a>00401 }
- <a name="l00402"></a>00402
- <a name="l00403"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#ac57e044e68f4f1880ecd065dd8843b2b">00403</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a48b2751a5ed33804724fdcc2e398a025">WSqlTable::removeReferencedKey</a>( <span class="keywordtype">int</span> pos )
- <a name="l00404"></a>00404 {
- <a name="l00405"></a>00405 <span class="keywordtype">int</span> sz = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.size();
- <a name="l00406"></a>00406 <span class="keywordflow">if</span> ( !sz || pos < 0 || pos > sz - 1 )
- <a name="l00407"></a>00407 <span class="keywordflow">return</span>;
- <a name="l00408"></a>00408 std::vector<WSqlReferencedKey>::iterator it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.begin();
- <a name="l00409"></a>00409 it += pos;
- <a name="l00410"></a>00410 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.erase( it );
- <a name="l00411"></a>00411 }
- <a name="l00412"></a>00412
- <a name="l00413"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#a5ff7e8e8f47ee525b60164a7ee11266d">00413</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#a48b2751a5ed33804724fdcc2e398a025">WSqlTable::removeReferencedKey</a>( <span class="keyword">const</span> std::string& columnname )
- <a name="l00414"></a>00414 {
- <a name="l00415"></a>00415 <span class="keywordflow">if</span> ( <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.empty() )
- <a name="l00416"></a>00416 <span class="keywordflow">return</span>;
- <a name="l00417"></a>00417
- <a name="l00418"></a>00418 std::vector<WSqlReferencedKey>::iterator it;
- <a name="l00419"></a>00419 <span class="keywordflow">for</span> ( it = <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.begin(); it != <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.end(); ++it )
- <a name="l00420"></a>00420 {
- <a name="l00421"></a>00421 <span class="keywordflow">if</span> ( it->columnName().compare( columnname ) == 0 )
- <a name="l00422"></a>00422 {
- <a name="l00423"></a>00423 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a231f1d671cff04910b88f757a50276f2">_referencedKeys</a>.erase(it);
- <a name="l00424"></a>00424 <span class="keywordflow">break</span>;
- <a name="l00425"></a>00425 }
- <a name="l00426"></a>00426 }
- <a name="l00427"></a>00427 }
- <a name="l00428"></a>00428
- <a name="l00429"></a><a class="code" href="class_w_sql_1_1_w_sql_table.html#ae288e67b53c1a878556d18c02fa1682c">00429</a> <span class="keywordtype">void</span> <a class="code" href="class_w_sql_1_1_w_sql_table.html#ae288e67b53c1a878556d18c02fa1682c">WSqlTable::setName</a>( <span class="keyword">const</span> std::string& tablename )
- <a name="l00430"></a>00430 {
- <a name="l00431"></a>00431 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a6c004456d5f594925d1c4a431658f735">_name</a>=tablename;
- <a name="l00432"></a>00432 <a class="code" href="class_w_sql_1_1_w_sql_table.html#a417e8429a135b3c2583ac39e9fdacbfd">_className</a>=<a class="code" href="namespace_w_sql_1_1_w_sql_data_type.html#a7df7c11087d98b26ce4c09b03122a133" title="Returns a transformed table name as a class name.">WSqlDataType::tableNameToClass</a>(tablename);
- <a name="l00433"></a>00433 }
- <a name="l00434"></a>00434
- <a name="l00435"></a>00435 } <span class="comment">// namespace WSql</span>
- </pre></div></div>
- </div>
- <!--- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Defines</a></div>
-
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
-
- <hr class="footer"/><address class="footer"><small>Generated on Fri Nov 18 2011 21:01:45 for WORM by 
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
- </body>
- </html>
|