<!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>glibmm: Glib::Bytes 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" /> <link href="doxygen-extra.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">glibmm  <span id="projectnumber">2.60.0</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>Classes</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceGlib.html">Glib</a></li><li class="navelem"><a class="el" href="classGlib_1_1Bytes.html">Bytes</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-static-methods">Static Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> | <a href="#related">Related Functions</a> | <a href="classGlib_1_1Bytes-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">Glib::Bytes Class Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div> </div><!--header--> <div class="contents"> <p>A simple refcounted data type representing an immutable byte sequence from an unspecified origin. <a href="classGlib_1_1Bytes.html#details">More...</a></p> <p><code>#include <glibmm/bytes.h></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:a3ebab3535510aec1ac5a230a54f490df"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a3ebab3535510aec1ac5a230a54f490df">reference</a> () const </td></tr> <tr class="memdesc:a3ebab3535510aec1ac5a230a54f490df"><td class="mdescLeft"> </td><td class="mdescRight">Increment the reference count for this object. <a href="#a3ebab3535510aec1ac5a230a54f490df">More...</a><br /></td></tr> <tr class="separator:a3ebab3535510aec1ac5a230a54f490df"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a26320cfa1354e83af8186fd62974a180"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a26320cfa1354e83af8186fd62974a180">unreference</a> () const </td></tr> <tr class="memdesc:a26320cfa1354e83af8186fd62974a180"><td class="mdescLeft"> </td><td class="mdescRight">Decrement the reference count for this object. <a href="#a26320cfa1354e83af8186fd62974a180">More...</a><br /></td></tr> <tr class="separator:a26320cfa1354e83af8186fd62974a180"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aab7dbd47921abcdd9f9f1a336399842c"><td class="memItemLeft" align="right" valign="top">GBytes* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#aab7dbd47921abcdd9f9f1a336399842c">gobj</a> ()</td></tr> <tr class="memdesc:aab7dbd47921abcdd9f9f1a336399842c"><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C instance. <a href="#aab7dbd47921abcdd9f9f1a336399842c">More...</a><br /></td></tr> <tr class="separator:aab7dbd47921abcdd9f9f1a336399842c"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa9e557b5ef18ad79a0acf07962f0288a"><td class="memItemLeft" align="right" valign="top">const GBytes* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#aa9e557b5ef18ad79a0acf07962f0288a">gobj</a> () const </td></tr> <tr class="memdesc:aa9e557b5ef18ad79a0acf07962f0288a"><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C instance. <a href="#aa9e557b5ef18ad79a0acf07962f0288a">More...</a><br /></td></tr> <tr class="separator:aa9e557b5ef18ad79a0acf07962f0288a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad482796c48f6f8d35ae6a1aa52ec599e"><td class="memItemLeft" align="right" valign="top">GBytes* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#ad482796c48f6f8d35ae6a1aa52ec599e">gobj_copy</a> () const </td></tr> <tr class="memdesc:ad482796c48f6f8d35ae6a1aa52ec599e"><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. <a href="#ad482796c48f6f8d35ae6a1aa52ec599e">More...</a><br /></td></tr> <tr class="separator:ad482796c48f6f8d35ae6a1aa52ec599e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3bd0089700df92f23b1c4bc91ace8bcf"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a3bd0089700df92f23b1c4bc91ace8bcf">Bytes</a> ()=delete</td></tr> <tr class="separator:a3bd0089700df92f23b1c4bc91ace8bcf"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adc8fc824354b3b0e7199acd953f23abe"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#adc8fc824354b3b0e7199acd953f23abe">Bytes</a> (const <a class="el" href="classGlib_1_1Bytes.html">Bytes</a>&)=delete</td></tr> <tr class="separator:adc8fc824354b3b0e7199acd953f23abe"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adef04ea17dded7a2f3cb808e7608e055"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classGlib_1_1Bytes.html">Bytes</a>& </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#adef04ea17dded7a2f3cb808e7608e055">operator=</a> (const <a class="el" href="classGlib_1_1Bytes.html">Bytes</a>&)=delete</td></tr> <tr class="separator:adef04ea17dded7a2f3cb808e7608e055"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad9c2f945fbafbb8567ced7b294025619"><td class="memItemLeft" align="right" valign="top">gconstpointer </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#ad9c2f945fbafbb8567ced7b294025619">get_data</a> (gsize&<a class="elRef" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01484.html#ga5b1a5398fdc4ecf20576f3cae02ea8fc">size</a>) const </td></tr> <tr class="memdesc:ad9c2f945fbafbb8567ced7b294025619"><td class="mdescLeft"> </td><td class="mdescRight">Get the byte data in the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>. <a href="#ad9c2f945fbafbb8567ced7b294025619">More...</a><br /></td></tr> <tr class="separator:ad9c2f945fbafbb8567ced7b294025619"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a97304d598018da3ed8c5c90411fe9ba0"><td class="memItemLeft" align="right" valign="top">gsize </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a97304d598018da3ed8c5c90411fe9ba0">get_size</a> () const </td></tr> <tr class="memdesc:a97304d598018da3ed8c5c90411fe9ba0"><td class="mdescLeft"> </td><td class="mdescRight">Get the size of the byte data in the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>. <a href="#a97304d598018da3ed8c5c90411fe9ba0">More...</a><br /></td></tr> <tr class="separator:a97304d598018da3ed8c5c90411fe9ba0"><td class="memSeparator" colspan="2"> </td></tr> </table><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:a8c8f1062871f4ff87a9514ef74308f07"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Bytes.html">Glib::Bytes</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a8c8f1062871f4ff87a9514ef74308f07">create</a> (gconstpointer data, gsize <a class="elRef" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01484.html#ga5b1a5398fdc4ecf20576f3cae02ea8fc">size</a>)</td></tr> <tr class="separator:a8c8f1062871f4ff87a9514ef74308f07"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a06410137748117467146b3c4d4d77c7c"><td class="memItemLeft" align="right" valign="top">static guint </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a06410137748117467146b3c4d4d77c7c">hash</a> (gconstpointer bytes)</td></tr> <tr class="memdesc:a06410137748117467146b3c4d4d77c7c"><td class="mdescLeft"> </td><td class="mdescRight">Creates an integer hash code for the byte data in the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>. <a href="#a06410137748117467146b3c4d4d77c7c">More...</a><br /></td></tr> <tr class="separator:a06410137748117467146b3c4d4d77c7c"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6296b93981e010525d71c8b3f126ce65"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a6296b93981e010525d71c8b3f126ce65">equal</a> (gconstpointer bytes1, gconstpointer bytes2)</td></tr> <tr class="memdesc:a6296b93981e010525d71c8b3f126ce65"><td class="mdescLeft"> </td><td class="mdescRight">Compares the two <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> values being pointed to and returns <code>true</code> if they are equal. <a href="#a6296b93981e010525d71c8b3f126ce65">More...</a><br /></td></tr> <tr class="separator:a6296b93981e010525d71c8b3f126ce65"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2ea3d054c219ccde859316204b19426b"><td class="memItemLeft" align="right" valign="top">static gint </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a2ea3d054c219ccde859316204b19426b">compare</a> (gconstpointer bytes1, gconstpointer bytes2)</td></tr> <tr class="memdesc:a2ea3d054c219ccde859316204b19426b"><td class="mdescLeft"> </td><td class="mdescRight">Compares the two <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> values. <a href="#a2ea3d054c219ccde859316204b19426b">More...</a><br /></td></tr> <tr class="separator:a2ea3d054c219ccde859316204b19426b"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr class="memitem:a4bce73ee3c5a2a9551587a8cf49d2c05"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a4bce73ee3c5a2a9551587a8cf49d2c05">operator delete</a> (void*, std::size_t)</td></tr> <tr class="separator:a4bce73ee3c5a2a9551587a8cf49d2c05"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a> Related Functions</h2></td></tr> <tr><td class="ititle" colspan="2"><p>(Note that these are not member functions.) </p> </td></tr> <tr class="memitem:a0de22eb5d159db98e1d035bc58a14cd9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Bytes.html">Glib::Bytes</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Bytes.html#a0de22eb5d159db98e1d035bc58a14cd9">wrap</a> (GBytes* object, bool take_copy=false)</td></tr> <tr class="memdesc:a0de22eb5d159db98e1d035bc58a14cd9"><td class="mdescLeft"> </td><td class="mdescRight">A <a class="el" href="namespaceGlib.html#a671306f4a3a0cae5ab4d7a9d54886592">Glib::wrap()</a> method for this object. <a href="#a0de22eb5d159db98e1d035bc58a14cd9">More...</a><br /></td></tr> <tr class="separator:a0de22eb5d159db98e1d035bc58a14cd9"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A simple refcounted data type representing an immutable byte sequence from an unspecified origin. </p> <p>The purpose of the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> class is to keep the memory region that it holds alive for as long as anyone holds a reference to the bytes. When the last reference count is dropped, the memory is released. Multiple unrelated callers can use byte data in the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> object without coordinating their activities, resting assured that the byte data will not change or move while they hold a reference.</p> <p>A <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> object can come from many different origins that may have different procedures for freeing the memory region. Examples are memory from g_malloc(), from memory slices, from a GMappedFile or memory from other allocators.</p> <dl class="since_2_34"><dt><b><a class="el" href="since_2_34.html#_since_2_34000001">Since glibmm 2.34:</a></b></dt><dd></dd></dl> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a class="anchor" id="a3bd0089700df92f23b1c4bc91ace8bcf"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">Glib::Bytes::Bytes </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">delete</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="adc8fc824354b3b0e7199acd953f23abe"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">Glib::Bytes::Bytes </td> <td>(</td> <td class="paramtype">const <a class="el" href="classGlib_1_1Bytes.html">Bytes</a>& </td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">delete</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a2ea3d054c219ccde859316204b19426b"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static gint Glib::Bytes::compare </td> <td>(</td> <td class="paramtype">gconstpointer </td> <td class="paramname"><em>bytes1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gconstpointer </td> <td class="paramname"><em>bytes2</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">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Compares the two <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> values. </p> <p>This function can be used to sort GBytes instances in lexicographical order.</p> <p>If <em>bytes1</em> and <em>bytes2</em> have different length but the shorter one is a prefix of the longer one then the shorter one is considered to be less than the longer one. Otherwise the first byte where both differ is used for comparison. If <em>bytes1</em> has a smaller value at that position it is considered less, otherwise greater than <em>bytes2</em>.</p> <dl class="since_2_32"><dt><b><a class="el" href="since_2_32.html#_since_2_32000005">Since glibmm 2.32:</a></b></dt><dd></dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">bytes1</td><td>A pointer to a <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>. </td></tr> <tr><td class="paramname">bytes2</td><td>A pointer to a <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> to compare with <em>bytes1</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>A negative value if <em>bytes1</em> is less than <em>bytes2</em>, a positive value if <em>bytes1</em> is greater than <em>bytes2</em>, and zero if <em>bytes1</em> is equal to <em>bytes2</em>. </dd></dl> </div> </div> <a class="anchor" id="a8c8f1062871f4ff87a9514ef74308f07"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGlib_1_1Bytes.html">Glib::Bytes</a>> Glib::Bytes::create </td> <td>(</td> <td class="paramtype">gconstpointer </td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gsize </td> <td class="paramname"><em>size</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">static</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="a6296b93981e010525d71c8b3f126ce65"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static bool Glib::Bytes::equal </td> <td>(</td> <td class="paramtype">gconstpointer </td> <td class="paramname"><em>bytes1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gconstpointer </td> <td class="paramname"><em>bytes2</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">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Compares the two <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> values being pointed to and returns <code>true</code> if they are equal. </p> <p>This function can be passed to g_hash_table_new() as the <em>key_equal_func</em> parameter, when using non-<code>nullptr</code> <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> pointers as keys in a HashTable.</p> <dl class="since_2_32"><dt><b><a class="el" href="since_2_32.html#_since_2_32000004">Since glibmm 2.32:</a></b></dt><dd></dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">bytes1</td><td>A pointer to a <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>. </td></tr> <tr><td class="paramname">bytes2</td><td>A pointer to a <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> to compare with <em>bytes1</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>true</code> if the two keys match. </dd></dl> </div> </div> <a class="anchor" id="ad9c2f945fbafbb8567ced7b294025619"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">gconstpointer Glib::Bytes::get_data </td> <td>(</td> <td class="paramtype">gsize & </td> <td class="paramname"><em>size</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Get the byte data in the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>. </p> <p>This data should not be modified.</p> <p>This function will always return the same pointer for a given <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>.</p> <p><code>nullptr</code> may be returned if <em>size</em> is 0. This is not guaranteed, as the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> may represent an empty string with <em>data</em> non-<code>nullptr</code> and <em>size</em> as 0. <code>nullptr</code> will not be returned if <em>size</em> is non-zero.</p> <dl class="since_2_32"><dt><b><a class="el" href="since_2_32.html#_since_2_32000001">Since glibmm 2.32:</a></b></dt><dd></dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">size</td><td>Location to return size of byte data. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>A pointer to the byte data, or <code>nullptr</code>. </dd></dl> </div> </div> <a class="anchor" id="a97304d598018da3ed8c5c90411fe9ba0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">gsize Glib::Bytes::get_size </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Get the size of the byte data in the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>. </p> <p>This function will always return the same value for a given <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>.</p> <dl class="since_2_32"><dt><b><a class="el" href="since_2_32.html#_since_2_32000002">Since glibmm 2.32:</a></b></dt><dd></dd></dl> <dl class="section return"><dt>Returns</dt><dd>The size. </dd></dl> </div> </div> <a class="anchor" id="aab7dbd47921abcdd9f9f1a336399842c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">GBytes* Glib::Bytes::gobj </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Provides access to the underlying C instance. </p> </div> </div> <a class="anchor" id="aa9e557b5ef18ad79a0acf07962f0288a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const GBytes* Glib::Bytes::gobj </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Provides access to the underlying C instance. </p> </div> </div> <a class="anchor" id="ad482796c48f6f8d35ae6a1aa52ec599e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">GBytes* Glib::Bytes::gobj_copy </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. </p> </div> </div> <a class="anchor" id="a06410137748117467146b3c4d4d77c7c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static guint Glib::Bytes::hash </td> <td>(</td> <td class="paramtype">gconstpointer </td> <td class="paramname"><em>bytes</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>Creates an integer hash code for the byte data in the <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a>. </p> <p>This function can be passed to g_hash_table_new() as the <em>key_hash_func</em> parameter, when using non-<code>nullptr</code> <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> pointers as keys in a HashTable.</p> <dl class="since_2_32"><dt><b><a class="el" href="since_2_32.html#_since_2_32000003">Since glibmm 2.32:</a></b></dt><dd></dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">bytes</td><td>A pointer to a <a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> key. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>A hash value corresponding to the key. </dd></dl> </div> </div> <a class="anchor" id="a4bce73ee3c5a2a9551587a8cf49d2c05"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void Glib::Bytes::operator delete </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname">, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::size_t </td> <td class="paramname"> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="adef04ea17dded7a2f3cb808e7608e055"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classGlib_1_1Bytes.html">Bytes</a>& Glib::Bytes::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classGlib_1_1Bytes.html">Bytes</a>& </td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">delete</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="a3ebab3535510aec1ac5a230a54f490df"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Glib::Bytes::reference </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Increment the reference count for this object. </p> <p>You should never need to do this manually - use the object via a <a class="el" href="classGlib_1_1RefPtr.html" title="RefPtr<> is a reference-counting shared smartpointer. ">RefPtr</a> instead. </p> </div> </div> <a class="anchor" id="a26320cfa1354e83af8186fd62974a180"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Glib::Bytes::unreference </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Decrement the reference count for this object. </p> <p>You should never need to do this manually - use the object via a <a class="el" href="classGlib_1_1RefPtr.html" title="RefPtr<> is a reference-counting shared smartpointer. ">RefPtr</a> instead. </p> </div> </div> <h2 class="groupheader">Friends And Related Function Documentation</h2> <a class="anchor" id="a0de22eb5d159db98e1d035bc58a14cd9"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Bytes.html">Glib::Bytes</a> > wrap </td> <td>(</td> <td class="paramtype">GBytes * </td> <td class="paramname"><em>object</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"><em>take_copy</em> = <code>false</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">related</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>A <a class="el" href="namespaceGlib.html#a671306f4a3a0cae5ab4d7a9d54886592">Glib::wrap()</a> method for this object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">object</td><td>The C instance. </td></tr> <tr><td class="paramname">take_copy</td><td>False if the result should take ownership of the C instance. True if it should take a new copy or ref. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>A C++ instance that wraps this C instance. </dd></dl> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Mar 19 2019 09:56:45 for glibmm 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>