Files
mono/docs/sources/mono-api-string.html
T
Jonathan Pryor 9530c52568 * Makefile.am: Build docs after runtime, so that it can depend
upon mdoc.exe for it's operation.
	* docs/. (svn:ignore), deploy (svn:ignore): Ignore generated files.
	* docs/AgilityPack.dll, docs/api-style.css, docs/ChangeLog, docs/check,
	  docs/check-coverage, docs/convert.cs, docs/current-api, docs/deploy, 
	  docs/documented, docs/exdoc, docs/ignore, 
	  docs/mono-api-metadata.html, docs/monoapi.source, docs/produce-lists,
	  docs/public, docs/public-api, docs/README, docs/sources, 
	  docs/toc.xml, docs/TODO, docs/wapi: Copy from ../mono/docscripts.
	* docs/exdoc: Use the in-tree mono program to run convert.exe.
	* docs/Makefile.am: Mention files to clean/distribute; extract
	  documentation (with exdoc) and then assemble documentation (with
	  monoapi.make's assemble target) for use by monodoc.
	* docs/monoapi.make: Added; Makefile to use mcs' buid/rules.make to compile
	  convert.cs and assemble documentation.  (This is a separate file so
	  that we can include mcs' build/rules.make, which needs topdir set to
	  behave properly BUT must be $(mcs_topdir) from Makefile.am's
	  perspective.)
	* docs/monoapi.source: Add a /monodoc/node element for use with monodoc 2.2.

svn path=/trunk/mono/; revision=117529
2008-10-31 03:52:38 +00:00

90 lines
3.2 KiB
HTML

<h2>Strings</h2>
<p>Strings representation inside the Mono runtime.
<h3>Synopsis</h3>
<div class="header">
#include &lt;metadata/object.h&gt;
typedef struct {
MonoObject object;
gint32 length;
gunichar2 chars [0];
} MonoString;
@API_IDX@
</div>
<p>All of the operations on strings are done on pointers to
MonoString objects, like this:
<div class="code">
MonoString *hello = mono_string_new (mono_domain_get (), "hello, world");
</div>
<p>Strings are bound to a particular application domain, which
is why it is necessary to pass a MonoDomain argument as the
first parameter to all the constructor functions.
<p>Typically, you want to create the strings on the current
application domain, so a call to <tt>mono_domain_get()</tt> is
sufficient.
<h3>Constructors</h3>
<h4><a name="api:mono_string_new">mono_string_new</a></h4>
<h4><a name="api:mono_string_new_len">mono_string_new_len</a></h4>
<h4><a name="api:mono_string_new_size">mono_string_new_size</a></h4>
<h4><a name="api:mono_string_new_utf16">mono_string_new_utf16</a></h4>
<h4><a name="api:mono_string_from_utf16">mono_string_from_utf16</a></h4>
<h3>Conversions</h3>
<h4><a name="api:mono_string_to_byvalstr">mono_string_to_byvalstr</a></h4>
<h4><a name="api:mono_string_to_byvalwstr">mono_string_to_byvalwstr</a></h4>
<h4><a name="api:mono_string_to_utf16">mono_string_to_utf16</a></h4>
<h4><a name="api:mono_string_to_utf8">mono_string_to_utf8</a></h4>
<h4><a name="api:mono_string_utf16_to_builder">mono_string_utf16_to_builder</a></h4>
<h4><a name="api:mono_string_utf8_to_builder">mono_string_utf8_to_builder</a></h4>
<h3>Methods</h3>
<h4><a name="api:mono_string_equal">mono_string_equal</a></h4>
<h4><a name="api:mono_string_hash">mono_string_hash</a></h4>
<h4><a name="api:mono_string_intern">mono_string_intern</a></h4>
<h4><a name="api:mono_string_is_interned">mono_string_is_interned</a></h4>
<h4><a name="api:mono_string_new_wrapper">mono_string_new_wrapper</a></h4>
<h4><a name="api:mono_string_chars">mono_string_chars</a></h4>
<h4><a name="api:mono_string_length">mono_string_length</a></h4>
<h3>String Builders</h3>
<p>These routines are used to work with the managed types
<tt>System.Text.StringBuilder</tt>.
<h4><a name="api:mono_string_builder_to_utf16">mono_string_builder_to_utf16</a></h4>
<h4><a name="api:mono_string_builder_to_utf8">mono_string_builder_to_utf8</a></h4>
<h3>Other Encodings</h3>
<p>These routines are used when coping with strings that come
from Mono's environment, and might be encoded in one or more
of the external encodings.
<p>For example, some file systems might historically contain a
mix of file names with both old and new encodings, typically
UTF8 for new files, and the old files would be encoded in an 8
bit character set (ISO-8859-1 for example).
<p>These routines try a number of encodings, those specified
in the <tt>MONO_ENCODINGS</tt> environment variable and return
unicode strings that can be used internally.
<p>See the mono(1) man page for more details.
<h4><a name="api:mono_unicode_from_external">mono_unicode_from_external</a></h4>
<h4><a name="api:mono_unicode_to_external">mono_unicode_to_external</a></h4>
<h4><a name="api:mono_utf8_from_external">mono_utf8_from_external</a></h4>