blob: e5a20cb7378a26e9a73b9224c9e0f03c4ca87b5d [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Crashpad: crashpad::internal::MinidumpWriterUtil 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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="crashpad_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">Crashpad
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacecrashpad.html">crashpad</a></li><li class="navelem"><a class="el" href="namespacecrashpad_1_1internal.html">internal</a></li><li class="navelem"><a class="el" href="classcrashpad_1_1internal_1_1MinidumpWriterUtil.html">MinidumpWriterUtil</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classcrashpad_1_1internal_1_1MinidumpWriterUtil-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">crashpad::internal::MinidumpWriterUtil Class Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>A collection of utility functions used by the <a class="el" href="classcrashpad_1_1internal_1_1MinidumpWritable.html" title="The base class for all content that might be written to a minidump file.">MinidumpWritable</a> family of classes.
<a href="classcrashpad_1_1internal_1_1MinidumpWriterUtil.html#details">More...</a></p>
<p><code>#include &quot;minidump/minidump_writer_util.h&quot;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:adf79feb4d657af5606d77a040b80c0a3"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1internal_1_1MinidumpWriterUtil.html#adf79feb4d657af5606d77a040b80c0a3">AssignTimeT</a> (uint32_t *destination, time_t source)</td></tr>
<tr class="memdesc:adf79feb4d657af5606d77a040b80c0a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assigns a <code>time_t</code> value, logging a warning if the result overflows the destination buffer and will be truncated. <a href="classcrashpad_1_1internal_1_1MinidumpWriterUtil.html#adf79feb4d657af5606d77a040b80c0a3">More...</a><br /></td></tr>
<tr class="separator:adf79feb4d657af5606d77a040b80c0a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61b0a78e6ca458d986024a21d94ca70b"><td class="memItemLeft" align="right" valign="top">static base::string16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1internal_1_1MinidumpWriterUtil.html#a61b0a78e6ca458d986024a21d94ca70b">ConvertUTF8ToUTF16</a> (const std::string &amp;utf8)</td></tr>
<tr class="memdesc:a61b0a78e6ca458d986024a21d94ca70b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts a UTF-8 string to UTF-16 and returns it. If the string cannot be converted losslessly, indicating that the input is not well-formed UTF-8, a warning is logged. <a href="classcrashpad_1_1internal_1_1MinidumpWriterUtil.html#a61b0a78e6ca458d986024a21d94ca70b">More...</a><br /></td></tr>
<tr class="separator:a61b0a78e6ca458d986024a21d94ca70b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8050fbfd03eaf9c799001d37f417adec"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1internal_1_1MinidumpWriterUtil.html#a8050fbfd03eaf9c799001d37f417adec">AssignUTF8ToUTF16</a> (base::char16 *destination, size_t destination_size, const std::string &amp;source)</td></tr>
<tr class="memdesc:a8050fbfd03eaf9c799001d37f417adec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts a UTF-8 string to UTF-16 and places it into a buffer of fixed size, taking care to <code>NUL</code>-terminate the buffer and not to overflow it. If the string will be truncated or if it cannot be converted losslessly, a warning is logged. <a href="classcrashpad_1_1internal_1_1MinidumpWriterUtil.html#a8050fbfd03eaf9c799001d37f417adec">More...</a><br /></td></tr>
<tr class="separator:a8050fbfd03eaf9c799001d37f417adec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A collection of utility functions used by the <a class="el" href="classcrashpad_1_1internal_1_1MinidumpWritable.html" title="The base class for all content that might be written to a minidump file.">MinidumpWritable</a> family of classes. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="adf79feb4d657af5606d77a040b80c0a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf79feb4d657af5606d77a040b80c0a3">&#9670;&nbsp;</a></span>AssignTimeT()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void crashpad::internal::MinidumpWriterUtil::AssignTimeT </td>
<td>(</td>
<td class="paramtype">uint32_t *&#160;</td>
<td class="paramname"><em>destination</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">time_t&#160;</td>
<td class="paramname"><em>source</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Assigns a <code>time_t</code> value, logging a warning if the result overflows the destination buffer and will be truncated. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">destination</td><td>A pointer to the variable to be assigned to. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>The value to assign.</td></tr>
</table>
</dd>
</dl>
<p>The minidump format uses <code>uint32_t</code> for many timestamp values, but <code>time_t</code> may be wider than this. These year 2038 bugs are a limitation of the minidump format. An out-of-range error will be noted with a warning, but is not considered fatal. <em>source</em> will be truncated and assigned to <em>destination</em> in this case.</p>
<p>For <code>time_t</code> values with nonfatal overflow semantics, this function is used in preference to <a class="el" href="namespacecrashpad.html#aeb040202b4562c8c4087b9c9db2ce430" title="Performs an assignment if it can be done safely, and signals if it cannot be done safely.">AssignIfInRange()</a>, which fails without performing an assignment when an out-of-range condition is detected. </p>
</div>
</div>
<a id="a8050fbfd03eaf9c799001d37f417adec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8050fbfd03eaf9c799001d37f417adec">&#9670;&nbsp;</a></span>AssignUTF8ToUTF16()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void crashpad::internal::MinidumpWriterUtil::AssignUTF8ToUTF16 </td>
<td>(</td>
<td class="paramtype">base::char16 *&#160;</td>
<td class="paramname"><em>destination</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>destination_size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>source</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts a UTF-8 string to UTF-16 and places it into a buffer of fixed size, taking care to <code>NUL</code>-terminate the buffer and not to overflow it. If the string will be truncated or if it cannot be converted losslessly, a warning is logged. </p>
<p>Any unused portion of the <em>destination</em> buffer that is not written to by the converted string will be overwritten with <code>NUL</code> UTF-16 code units, thus, this function always writes <em>destination_size</em> <code>char16</code> units.</p>
<p>If the conversion is lossy, U+FFFD “replacement characters” will be introduced.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">destination</td><td>A pointer to the destination buffer, where the UTF-16-encoded string will be written. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">destination_size</td><td>The size of <em>destination</em> in <code>char16</code> units, including space used by a <code>NUL</code> terminator. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>The UTF-8-encoded input string. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a61b0a78e6ca458d986024a21d94ca70b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61b0a78e6ca458d986024a21d94ca70b">&#9670;&nbsp;</a></span>ConvertUTF8ToUTF16()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">base::string16 crashpad::internal::MinidumpWriterUtil::ConvertUTF8ToUTF16 </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>utf8</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts a UTF-8 string to UTF-16 and returns it. If the string cannot be converted losslessly, indicating that the input is not well-formed UTF-8, a warning is logged. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">utf8</td><td>The UTF-8-encoded string to convert.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The <em>utf8</em> string, converted to UTF-16 encoding. If the conversion is lossy, U+FFFD “replacement characters” will be introduced. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>minidump/minidump_writer_util.h</li>
<li>minidump/minidump_writer_util.cc</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>