-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_data_serializer_lib_8h_source.html
207 lines (205 loc) · 21.4 KB
/
_data_serializer_lib_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!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" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Data serializer plugin: Libs/DataSerializerLib.h Source File</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>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.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" />
</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 id="projectrow">
<td id="projectlogo"><img alt="Logo" src="Icon128.png"/></td>
<td id="projectalign">
<div id="projectname">Data serializer plugin<span id="projectnumber"> v1.0.2</span>
</div>
<div id="projectbrief">DataSerializer</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function(){initNavTree('_data_serializer_lib_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">DataSerializerLib.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Fill out your copyright notice in the Description page of Project Settings.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include "CoreMinimal.h"</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include "Kismet/BlueprintFunctionLibrary.h"</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include "DataSerializerLib.generated.h"</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">constexpr</span> int32 XEUS_SAVEGAME_FILE_TYPE_TAG = 0x78657573; <span class="comment">//XEUS</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span>USTRUCT(Blueprintable, BlueprintType)</div>
<div class="foldopen" id="foldopen00018" data-start="{" data-end="};">
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="struct_f_serialization_header.html"> 18</a></span>struct DATASERIALIZER_API <a class="code hl_struct" href="struct_f_serialization_header.html">FSerializationHeader</a></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span>{</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> GENERATED_BODY()</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="struct_f_serialization_header.html#a057e9a3a84162405e03a30bd671282d6"> 28</a></span> <a class="code hl_function" href="struct_f_serialization_header.html#a057e9a3a84162405e03a30bd671282d6">FSerializationHeader</a>();</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="struct_f_serialization_header.html#a8fb344d1802eca5d44f3fbbd123af231"> 35</a></span> <a class="code hl_function" href="struct_f_serialization_header.html#a8fb344d1802eca5d44f3fbbd123af231">FSerializationHeader</a>(TSubclassOf<UObject> ObjectType);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="struct_f_serialization_header.html#acc9253d4c732a4d4f3f5d9d5139e6cff"> 43</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_f_serialization_header.html#acc9253d4c732a4d4f3f5d9d5139e6cff">Empty</a>();</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="struct_f_serialization_header.html#ac6fe50b6044c6e196220b59648a64f0a"> 52</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_f_serialization_header.html#ac6fe50b6044c6e196220b59648a64f0a">Read</a>(FMemoryReader& MemoryReader);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="struct_f_serialization_header.html#aa677aa8e32dfd64f9c5e1d96e02f0f4c"> 61</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_f_serialization_header.html#aa677aa8e32dfd64f9c5e1d96e02f0f4c">Write</a>(FMemoryWriter& MemoryWriter);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> UPROPERTY(BlueprintReadWrite, EditAnywhere)</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="struct_f_serialization_header.html#a1790362f9c332fc7a3c27128a52a27cd"> 70</a></span> FString GameClassName;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>};</div>
</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span>UCLASS(Blueprintable, BlueprintType)</div>
<div class="foldopen" id="foldopen00078" data-start="{" data-end="};">
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html"> 78</a></span>class DATASERIALIZER_API <a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a> : public UBlueprintFunctionLibrary</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span>{</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> GENERATED_BODY()</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="preprocessor">#pragma region Disk</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> UFUNCTION(BlueprintCallable, Category=<span class="stringliteral">"UDataSerializerLib|Disk"</span>)</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a9b1efd25cff0cadd592ad56264d8eefa"> 97</a></span> static <span class="keywordtype">bool</span> WriteBytesToDisk(const TArray<uint8>& InBytes, FString InPath);</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> UFUNCTION(BlueprintCallable, Category="<a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a>|Disk")</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#ae2678d747fd63a504b3869145aa37f71"> 110</a></span> static <span class="keywordtype">bool</span> WriteBytesToDiskCompressed(const TArray<uint8>& InBytes, FString InPath);</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> UFUNCTION(BlueprintCallable, Category="<a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a>|Disk")</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a1aa29e4fb275a52f8c5a7aaa4d79c423"> 123</a></span> static <span class="keywordtype">bool</span> ReadBytesFromDisk(TArray<uint8>& OutBytes, FString InPath);</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> UFUNCTION(BlueprintCallable, Category="<a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a>|Disk")</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a4ce7bbfd3ee306b5b151668d06946b45"> 136</a></span> static <span class="keywordtype">bool</span> ReadCompressedBytesFromDisk(TArray<uint8>& OutBytes, FString InPath);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="preprocessor">#pragma endregion</span></div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="preprocessor">#pragma region Serialize</span></div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> UFUNCTION(BlueprintCallable, Category=<span class="stringliteral">"UDataSerializerLib|Serialization"</span>)</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a99e7baa06255b0ba2de8c1f21501e5de"> 152</a></span> static <span class="keywordtype">bool</span> SerializeObject(TArray<uint8>& OutBytes, UObject* InObject);</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> UFUNCTION(BlueprintCallable, Category="<a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a>|Serialization")</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#ab41d3b682bbbeeb09d6c09a959459fae"> 166</a></span> static <span class="keywordtype">bool</span> DeserializeObject(const TArray<uint8>& InBytes, UObject* ObjectOuter, UObject*& OutObject);</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> static <span class="keywordtype">bool</span> DeSerializeObjectCpp(FMemoryReader& InReader, UObject* ObjectOuter, UObject*& OutObject);</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> UFUNCTION(BlueprintCallable, Category="<a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a>|Serialization")</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a06b203e319c0f423888ae479eb92acc7"> 180</a></span> static <span class="keywordtype">bool</span> SerializeObjects(TArray<uint8>& OutBytes, TArray<UObject*> InObjects);</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> </div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> UFUNCTION(BlueprintCallable, Category="<a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a>|Serialization")</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a622060d72438a457951f724a66ab224e"> 194</a></span> static <span class="keywordtype">bool</span> DeSerializeObjects(const TArray<uint8>& InBytes, UObject* InObjectOuter, TArray<UObject*>& OutObjects);</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> static <span class="keywordtype">bool</span> DeSerializeObjectsCpp(FMemoryReader& InReader, UObject* InObjectOuter, TArray<UObject*>& OutObjects);</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span><span class="preprocessor">#pragma endregion</span></div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> </div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> </div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span><span class="preprocessor">#pragma region Utils</span></div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> </div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> UFUNCTION(BlueprintCallable, Category=<span class="stringliteral">"UDataSerializerLib|Utils"</span>)</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a4b4763cd32961022c938ea9c296f9573"> 212</a></span> static <span class="keywordtype">void</span> GetUtf8Bytes(const FString& InString, TArray<uint8>& OutBytes);</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> UFUNCTION(BlueprintCallable, Category="<a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a>|Utils")</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a390d502d57692bffbeb5714e4bde244f"> 223</a></span> static FString Utf8BytesToString(const TArray<uint8>& InBytes);</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> </div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> UFUNCTION(BlueprintCallable, Category="<a class="code hl_class" href="class_u_data_serializer_lib.html">UDataSerializerLib</a>|Utils")</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"><a class="line" href="class_u_data_serializer_lib.html#a68eed1ce33bdf7a9618d6896adb28509"> 236</a></span> static TArray<uint8> AppendBytes(const TArray<uint8>& InLeftPart, const TArray<uint8>& InRightPart);</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span><span class="preprocessor">#pragma endregion</span></div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span>};</div>
</div>
<div class="ttc" id="aclass_u_data_serializer_lib_html"><div class="ttname"><a href="class_u_data_serializer_lib.html">UDataSerializerLib</a></div><div class="ttdoc">Set of functions for working with data serialization and writing data to disk.</div><div class="ttdef"><b>Definition</b> DataSerializerLib.h:79</div></div>
<div class="ttc" id="astruct_f_serialization_header_html"><div class="ttname"><a href="struct_f_serialization_header.html">FSerializationHeader</a></div><div class="ttdoc">Structure for handling serialization headers in any project.</div><div class="ttdef"><b>Definition</b> DataSerializerLib.h:19</div></div>
<div class="ttc" id="astruct_f_serialization_header_html_a057e9a3a84162405e03a30bd671282d6"><div class="ttname"><a href="struct_f_serialization_header.html#a057e9a3a84162405e03a30bd671282d6">FSerializationHeader::FSerializationHeader</a></div><div class="ttdeci">FSerializationHeader()</div><div class="ttdoc">Default constructor for FSerializationHeader.</div></div>
<div class="ttc" id="astruct_f_serialization_header_html_a8fb344d1802eca5d44f3fbbd123af231"><div class="ttname"><a href="struct_f_serialization_header.html#a8fb344d1802eca5d44f3fbbd123af231">FSerializationHeader::FSerializationHeader</a></div><div class="ttdeci">FSerializationHeader(TSubclassOf< UObject > ObjectType)</div><div class="ttdoc">Constructor with specified object type.</div></div>
<div class="ttc" id="astruct_f_serialization_header_html_aa677aa8e32dfd64f9c5e1d96e02f0f4c"><div class="ttname"><a href="struct_f_serialization_header.html#aa677aa8e32dfd64f9c5e1d96e02f0f4c">FSerializationHeader::Write</a></div><div class="ttdeci">void Write(FMemoryWriter &MemoryWriter)</div><div class="ttdoc">Writes header data to a memory writer.</div></div>
<div class="ttc" id="astruct_f_serialization_header_html_ac6fe50b6044c6e196220b59648a64f0a"><div class="ttname"><a href="struct_f_serialization_header.html#ac6fe50b6044c6e196220b59648a64f0a">FSerializationHeader::Read</a></div><div class="ttdeci">void Read(FMemoryReader &MemoryReader)</div><div class="ttdoc">Reads header data from a memory reader.</div></div>
<div class="ttc" id="astruct_f_serialization_header_html_acc9253d4c732a4d4f3f5d9d5139e6cff"><div class="ttname"><a href="struct_f_serialization_header.html#acc9253d4c732a4d4f3f5d9d5139e6cff">FSerializationHeader::Empty</a></div><div class="ttdeci">void Empty()</div><div class="ttdoc">Resets the header to its default state.</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_6e6cb9563333489fde7459b1f95e59a5.html">Libs</a></li><li class="navelem"><b>DataSerializerLib.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
</ul>
</div>
</body>
</html>