PageRenderTime 27ms CodeModel.GetById 18ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

HTML | 54 lines | 53 code | 0 blank | 1 comment | 0 complexity | e0864a2fae281a00670319c75fd2bdea MD5 | raw file
 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
 3<title>AngelScript: string object (STL)</title>
 4<link href="tabs.css" rel="stylesheet" type="text/css">
 5<link href="doxygen.css" rel="stylesheet" type="text/css">
 7<!-- Generated by Doxygen 1.5.9 -->
 8<div class="contents">
 9<h1><a class="anchor" name="doc_addon_std_string">string object (STL) </a></h1><b>Path:</b> /sdk/add_on/scriptstdstring/<p>
10This add-on registers the <code>std::string</code> type as-is with AngelScript. This gives perfect compatibility with C++ functions that use <code>std::string</code> in parameters or as return type.<p>
11A potential drawback is that the <code>std::string</code> type is a value type, thus may increase the number of copies taken when string values are being passed around in the script code. However, this is most likely only a problem for scripts that perform a lot of string operations.<p>
12Register the type with <code>RegisterStdString(asIScriptEngine*)</code>.<p>
13<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="doc_addon_string.html">string object (reference counted)</a></dd></dl>
14<h2><a class="anchor" name="doc_addon_std_string_1">
15Public C++ interface</a></h2>
16Refer to the <code>std::string</code> implementation for your compiler.<h2><a class="anchor" name="doc_addon_std_string_2">
17Public script interface</a></h2>
19  class string
20  {
21    // Constructors
22    string();</pre><p>
23<pre>    // Returns the length of the string
24    uint length() const;</pre><p>
25<pre>    // Assignment and concatenation
26    string &amp;opAssign(const string &amp;in other);
27    string &amp;opAddAssign(const string &amp;in other);
28    string  opAdd(const string &amp;in right) const;</pre><p>
29<pre>    // Access individual characters
30    // uint8 &amp;operator [] (uint)
31    // const uint8 &amp;operator [] (uint) const</pre><p>
32<pre>    // Comparison operators
33    bool opEquals(const string &amp;in right) const;
34    int  opCmp(const string &amp;in right) const;</pre><p>
35<pre>    // Automatic conversion from number types to string type
36    string &amp;opAssign(double val);
37    string &amp;opAddAssign(double val);
38    string  opAdd(double val) const;
39    string  opAdd_r(double val) const;</pre><p>
40<pre>    string &amp;opAssign(int val);
41    string &amp;opAddAssign(int val);
42    string  opAdd(int val) const;
43    string  opAdd_r(int val) const;</pre><p>
44<pre>    string &amp;opAssign(uint val);
45    string &amp;opAddAssign(uint val);
46    string  opAdd(uint val) const;
47    string  opAdd_r(uint val) const;
48  }
49</pre> </div>
50<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 16 19:34:50 2009 for AngelScript by&nbsp;
51<a href="">
52<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>