📄 ziglet_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>ziglet.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>ziglet.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> ZIG - An extendable, portable game engine focused on networking & scripting</span>00003 <span class="comment"> Project Home: http://zige.sourceforge.net</span>00004 <span class="comment"> Copyright (C) 2002 F醔io Reis Cecin <fcecin AT inf DOT ufrgs DOT br></span>00005 <span class="comment"></span>00006 <span class="comment"> This library is free software; you can redistribute it and/or</span>00007 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>00008 <span class="comment"> License as published by the Free Software Foundation; either</span>00009 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>00010 <span class="comment"></span>00011 <span class="comment"> This library is distributed in the hope that it will be useful,</span>00012 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>00013 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>00014 <span class="comment"> Lesser General Public License for more details.</span>00015 <span class="comment"></span>00016 <span class="comment"> You should have received a copy of the GNU Lesser General Public</span>00017 <span class="comment"> License along with this library; if not, write to the Free Software</span>00018 <span class="comment"> Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA </span>00019 <span class="comment">*/</span>00020 00021 <span class="preprocessor">#ifndef _ZIG_HEADER_ZIGLET_H_</span>00022 <span class="preprocessor"></span><span class="preprocessor">#define _ZIG_HEADER_ZIGLET_H_</span>00023 <span class="preprocessor"></span>00024 <span class="preprocessor">#include "<a class="code" href="zig_8h.html">zig.h</a>"</span>00025 <span class="preprocessor">#include "zigletcomp.h"</span>00026 <span class="preprocessor">#include "console.h"</span>00027 00028 <span class="preprocessor">#include <string></span>00029 <span class="preprocessor">#include <map></span>00030 <span class="preprocessor">#include <vector></span>00031 <span class="comment">//using namespace std;</span>00032 00033 <span class="keyword">class </span><a class="code" href="classziglet__manager__c.html">ziglet_manager_c</a>;00034 <a name="l00036"></a><a class="code" href="classziglet__c.html">00036</a> <span class="keyword">class </span><a class="code" href="classziglet__c.html">ziglet_c</a> {00037 <span class="keyword">public</span>:00038 00039 <span class="comment">//ctor - associated with a ziglet manager, a name, and a root path</span>00040 <span class="comment">//example: name="mydir" path="c:\ziglets\" points to a ziglet made of the files in "c:\ziglets\mydir\*.*"</span>00041 <a class="code" href="classziglet__c.html#a1">ziglet_c</a>(<a class="code" href="classconsole__c.html">console_c</a> *conio, <a class="code" href="classziglet__manager__c.html">ziglet_manager_c</a> *man, std::string name, std::string path);00042 00044 <a class="code" href="classziglet__c.html#a1">ziglet_c</a>(<span class="keyword">const</span> <a class="code" href="classziglet__c.html">ziglet_c</a> &z);00045 00046 <span class="comment">//dtor</span>00047 <span class="keyword">virtual</span> ~<a class="code" href="classziglet__c.html">ziglet_c</a>();00048 <a name="l00050"></a><a class="code" href="classziglet__c.html#a3">00050</a> <span class="keywordtype">void</span> <a class="code" href="classziglet__c.html#a3">update</a>() { <a class="code" href="classziglet__c.html#a4">update_version_list</a>(); <a class="code" href="classziglet__c.html#a14">update_file_list</a>(); }00051 00053 <span class="keywordtype">void</span> <a class="code" href="classziglet__c.html#a4">update_version_list</a>();00054 00059 <span class="keywordtype">bool</span> <a class="code" href="classziglet__c.html#a5">select_version</a>(std::string ver);00060 00063 std::vector<std::string> <a class="code" href="classziglet__c.html#a6">get_versions</a>();00064 <a name="l00067"></a><a class="code" href="classziglet__c.html#a7">00067</a> std::string <a class="code" href="classziglet__c.html#a7">get_version</a>() { <span class="keywordflow">return</span> version; }00068 00071 <span class="keywordtype">bool</span> <a class="code" href="classziglet__c.html#a8">create_version</a>(std::string ver);00072 00075 <span class="keywordtype">bool</span> <a class="code" href="classziglet__c.html#a9">delete_version</a>(std::string ver);00076 <a name="l00079"></a><a class="code" href="classziglet__c.html#a10">00079</a> std::string <a class="code" href="classziglet__c.html#a10">get_prefix</a>() { <span class="keywordflow">return</span> com_path; }00080 00083 <span class="comment">//OBS: this works ok with multiple folders because this is taken from the pre-calculated map!</span>00084 <a class="code" href="classziglet__component__c.html">ziglet_component_c</a> *<a class="code" href="classziglet__c.html#a11">find</a>(std::string name);00085 00088 <span class="comment">//OBS: this works ok with multiple folders because this is taken from the pre-calculated map!</span>00089 <a class="code" href="classziglet__component__c.html">ziglet_component_c</a> *<a class="code" href="classziglet__c.html#a12">get_first</a>();00090 00093 <span class="comment">//OBS: this works ok with multiple folders because this is taken from the pre-calculated map!</span>00094 <a class="code" href="classziglet__component__c.html">ziglet_component_c</a> *<a class="code" href="classziglet__c.html#a13">get_next</a>();00095 00100 <span class="keywordtype">void</span> <a class="code" href="classziglet__c.html#a14">update_file_list</a>();00101 <a name="l00103"></a><a class="code" href="classziglet__c.html#a15">00103</a> std::string <a class="code" href="classziglet__c.html#a15">get_name</a>() { <span class="keywordflow">return</span> name; }00104 00105 <span class="comment">//remove flag - only for ziglet_manager_c::scan()</span>00106 <span class="keywordtype">bool</span> remove;00107 00108 <span class="keyword">protected</span>:00109 00110 <span class="comment">//manager</span>00111 <a class="code" href="classziglet__manager__c.html">ziglet_manager_c</a> *man;00112 00113 <span class="comment">/*</span>00114 <span class="comment"> my name, my path, and my component's path</span>00115 <span class="comment"> example:</span>00116 <span class="comment"> c:\ziglets\myziglet\mycomponent.file</span>00117 <span class="comment"> NAME = myziglet</span>00118 <span class="comment"> PATH = c:\ziglets\</span>00119 <span class="comment"> COM_PATH = c:\ziglets\myziglet\ //note the trailing slash that was manufactured..*/</span>00120 std::string name, path, com_path;00121 00122 <span class="comment">//currently selected version. will be "" if no version is available.</span>00123 std::string version;00124 00125 <span class="comment">//index of the currently selected "version" in the "versions" vector</span>00126 <span class="keywordtype">int</span> version_index;00127 00128 <span class="comment">//all available versions, ordered from most recent to oldest</span>00129 std::vector<std::string> versions;00130 00131 <span class="comment">//iterator for find methods</span>00132 std::map<std::string, ziglet_component_c*>::iterator findit;00133 00134 <span class="comment">//file list, file name (file+extension) ---> component(file wrapper)></span>00135 <span class="comment">//</span>00136 <span class="comment">// FIXED : was BROKEN</span>00137 <span class="comment">// in the .cpp, returning pointer to object inside the map!</span>00138 <span class="comment">//</span>00139 <span class="comment">// changing from ziglet_component_c to ziglet_component_c*</span>00140 <span class="comment">//</span>00141 std::map<std::string, ziglet_component_c*> files;00142 00143 <a class="code" href="classconsole__c.html">console_c</a> *con;00144 00145 <span class="keyword">private</span>:00146 00147 <a class="code" href="classziglet__c.html">ziglet_c</a>& operator=(<span class="keyword">const</span> <a class="code" href="classziglet__c.html">ziglet_c</a>&); 00148 };00149 00150 <span class="preprocessor">#endif</span>00151 <span class="preprocessor"></span></pre></div><hr><address style="align: right;"><small>Generated on Mon Jan 24 21:14:23 2005 for ZIG by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -