<?php $isip_window_title = "ISIP Homepage"; ?>
<?php include("/data/isip/www/templates/documentation/header/header.html"); ?>

<!--#set var="isip_page_title" value="String" -->
<?php include("/data/isip/www/templates/documentation/body/index_class.html"); ?>
<?php include("/data/isip/www/templates/documentation/body/bar.html"); ?>

<a name="name">
<b>name: <a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h">String</a> : public <a href="../../../system/SysString/index.html">SysString</a></b>

<br><br>

<a name="synopsis">
<b>synopsis:</b>
<br> <br>

<blockquote>
<pre>
g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_math_scalar.a

#include &lt;String.h&gt;

String(unichar* arg = DEF_VALUE);
String(const String& arg);
</pre>
</blockquote>

<a name="quick_start">
<b>quick start:</b>
<br><br>

<blockquote>
<pre>
String val0(L"hello, world");
String num0;
String num1;
String num2;
String num3;
Long scalar_long;
Double Scalar_double;

scalar_long.assign((long)43);
num0.assign(scalar_long);
scalar_long.get(num1);

Double scalar_double;
scalar_double.assign((double)43.0);
num2.assign(scalar_double);
scalar_double.get(num3);
</pre>
</blockquote>

<a name="description"> 
<b>description:</b>
<br><br>

The String class is needed to extend the SysString class with i/o and
scalar conversion methods.  SysString is a low order class,
below i/o, and String is a higher order class that is built on both
the SysString and i/o classes.

<br><br>

<a name="dependencies">
<b>dependencies:</b>
<br><br>

<ul>
  <li> <a href="../../../system/SysString/index.html">SysString</a>
  <li> <a href="../../../io/SofParser/index.html">SofParser</a>
  <li> <a href="../../../system/MemoryManager/index.html">MemoryManager</a>
</ul>

<a name="constants">
<b>public constants:</b>
<br><br>

<ul>
  <li> define the class name:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_00.cc&constant=CLASS_NAME">static const String CLASS_NAME = L"String";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_00.cc&constant=EMPTY">static const String EMPTY = L"";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_00.cc&constant=DEF_PARAM">static const String DEF_PARAM = L"value";</a></pre>
       <pre>DEF_CAPACITY and DEF_VALUE are inherited from the <a href="../../../system/SysString/index.html#constants">SysString</a> class</pre>
</ul>

<a name="error">
<b>error codes:</b>
<br><br>

<ul>
  <li> error code indicating console class general error:
       
       <pre><a href="/perl/ifc_document.pl?err=00021200">static const long ERR = 21200;</a></pre>
</ul>

<a name="protected">
<b>protected data:</b>
<br><br>

<ul>
  <li> static memory manager:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_00.cc&static=mgr_d">static MemoryManager mgr_d;</a></pre>
</ul>

<a name="public">
<b>required public methods:</b>
<br><br>

<ul>
  <li> static methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=name">static const String& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_02.cc&method=diagnose">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>

  <li> debug methods:
       
       <pre>setDebug is inherited from the <a href="../../../system/SysString/index.html#public:debug">SysString</a> class</pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_01.cc&method=debug">boolean debug(const unichar* message) const;</a></pre>

  <li> destructor/constructor(s):
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=destructor">~String();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=default constructor">String(long arg = DEF_CAPACITY);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=copy constructor">String(const String& arg);</a></pre>
       
  <li> assign methods:
       
     <pre>assign methods are inherited from the <a href="../../../system/SysString/index.html#public:assign">SysString</a> class</pre>

  <li> operator= methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=operator%3D&instance=0">String& operator= (const String& arg);</a></pre>
            
  <li> i/o methods:
     
     <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=sofSize">long sofSize() const;</a></pre>
     <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_03.cc&method=read">boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);</a></pre>
     <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_04.cc&method=write">boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_03.cc&method=readData">boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);</a></pre>
     <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_04.cc&method=writeData">boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;</a></pre>
     
  <li> equality methods:
       
       <pre>equality methods are inherited from the <a href="../../../system/SysString/index.html#public:equality">SysString</a> class</pre>
       
  <li> memory management methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=new">static void* operator new(size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=new[]">static void* operator new[](size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=delete">static void operator delete(void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=delete[]">static void operator delete[](void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=setGrowSize">static boolean setGrowSize(long grow_size);</a></pre>
       <pre>clear is inherited from the SysString class</pre>
</ul>

<a name="specific">
<b>class-specific public methods:</b>
<br><br>

<ul>
  <li> constructors:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=String">String(const unichar* arg);</a></pre>
       
  <li> random alphanumeric string generation methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_05.cc">boolean rand(long max_len = MAX_LENGTH, long min_len = 0);</a></pre>
       
  <li> method to get an empty string:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/String.h&method=getEmptyString">static const String& getEmptyString();</a></pre>

  <li> method to obtain a hash of the String value

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/String/str_05.cc&method=hash">long hash(long capacity) const;</a></pre>

</ul>

<a name="private">
<b>private methods:</b>
<br><br>
       
<ul>
  <li> none.
</ul>

<a name="examples">
<b>examples:</b>
<br><br>

<ul>
  <li> This example shows how to write a String object into a Sof file:
       
<pre>
String str((unichar*)L"hello, world");
String tmp_filename(L"foo");
Sof tmp_file;
tmp_file.open(tmp_filename, File::WRITE_ONLY, File::TEXT);
       
str.write(tmp_file, (long)0);
tmp_file.close();</pre>
</ul>

<a name="notes">
<b>notes:</b>
<br><br>

<ul>
  <li> none.
</ul>

<!--#include virtual="/hse/ies/templates/documentation/footer/footer.html" -->
