source: OGRE/trunk/ogrenew/Docs/api/html/OgreString_8h-source.html @ 657

Revision 657, 13.3 KB checked in by mattausch, 18 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1<html>
2<head>
3<title>OgreString.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
4<link type="text/css" rel="stylesheet" href="style.css">
5</head>
6
7<body>
8<!-- Generated by Doxygen 1.3.6 -->
9<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
10<h1>OgreString.h</h1><a href="OgreString_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
1100002 <span class="comment">-----------------------------------------------------------------------------</span>
1200003 <span class="comment">This source file is part of OGRE</span>
1300004 <span class="comment">    (Object-oriented Graphics Rendering Engine)</span>
1400005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span>
1500006 <span class="comment"></span>
1600007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span>
1700008 <span class="comment">Also see acknowledgements in Readme.html</span>
1800009 <span class="comment"></span>
1900010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span>
2000011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span>
2100012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span>
2200013 <span class="comment">version.</span>
2300014 <span class="comment"></span>
2400015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span>
2500016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
2600017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span>
2700018 <span class="comment"></span>
2800019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span>
2900020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span>
3000021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span>
3100022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span>
3200023 <span class="comment">-----------------------------------------------------------------------------</span>
3300024 <span class="comment">*/</span>
3400025 <span class="preprocessor">#ifndef _String_H__</span>
3500026 <span class="preprocessor"></span><span class="preprocessor">#define _String_H__</span>
3600027 <span class="preprocessor"></span>
3700028 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span>
3800029
3900030 <span class="comment">// If we're using the GCC 3.1 C++ Std lib</span>
4000031 <span class="preprocessor">#if OGRE_COMPILER == OGRE_COMPILER_GNUC &amp;&amp; OGRE_COMP_VER &gt;= 310</span>
4100032 <span class="preprocessor"></span>
4200033 <span class="preprocessor">#include &lt;ext/hash_map&gt;</span>
4300034 <span class="keyword">namespace </span>__gnu_cxx
4400035 {
4500036     <span class="keyword">template</span> &lt;&gt; <span class="keyword">struct </span>hash&lt; Ogre::<a class="code" href="namespaceOgre.html#a425">_StringBase</a> &gt;
4600037     {
4700038         size_t operator()( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a425">Ogre::_StringBase</a> _stringBase )<span class="keyword"> const </span>
4800039 <span class="keyword">        </span>{
4900040             <span class="comment">/* This is the PRO-STL way, but it seems to cause problems with VC7.1</span>
5000041 <span class="comment">               and in some other cases (although I can't recreate it)</span>
5100042 <span class="comment">            hash&lt;const char*&gt; H;</span>
5200043 <span class="comment">            return H(_stringBase.c_str());</span>
5300044 <span class="comment">            */</span>
5400046             <span class="keyword">register</span> size_t ret = 0;
5500047             <span class="keywordflow">for</span>( Ogre::_StringBase::const_iterator it = _stringBase.begin(); it != _stringBase.end(); ++it )
5600048                 ret = 5 * ret + *it;
5700049
5800050             <span class="keywordflow">return</span> ret;
5900051         }
6000052     };
6100053 }
6200054
6300055 <span class="comment">// If we're using plain vanilla VC7 Std lib</span>
6400056 <span class="preprocessor">#elif !defined( _STLP_HASH_FUN_H )</span>
6500057 <span class="preprocessor"></span>
6600058 <span class="preprocessor">#   if _DEFINE_DEPRECATED_HASH_CLASSES</span>
6700059 <span class="preprocessor"></span><span class="keyword">namespace </span>std
6800060 #   else
69<a name="l00061"></a><a class="code" href="namespacestdext.html">00061</a> namespace stdext
7000062 #   endif
7100063 {
72<a name="l00064"></a><a class="code" href="namespacestdext.html#a0">00064</a>     <span class="keyword">template</span>&lt;&gt; size_t hash_compare&lt; Ogre::_StringBase, std::less&lt; Ogre::_StringBase &gt; &gt;::operator ()( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a425">Ogre::_StringBase</a>&amp; _stringBase ) <span class="keyword">const</span>
7300065     {
7400066         <span class="comment">/* This is the PRO-STL way, but it seems to cause problems with VC7.1</span>
7500067 <span class="comment">            and in some other cases (although I can't recreate it)</span>
7600068 <span class="comment">        hash&lt;const char*&gt; H;</span>
7700069 <span class="comment">        return H(_stringBase.c_str());</span>
7800070 <span class="comment">        */</span>
7900072         <span class="keyword">register</span> size_t ret = 0;
8000073         <span class="keywordflow">for</span>( Ogre::_StringBase::const_iterator it = _stringBase.begin(); it != _stringBase.end(); ++it )
8100074             ret = 5 * ret + *it;
8200075
8300076         <span class="keywordflow">return</span> ret;
8400077     }
8500078 }
8600079
8700080 <span class="preprocessor">#endif</span>
8800081 <span class="preprocessor"></span>
8900082 <span class="keyword">namespace </span>Ogre {
9000083
91<a name="l00085"></a><a class="code" href="classOgre_1_1StringUtil.html">00085</a>     <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> StringUtil
9200086     {
9300087     <span class="keyword">public</span>:
94<a name="l00088"></a><a class="code" href="classOgre_1_1StringUtil.html#Ogre_1_1StringUtilw0">00088</a>         <span class="keyword">typedef</span> std::ostringstream <a class="code" href="classOgre_1_1StringUtil.html#Ogre_1_1StringUtilw0">StrStreamType</a>;
9500089
9600097         <span class="keyword">static</span> <span class="keywordtype">void</span> trim( <a class="code" href="namespaceOgre.html#a426">String</a>&amp; str, <span class="keywordtype">bool</span> left = <span class="keyword">true</span>, <span class="keywordtype">bool</span> right = <span class="keyword">true</span> );
9700098
9800107         <span class="keyword">static</span> std::vector&lt; String &gt; split( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; str, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; delims = <span class="stringliteral">"\t\n "</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxSplits = 0);
9900108
10000111         <span class="keyword">static</span> <span class="keywordtype">void</span> toLowerCase( <a class="code" href="namespaceOgre.html#a426">String</a>&amp; str );
10100112
10200115         <span class="keyword">static</span> <span class="keywordtype">void</span> toUpperCase( <a class="code" href="namespaceOgre.html#a426">String</a>&amp; str );
10300116
10400122         <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a420">Real</a> toReal( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; str );
10500123
10600129         <span class="keyword">static</span> <span class="keywordtype">bool</span> startsWith(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; str, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; pattern, <span class="keywordtype">bool</span> lowerCase = <span class="keyword">true</span>);
10700130
10800136         <span class="keyword">static</span> <span class="keywordtype">bool</span> endsWith(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; str, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; pattern, <span class="keywordtype">bool</span> lowerCase = <span class="keyword">true</span>);
10900137
11000140         <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a426">String</a> standardisePath( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a> &amp;init);
11100141
11200147         <span class="keyword">static</span> <span class="keywordtype">void</span> splitFilename(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; qualifiedName,
11300148             <a class="code" href="namespaceOgre.html#a426">String</a>&amp; outBasename, <a class="code" href="namespaceOgre.html#a426">String</a>&amp; outPath);
11400149
11500155         <span class="keyword">static</span> <span class="keywordtype">bool</span> match(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; str, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; pattern, <span class="keywordtype">bool</span> caseSensitive = <span class="keyword">true</span>);
11600156             
11700157
11800158
11900159
12000160
121<a name="l00162"></a><a class="code" href="classOgre_1_1StringUtil.html#Ogre_1_1StringUtils0">00162</a>         <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a> BLANK;
12200163     };
12300164
12400165
12500166 <span class="preprocessor">#if OGRE_COMPILER == OGRE_COMPILER_GNUC &amp;&amp; OGRE_COMP_VER &gt;= 310</span>
12600167 <span class="preprocessor"></span>    typedef ::__gnu_cxx::hash&lt; _StringBase &gt; <a class="code" href="namespaceOgre.html#a517">_StringHash</a>;   
12700168 <span class="preprocessor">#elif !defined( _STLP_HASH_FUN_H )</span>
12800169 <span class="preprocessor"></span><span class="preprocessor">#   if _DEFINE_DEPRECATED_HASH_CLASSES</span>
12900170 <span class="preprocessor"></span>        <span class="keyword">typedef</span> std::hash_compare&lt; _StringBase, std::less&lt; _StringBase &gt; &gt; <a class="code" href="namespaceOgre.html#a517">_StringHash</a>;
13000171 <span class="preprocessor">#   else</span>
131<a name="l00172"></a><a class="code" href="namespaceOgre.html#a517">00172</a> <span class="preprocessor"></span>        <span class="keyword">typedef</span> stdext::hash_compare&lt; _StringBase, std::less&lt; _StringBase &gt; &gt; <a class="code" href="namespaceOgre.html#a517">_StringHash</a>;
13200173 <span class="preprocessor">#   endif</span>
13300174 <span class="preprocessor"></span><span class="preprocessor">#else</span>
13400175 <span class="preprocessor"></span>    <span class="keyword">typedef</span> std::hash&lt; _StringBase &gt; <a class="code" href="namespaceOgre.html#a517">_StringHash</a>;
13500176 <span class="preprocessor">#endif</span>
13600177 <span class="preprocessor"></span>
13700178 } <span class="comment">// namespace Ogre</span>
13800179
13900180 <span class="preprocessor">#endif // _String_H__</span>
140</pre></div><hr>
141<p>
142Copyright &copy; 2000-2005 by The OGRE Team<br />
143<!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/>
144This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/>
145                <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
146                <Work rdf:about="">
147                        <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" />
148        <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
149                </Work>
150                <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> -->
151
152Last modified Sun Feb 12 12:59:53 2006
153</p>
154</body>
155</html>
Note: See TracBrowser for help on using the repository browser.