|
159 | 159 |
|
160 | 160 | <div class="header"> |
161 | 161 | <div class="summary"> |
| 162 | +<a href="#nested-classes">Classes</a> | |
162 | 163 | <a href="#pub-methods">Public Member Functions</a> | |
163 | 164 | <a href="#pub-static-methods">Static Public Member Functions</a> | |
164 | 165 | <a href="classdrake_1_1_memory_file-members.html">List of all members</a> </div> |
|
196 | 197 | <tr class="memitem:ad337b3f5cb6821e21e26c3696144faaa"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classdrake_1_1_memory_file.html#ad337b3f5cb6821e21e26c3696144faaa">to_string</a> (<a class="el" href="classint.html">int</a> contents_limit=100) const</td></tr> |
197 | 198 | <tr class="memdesc:ad337b3f5cb6821e21e26c3696144faaa"><td class="mdescLeft"> </td><td class="mdescRight">Returns a string representation. <a href="#ad337b3f5cb6821e21e26c3696144faaa">More...</a><br /></td></tr> |
198 | 199 | <tr class="separator:ad337b3f5cb6821e21e26c3696144faaa"><td class="memSeparator" colspan="2"> </td></tr> |
| 200 | +<tr class="memitem:a8e8824802dedfbc36776227f7482b6bc"><td class="memTemplParams" colspan="2">template<typename Archive > </td></tr> |
| 201 | +<tr class="memitem:a8e8824802dedfbc36776227f7482b6bc"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classdrake_1_1_memory_file.html#a8e8824802dedfbc36776227f7482b6bc">Serialize</a> (Archive *a)</td></tr> |
| 202 | +<tr class="memdesc:a8e8824802dedfbc36776227f7482b6bc"><td class="mdescLeft"> </td><td class="mdescRight">Passes this object to an Archive. <a href="#a8e8824802dedfbc36776227f7482b6bc">More...</a><br /></td></tr> |
| 203 | +<tr class="separator:a8e8824802dedfbc36776227f7482b6bc"><td class="memSeparator" colspan="2"> </td></tr> |
199 | 204 | <tr><td colspan="2"><div class="groupHeader">Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable</div></td></tr> |
200 | 205 | <tr class="memitem:a75826baed3eae4f9970b9350dc7707ac"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdrake_1_1_memory_file.html#a75826baed3eae4f9970b9350dc7707ac">MemoryFile</a> (const <a class="el" href="classdrake_1_1_memory_file.html">MemoryFile</a> &)=default</td></tr> |
201 | 206 | <tr class="separator:a75826baed3eae4f9970b9350dc7707ac"><td class="memSeparator" colspan="2"> </td></tr> |
@@ -497,6 +502,32 @@ <h2 class="memtitle"><span class="permalink"><a href="#a709dc7d281f0dcc7d76101a4 |
497 | 502 | </table> |
498 | 503 | </div><div class="memdoc"> |
499 | 504 |
|
| 505 | +</div> |
| 506 | +</div> |
| 507 | +<a id="a8e8824802dedfbc36776227f7482b6bc"></a> |
| 508 | +<h2 class="memtitle"><span class="permalink"><a href="#a8e8824802dedfbc36776227f7482b6bc">◆ </a></span>Serialize()</h2> |
| 509 | + |
| 510 | +<div class="memitem"> |
| 511 | +<div class="memproto"> |
| 512 | + <table class="memname"> |
| 513 | + <tr> |
| 514 | + <td class="memname">void Serialize </td> |
| 515 | + <td>(</td> |
| 516 | + <td class="paramtype">Archive * </td> |
| 517 | + <td class="paramname"><em>a</em></td><td>)</td> |
| 518 | + <td></td> |
| 519 | + </tr> |
| 520 | + </table> |
| 521 | +</div><div class="memdoc"> |
| 522 | + |
| 523 | +<p>Passes this object to an Archive. </p> |
| 524 | +<p>Refer to <a class="el" href="group__yaml__serialization.html">YAML Serialization</a> for background.</p> |
| 525 | +<p>When used in yaml, it is important to specify <em>all</em> fields. Applications may depend on the <code>extension</code> value to determine what to do with the file contents. Omitting <code>extension</code> would make it unusable in those cases.</p> |
| 526 | +<p>Omitting <code>filename_hint</code> is less dangerous; error messages would lack a helpful identifier, but things would otherwise function.</p> |
| 527 | +<p>The value of contents should be a base64-encoded string of the file contents. Yaml's <code>!!binary</code> tag is required to declare the value is such a string. Serializing the MemoryFile will produce such a string. Writing a yaml file by hand will be more challenging.</p> |
| 528 | +<p>For this yaml:</p> |
| 529 | +<div class="fragment"><div class="line">contents: !!binary VGhpcyBpcyBhbiBleGFtcGxlIG9mIG1</div><div class="line"> lbW9yeSBmaWxlIHRlc3QgY29udGVudHMu</div><div class="line">extension: .txt</div><div class="line">filename_hint: payload.txt</div></div><!-- fragment --><p>we would produce a MemoryFile with contents equal to: </p><pre class="fragment">This is an example of memory file test contents. |
| 530 | +</pre> |
500 | 531 | </div> |
501 | 532 | </div> |
502 | 533 | <a id="a8a9f91a7db6a15fc542f14aa08c8e563"></a> |
|
0 commit comments