<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>ICU 58.2: icu::UnicodeReplacer Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">ICU 58.2  <span id="projectnumber">58.2</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="classes.html"><span>Data Structure Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceicu.html">icu</a></li><li class="navelem"><a class="el" href="classicu_1_1UnicodeReplacer.html">UnicodeReplacer</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">icu::UnicodeReplacer Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div> </div><!--header--> <div class="contents"> <p><code><a class="el" href="classicu_1_1UnicodeReplacer.html" title="UnicodeReplacer defines a protocol for objects that replace a range of characters in a Replaceable st...">UnicodeReplacer</a></code> defines a protocol for objects that replace a range of characters in a <a class="el" href="classicu_1_1Replaceable.html" title="Replaceable is an abstract base class representing a string of characters that supports the replaceme...">Replaceable</a> string with output text. <a href="classicu_1_1UnicodeReplacer.html#details">More...</a></p> <p><code>#include <<a class="el" href="unirepl_8h_source.html">unirepl.h</a>></code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ab465a04d221a875fe7d4d1ee80bbcdb9"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UnicodeReplacer.html#ab465a04d221a875fe7d4d1ee80bbcdb9">~UnicodeReplacer</a> ()</td></tr> <tr class="memdesc:ab465a04d221a875fe7d4d1ee80bbcdb9"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#ab465a04d221a875fe7d4d1ee80bbcdb9">More...</a><br /></td></tr> <tr class="separator:ab465a04d221a875fe7d4d1ee80bbcdb9"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a31b33c6dfa5d896fb38c29ab10e39661"><td class="memItemLeft" align="right" valign="top">virtual int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UnicodeReplacer.html#a31b33c6dfa5d896fb38c29ab10e39661">replace</a> (<a class="el" href="classicu_1_1Replaceable.html">Replaceable</a> &text, int32_t start, int32_t limit, int32_t &cursor)=0</td></tr> <tr class="memdesc:a31b33c6dfa5d896fb38c29ab10e39661"><td class="mdescLeft"> </td><td class="mdescRight">Replace characters in 'text' from 'start' to 'limit' with the output text of this object. <a href="#a31b33c6dfa5d896fb38c29ab10e39661">More...</a><br /></td></tr> <tr class="separator:a31b33c6dfa5d896fb38c29ab10e39661"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab9786ae33a9a220ff356a875c4ff9b92"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UnicodeReplacer.html#ab9786ae33a9a220ff356a875c4ff9b92">toReplacerPattern</a> (<a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &result, <a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> escapeUnprintable) const =0</td></tr> <tr class="memdesc:ab9786ae33a9a220ff356a875c4ff9b92"><td class="mdescLeft"> </td><td class="mdescRight">Returns a string representation of this replacer. <a href="#ab9786ae33a9a220ff356a875c4ff9b92">More...</a><br /></td></tr> <tr class="separator:ab9786ae33a9a220ff356a875c4ff9b92"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0c068a88d43c0e209a4118ec34a3611c"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UnicodeReplacer.html#a0c068a88d43c0e209a4118ec34a3611c">addReplacementSetTo</a> (<a class="el" href="classicu_1_1UnicodeSet.html">UnicodeSet</a> &toUnionTo) const =0</td></tr> <tr class="memdesc:a0c068a88d43c0e209a4118ec34a3611c"><td class="mdescLeft"> </td><td class="mdescRight">Union the set of all characters that may output by this object into the given set. <a href="#a0c068a88d43c0e209a4118ec34a3611c">More...</a><br /></td></tr> <tr class="separator:a0c068a88d43c0e209a4118ec34a3611c"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p><code><a class="el" href="classicu_1_1UnicodeReplacer.html" title="UnicodeReplacer defines a protocol for objects that replace a range of characters in a Replaceable st...">UnicodeReplacer</a></code> defines a protocol for objects that replace a range of characters in a <a class="el" href="classicu_1_1Replaceable.html" title="Replaceable is an abstract base class representing a string of characters that supports the replaceme...">Replaceable</a> string with output text. </p> <p>The replacement is done via the <a class="el" href="classicu_1_1Replaceable.html" title="Replaceable is an abstract base class representing a string of characters that supports the replaceme...">Replaceable</a> API so as to preserve out-of-band data.</p> <p>This is a mixin class. </p><dl class="section author"><dt>Author</dt><dd>Alan Liu </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable005278">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> <p>Definition at line <a class="el" href="unirepl_8h_source.html#l00038">38</a> of file <a class="el" href="unirepl_8h_source.html">unirepl.h</a>.</p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a class="anchor" id="ab465a04d221a875fe7d4d1ee80bbcdb9"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual icu::UnicodeReplacer::~UnicodeReplacer </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable005279">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a0c068a88d43c0e209a4118ec34a3611c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void icu::UnicodeReplacer::addReplacementSetTo </td> <td>(</td> <td class="paramtype"><a class="el" href="classicu_1_1UnicodeSet.html">UnicodeSet</a> & </td> <td class="paramname"><em>toUnionTo</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Union the set of all characters that may output by this object into the given set. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">toUnionTo</td><td>the set into which to union the output characters </td></tr> </table> </dd> </dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable005282">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> </div> </div> <a class="anchor" id="a31b33c6dfa5d896fb38c29ab10e39661"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual int32_t icu::UnicodeReplacer::replace </td> <td>(</td> <td class="paramtype"><a class="el" href="classicu_1_1Replaceable.html">Replaceable</a> & </td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>start</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>limit</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t & </td> <td class="paramname"><em>cursor</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Replace characters in 'text' from 'start' to 'limit' with the output text of this object. </p> <p>Update the 'cursor' parameter to give the cursor position and return the length of the replacement text.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">text</td><td>the text to be matched </td></tr> <tr><td class="paramname">start</td><td>inclusive start index of text to be replaced </td></tr> <tr><td class="paramname">limit</td><td>exclusive end index of text to be replaced; must be greater than or equal to start </td></tr> <tr><td class="paramname">cursor</td><td>output parameter for the cursor position. Not all replacer objects will update this, but in a complete tree of replacer objects, representing the entire output side of a transliteration rule, at least one must update it. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the number of 16-bit code units in the text replacing the characters at offsets start..(limit-1) in text </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable005280">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> </div> </div> <a class="anchor" id="ab9786ae33a9a220ff356a875c4ff9b92"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a>& icu::UnicodeReplacer::toReplacerPattern </td> <td>(</td> <td class="paramtype"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> & </td> <td class="paramname"><em>result</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> </td> <td class="paramname"><em>escapeUnprintable</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a string representation of this replacer. </p> <p>If the result of calling this function is passed to the appropriate parser, typically TransliteratorParser, it will produce another replacer that is equal to this one. </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">result</td><td>the string to receive the pattern. Previous contents will be deleted. </td></tr> <tr><td class="paramname">escapeUnprintable</td><td>if TRUE then convert unprintable character to their hex escape representations, \uxxxx or \Uxxxxxxxx. Unprintable characters are defined by Utility.isUnprintable(). </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>a reference to 'result'. </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable005281">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="unirepl_8h_source.html">unirepl.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>