<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ICU 3.6: UnicodeReplacer Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.7 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li id="current"><a href="classes.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label> <u>S</u>earch for </label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul></div> <div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <li><a href="annotated.html"><span>Data Structures</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> <h1>UnicodeReplacer Class Reference</h1><!-- doxytag: class="UnicodeReplacer" --><code><a class="el" href="classUnicodeReplacer.html">UnicodeReplacer</a></code> defines a protocol for objects that replace a range of characters in a <a class="el" href="classReplaceable.html">Replaceable</a> string with output text. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="unirepl_8h-source.html">unirepl.h</a>></code> <p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnicodeReplacer.html#b2d8b15b5efa14c1cfab66f953f66080">~UnicodeReplacer</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#b2d8b15b5efa14c1cfab66f953f66080"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnicodeReplacer.html#8135aae67a8df6a78e6e381a0d62fab5">replace</a> (<a class="el" href="classReplaceable.html">Replaceable</a> &text, <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> start, <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> limit, <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> &cursor)=0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Replace characters in 'text' from 'start' to 'limit' with the output text of this object. <a href="#8135aae67a8df6a78e6e381a0d62fab5"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classUnicodeString.html">UnicodeString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnicodeReplacer.html#fb7bcb891b8efc09ee09fc63e36c66f3">toReplacerPattern</a> (<a class="el" href="classUnicodeString.html">UnicodeString</a> &result, <a class="el" href="umachine_8h.html#d373ce262c37cc047b0df2ad7b5dbba7">UBool</a> escapeUnprintable) const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a string representation of this replacer. <a href="#fb7bcb891b8efc09ee09fc63e36c66f3"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnicodeReplacer.html#ce51b8160460d6e58411e93ee1da6cbb">addReplacementSetTo</a> (<a class="el" href="classUnicodeSet.html">UnicodeSet</a> &toUnionTo) const =0</td></tr> <tr><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="#ce51b8160460d6e58411e93ee1da6cbb"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> <code><a class="el" href="classUnicodeReplacer.html">UnicodeReplacer</a></code> defines a protocol for objects that replace a range of characters in a <a class="el" href="classReplaceable.html">Replaceable</a> string with output text. <p> The replacement is done via the <a class="el" href="classReplaceable.html">Replaceable</a> API so as to preserve out-of-band data.<p> This is a mixin class. <dl compact><dt><b>Author:</b></dt><dd>Alan Liu </dd></dl> <dl compact><dt><b><a class="el" href="stable.html#_stable002931">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> <p> <p> Definition at line <a class="el" href="unirepl_8h-source.html#l00036">36</a> of file <a class="el" href="unirepl_8h-source.html">unirepl.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="b2d8b15b5efa14c1cfab66f953f66080"></a><!-- doxytag: member="UnicodeReplacer::~UnicodeReplacer" ref="b2d8b15b5efa14c1cfab66f953f66080" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual UnicodeReplacer::~UnicodeReplacer </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Destructor. <p> <dl compact><dt><b><a class="el" href="stable.html#_stable002932">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="ce51b8160460d6e58411e93ee1da6cbb"></a><!-- doxytag: member="UnicodeReplacer::addReplacementSetTo" ref="ce51b8160460d6e58411e93ee1da6cbb" args="(UnicodeSet &toUnionTo) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void UnicodeReplacer::addReplacementSetTo </td> <td>(</td> <td class="paramtype"><a class="el" href="classUnicodeSet.html">UnicodeSet</a> & </td> <td class="paramname"> <em>toUnionTo</em> </td> <td> ) </td> <td width="100%"> const<code> [pure virtual]</code></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 compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>toUnionTo</em> </td><td>the set into which to union the output characters </td></tr> </table> </dl> <dl compact><dt><b><a class="el" href="stable.html#_stable002935">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> </div> </div><p> <a class="anchor" name="8135aae67a8df6a78e6e381a0d62fab5"></a><!-- doxytag: member="UnicodeReplacer::replace" ref="8135aae67a8df6a78e6e381a0d62fab5" args="(Replaceable &text, int32_t start, int32_t limit, int32_t &cursor)=0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> UnicodeReplacer::replace </td> <td>(</td> <td class="paramtype"><a class="el" href="classReplaceable.html">Replaceable</a> & </td> <td class="paramname"> <em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> </td> <td class="paramname"> <em>start</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> </td> <td class="paramname"> <em>limit</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="pwin32_8h.html#f03f47ee300d26bee7dd521b1169f394">int32_t</a> & </td> <td class="paramname"> <em>cursor</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Replace characters in 'text' from 'start' to 'limit' with the output text of this object. <p> Update the 'cursor' parameter to give the cursor position and return the length of the replacement text.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>the text to be matched </td></tr> <tr><td valign="top"></td><td valign="top"><em>start</em> </td><td>inclusive start index of text to be replaced </td></tr> <tr><td valign="top"></td><td valign="top"><em>limit</em> </td><td>exclusive end index of text to be replaced; must be greater than or equal to start </td></tr> <tr><td valign="top"></td><td valign="top"><em>cursor</em> </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> </dl> <dl compact><dt><b>Returns:</b></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 compact><dt><b><a class="el" href="stable.html#_stable002933">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> </div> </div><p> <a class="anchor" name="fb7bcb891b8efc09ee09fc63e36c66f3"></a><!-- doxytag: member="UnicodeReplacer::toReplacerPattern" ref="fb7bcb891b8efc09ee09fc63e36c66f3" args="(UnicodeString &result, UBool escapeUnprintable) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classUnicodeString.html">UnicodeString</a>& UnicodeReplacer::toReplacerPattern </td> <td>(</td> <td class="paramtype"><a class="el" href="classUnicodeString.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#d373ce262c37cc047b0df2ad7b5dbba7">UBool</a> </td> <td class="paramname"> <em>escapeUnprintable</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Returns a string representation of this replacer. <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. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>result</em> </td><td>the string to receive the pattern. Previous contents will be deleted. </td></tr> <tr><td valign="top"></td><td valign="top"><em>escapeUnprintable</em> </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> </dl> <dl compact><dt><b>Returns:</b></dt><dd>a reference to 'result'. </dd></dl> <dl compact><dt><b><a class="el" href="stable.html#_stable002934">Stable:</a></b></dt><dd>ICU 2.4 </dd></dl> </div> </div><p> <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></ul> <hr size="1"><address style="align: right;"><small>Generated on Tue Dec 13 17:29:55 2011 for ICU 3.6 by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> </body> </html>