📄 group__text__parse__fns.htm
字号:
<!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>MiniGUI V1.6.10 API Reference: Text parsing functions</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.2 --><div class="qindex"><a class="qindex" href="index.htm">Main Page</a> | <a class="qindex" href="modules.htm">Modules</a> | <a class="qindex" href="classes.htm">Alphabetical List</a> | <a class="qindex" href="annotated.htm">Data Structures</a> | <a class="qindex" href="dirs.htm">Directories</a> | <a class="qindex" href="files.htm">File List</a> | <a class="qindex" href="functions.htm">Data Fields</a> | <a class="qindex" href="globals.htm">Globals</a> | <a class="qindex" href="pages.htm">Related Pages</a></div><h1>Text parsing functions<br><small>[<a class="el" href="group__gdi__fns.htm">GDI functions</a>]</small></h1><h2>Data Structures</h2><ul><li>struct <a class="el" href="struct__WORDINFO.htm">_WORDINFO</a></ul><h2>Defines</h2><ul><li>#define <a class="el" href="group__text__parse__fns.htm#ga10">MB2WC</a>(log_font, dest, mstr, n) MB2WCEx (log_font, dest, sizeof(wchar_t) == 4, mstr, n)<dl class="el"><dd class="mdescRight">The backward compatibility version of MB2WCEx. <a href="#ga10"></a><br></dl><li>#define <a class="el" href="group__text__parse__fns.htm#ga11">WC2MB</a>(log_font, s, wc) WC2MBEx (log_font, s, (UChar32)wc)<dl class="el"><dd class="mdescRight">The backward compatibility version of WC2MBEx. <a href="#ga11"></a><br></dl><li>#define <a class="el" href="group__text__parse__fns.htm#ga12">MBS2WCS</a>(log_font, dest, mstr, mstr_len, n)<dl class="el"><dd class="mdescRight">The backward compatibility version of MBS2WCSEx. <a href="#ga12"></a><br></dl><li>#define <a class="el" href="group__text__parse__fns.htm#ga13">WCS2MBS</a>(log_font, dest, wcs, wcs_len, n)<dl class="el"><dd class="mdescRight">The backward compatibility version of WCS2MBSEx. <a href="#ga13"></a><br></dl></ul><h2>Functions</h2><ul><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga0">GetTextMCharInfo</a> (<a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> log_font, const char *mstr, int len, int *pos_chars)<dl class="el"><dd class="mdescRight">Retrieves positions of multi-byte characters in a string. <a href="#ga0"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga1">GetTextWordInfo</a> (<a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> log_font, const char *mstr, int len, int *pos_words, <a class="el" href="struct__WORDINFO.htm">WORDINFO</a> *info_words)<dl class="el"><dd class="mdescRight">Retrieves information of multi-byte words in a string. <a href="#ga1"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga2">GetFirstMCharLen</a> (<a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> log_font, const char *mstr, int len)<dl class="el"><dd class="mdescRight">Retrieves the length of the first multi-byte character in a string. <a href="#ga2"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga3">GetFirstWord</a> (<a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> log_font, const char *mstr, int len, <a class="el" href="struct__WORDINFO.htm">WORDINFO</a> *word_info)<dl class="el"><dd class="mdescRight">Retrieves the length and info of the first multi-byte word in a string. <a href="#ga3"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga4">MB2WCEx</a> (<a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> log_font, void *dest, <a class="el" href="group__simple__types.htm#ga0">BOOL</a> wc32, const unsigned char *mstr, int n)<dl class="el"><dd class="mdescRight">Converts a multibyte character to a wide character in UCS according to the charset/encoding of the logical font. <a href="#ga4"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga5">WC2MBEx</a> (<a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> log_font, unsigned char *s, UChar32 wc)<dl class="el"><dd class="mdescRight">Converts a wide character in UCS to a multibyte character according to the charset/encoding of the logical font. <a href="#ga5"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga6">MBS2WCSEx</a> (<a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> log_font, void *dest, <a class="el" href="group__simple__types.htm#ga0">BOOL</a> wc32, const unsigned char *mstr, int mstr_len, int n, int *conved_mstr_len)<dl class="el"><dd class="mdescRight">Converts a multibyte string to a wide character string in UC16 according to the charset/encoding of the logical font. <a href="#ga6"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga7">WCS2MBSEx</a> (<a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> log_font, unsigned char *dest, const void *wcs, int wcs_len, <a class="el" href="group__simple__types.htm#ga0">BOOL</a> wc32, int n, int *conved_wcs_len)<dl class="el"><dd class="mdescRight">Converts a wide character string in UC16 to a multibyte string according to the charset/encoding of the logical font. <a href="#ga7"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga8">GetTextExtentPoint</a> (<a class="el" href="group__handles.htm#ga2">HDC</a> hdc, const char *text, int len, int max_extent, int *fit_chars, int *pos_chars, int *dx_chars, <a class="el" href="struct__SIZE.htm">SIZE</a> *size)<dl class="el"><dd class="mdescRight">Computes the extent of a string when output the string in a limited space. <a href="#ga8"></a><br></dl><li>MG_EXPORT int GUIAPI <a class="el" href="group__text__parse__fns.htm#ga9">GetTabbedTextExtentPoint</a> (<a class="el" href="group__handles.htm#ga2">HDC</a> hdc, const char *text, int len, int max_extent, int *fit_chars, int *pos_chars, int *dx_chars, <a class="el" href="struct__SIZE.htm">SIZE</a> *size)<dl class="el"><dd class="mdescRight">Computes the extent of a string when output the formatted string in a limited space. <a href="#ga9"></a><br></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>MiniGUI uses logical font to output text, also uses logical font to parsing the multi-byte characters and words in the text. <hr><h2>Define Documentation</h2><a class="anchor" name="ga10" doxytag="gdi.h::MB2WC"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define MB2WC </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">log_font, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>dest, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>mstr, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>n </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> MB2WCEx (log_font, dest, sizeof(wchar_t) == 4, mstr, n)</td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>The backward compatibility version of MB2WCEx. <p><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__text__parse__fns.htm#ga4">MB2WCEx</a> </dd></dl><p>Definition at line <a class="el" href="gdi_8h-source.htm#l06427">6427</a> of file <a class="el" href="gdi_8h-source.htm">gdi.h</a>. </td> </tr></table><a class="anchor" name="ga12" doxytag="gdi.h::MBS2WCS"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define MBS2WCS </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">log_font, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>dest, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>mstr, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>mstr_len, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>n </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="group__text__parse__fns.htm#ga6">MBS2WCSEx</a>(log_font, dest, <span class="keyword">sizeof</span> (<span class="keywordtype">wchar_t</span>) == 4, mstr, \ mstr_len, n, <a class="code" href="group__simple__types.htm#ga3">NULL</a>)</pre></div>The backward compatibility version of MBS2WCSEx. <p><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__text__parse__fns.htm#ga6">MBS2WCSEx</a> </dd></dl><p>Definition at line <a class="el" href="gdi_8h-source.htm#l06500">6500</a> of file <a class="el" href="gdi_8h-source.htm">gdi.h</a>. </td> </tr></table><a class="anchor" name="ga11" doxytag="gdi.h::WC2MB"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define WC2MB </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">log_font, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>s, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>wc </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> WC2MBEx (log_font, s, (UChar32)wc)</td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>The backward compatibility version of WC2MBEx. <p><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__text__parse__fns.htm#ga5">WC2MBEx</a> </dd></dl><p>Definition at line <a class="el" href="gdi_8h-source.htm#l06455">6455</a> of file <a class="el" href="gdi_8h-source.htm">gdi.h</a>. </td> </tr></table><a class="anchor" name="ga13" doxytag="gdi.h::WCS2MBS"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define WCS2MBS </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">log_font, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>dest, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>wcs, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>wcs_len, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>n </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p><b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="group__text__parse__fns.htm#ga7">WCS2MBSEx</a> (log_font, dest, wcs, wcs_len, <span class="keyword">sizeof</span> (<span class="keywordtype">wchar_t</span>) == 4, \ n, <a class="code" href="group__simple__types.htm#ga3">NULL</a>)</pre></div>The backward compatibility version of WCS2MBSEx. <p><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__text__parse__fns.htm#ga7">WCS2MBSEx</a> </dd></dl><p>Definition at line <a class="el" href="gdi_8h-source.htm#l06546">6546</a> of file <a class="el" href="gdi_8h-source.htm">gdi.h</a>. </td> </tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="ga2" doxytag="gdi.h::GetFirstMCharLen"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int GUIAPI GetFirstMCharLen </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> </td> <td class="mdname" nowrap> <em>log_font</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>mstr</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>len</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Retrieves the length of the first multi-byte character in a string. <p>This function retrieves and returns the length of the first multi-byte character in the string <em>mstr</em> which is <em>len</em> bytes long.<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>log_font</em> </td><td>The logical font used to parse the multi-byte string. </td></tr> <tr><td valign="top"></td><td valign="top"><em>mstr</em> </td><td>The multi-byte string. </td></tr> <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>The length of the string. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The length of the first multi-byte character.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__text__parse__fns.htm#ga3">GetFirstWord</a> </dd></dl> </td> </tr></table><a class="anchor" name="ga3" doxytag="gdi.h::GetFirstWord"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int GUIAPI GetFirstWord </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="struct__LOGFONT.htm">PLOGFONT</a> </td> <td class="mdname" nowrap> <em>log_font</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>mstr</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>len</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="struct__WORDINFO.htm">WORDINFO</a> * </td> <td class="mdname" nowrap> <em>word_info</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -