You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

556 lines
27 KiB

  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class Utils
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class Utils
  11. ">
  12. <meta name="generator" content="docfx 2.48.1.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <link rel="stylesheet" href="../styles/fix.css">
  18. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  19. <meta property="docfx:navrel" content="../toc.html">
  20. <meta property="docfx:tocrel" content="toc.html">
  21. <meta property="docfx:rel" content="../">
  22. <meta property="docfx:newtab" content="true">
  23. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  24. <div id="wrapper">
  25. <header>
  26. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  27. <div class="container">
  28. <div class="navbar-header">
  29. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  30. <span class="sr-only">Toggle navigation</span>
  31. <span class="icon-bar"></span>
  32. <span class="icon-bar"></span>
  33. <span class="icon-bar"></span>
  34. </button>
  35. <a class="navbar-brand" href="../index.html">
  36. <img id="logo" class="svg" src="../logo.svg" alt="">
  37. </a>
  38. </div>
  39. <div class="collapse navbar-collapse" id="navbar">
  40. <form class="navbar-form navbar-right" role="search" id="search">
  41. <div class="form-group">
  42. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  43. </div>
  44. </form>
  45. </div>
  46. </div>
  47. </nav>
  48. <div class="subnav navbar navbar-default">
  49. <div class="container hide-when-search" id="breadcrumb">
  50. <ul class="breadcrumb">
  51. <li></li>
  52. </ul>
  53. </div>
  54. </div>
  55. </header>
  56. <div class="container body-content">
  57. <div id="search-results">
  58. <div class="search-list"></div>
  59. <div class="sr-items">
  60. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  61. </div>
  62. <ul id="pagination"></ul>
  63. </div>
  64. </div>
  65. <div role="main" class="container body-content hide-when-search">
  66. <div class="sidenav hide-when-search">
  67. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  68. <div class="sidetoggle collapse" id="sidetoggle">
  69. <div id="sidetoc"></div>
  70. </div>
  71. </div>
  72. <div class="article row grid-right">
  73. <div class="col-md-10">
  74. <article class="content wrap" id="_content" data-uid="IPA.Utilities.Utils">
  75. <h1 id="IPA_Utilities_Utils" data-uid="IPA.Utilities.Utils" class="text-break">Class Utils
  76. </h1>
  77. <div class="markdown level0 summary"><p>A class providing static utility functions that in any other language would just <em>exist</em>.</p>
  78. </div>
  79. <div class="markdown level0 conceptual"></div>
  80. <div class="inheritance">
  81. <h5>Inheritance</h5>
  82. <div class="level0"><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></div>
  83. <div class="level1"><span class="xref">Utils</span></div>
  84. </div>
  85. <div class="inheritedMembers">
  86. <h5>Inherited Members</h5>
  87. <div>
  88. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#System_Object_ToString">Object.ToString()</a>
  89. </div>
  90. <div>
  91. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_">Object.Equals(Object)</a>
  92. </div>
  93. <div>
  94. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_System_Object_">Object.Equals(Object, Object)</a>
  95. </div>
  96. <div>
  97. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.referenceequals#System_Object_ReferenceEquals_System_Object_System_Object_">Object.ReferenceEquals(Object, Object)</a>
  98. </div>
  99. <div>
  100. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gethashcode#System_Object_GetHashCode">Object.GetHashCode()</a>
  101. </div>
  102. <div>
  103. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gettype#System_Object_GetType">Object.GetType()</a>
  104. </div>
  105. <div>
  106. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.memberwiseclone#System_Object_MemberwiseClone">Object.MemberwiseClone()</a>
  107. </div>
  108. </div>
  109. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Utilities.html">IPA.Utilities</a></h6>
  110. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  111. <h5 id="IPA_Utilities_Utils_syntax">Syntax</h5>
  112. <div class="codewrapper">
  113. <pre><code class="lang-csharp hljs">public static class Utils</code></pre>
  114. </div>
  115. <h3 id="properties">Properties
  116. </h3>
  117. <span class="small pull-right mobile-hide">
  118. <span class="divider">|</span>
  119. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils_CanUseDateTimeNowSafely.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils.CanUseDateTimeNowSafely%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  120. </span>
  121. <span class="small pull-right mobile-hide">
  122. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L144">View Source</a>
  123. </span>
  124. <a id="IPA_Utilities_Utils_CanUseDateTimeNowSafely_" data-uid="IPA.Utilities.Utils.CanUseDateTimeNowSafely*"></a>
  125. <h4 id="IPA_Utilities_Utils_CanUseDateTimeNowSafely" data-uid="IPA.Utilities.Utils.CanUseDateTimeNowSafely">CanUseDateTimeNowSafely</h4>
  126. <div class="markdown level1 summary"><p>Whether you can safely use <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.datetime.now#System_DateTime_Now">Now</a> without Mono throwing a fit.</p>
  127. </div>
  128. <div class="markdown level1 conceptual"></div>
  129. <h5 class="decalaration">Declaration</h5>
  130. <div class="codewrapper">
  131. <pre><code class="lang-csharp hljs">public static bool CanUseDateTimeNowSafely { get; }</code></pre>
  132. </div>
  133. <h5 class="propertyValue">Property Value</h5>
  134. <table class="table table-bordered table-striped table-condensed">
  135. <thead>
  136. <tr>
  137. <th>Type</th>
  138. <th>Description</th>
  139. </tr>
  140. </thead>
  141. <tbody>
  142. <tr>
  143. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  144. <td><p><span class="xref">true</span> if you can use <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.datetime.now#System_DateTime_Now">Now</a> safely, <span class="xref">false</span> otherwise</p>
  145. </td>
  146. </tr>
  147. </tbody>
  148. </table>
  149. <h3 id="methods">Methods
  150. </h3>
  151. <span class="small pull-right mobile-hide">
  152. <span class="divider">|</span>
  153. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils_ByteArrayToString_System_Byte___.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils.ByteArrayToString(System.Byte%5B%5D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  154. </span>
  155. <span class="small pull-right mobile-hide">
  156. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L38">View Source</a>
  157. </span>
  158. <a id="IPA_Utilities_Utils_ByteArrayToString_" data-uid="IPA.Utilities.Utils.ByteArrayToString*"></a>
  159. <h4 id="IPA_Utilities_Utils_ByteArrayToString_System_Byte___" data-uid="IPA.Utilities.Utils.ByteArrayToString(System.Byte[])">ByteArrayToString(Byte[])</h4>
  160. <div class="markdown level1 summary"><p>Converts a byte array to a hex string.</p>
  161. </div>
  162. <div class="markdown level1 conceptual"></div>
  163. <h5 class="decalaration">Declaration</h5>
  164. <div class="codewrapper">
  165. <pre><code class="lang-csharp hljs">public static string ByteArrayToString(byte[] ba)</code></pre>
  166. </div>
  167. <h5 class="parameters">Parameters</h5>
  168. <table class="table table-bordered table-striped table-condensed">
  169. <thead>
  170. <tr>
  171. <th>Type</th>
  172. <th>Name</th>
  173. <th>Description</th>
  174. </tr>
  175. </thead>
  176. <tbody>
  177. <tr>
  178. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.byte">Byte</a>[]</td>
  179. <td><span class="parametername">ba</span></td>
  180. <td><p>the byte array</p>
  181. </td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. <h5 class="returns">Returns</h5>
  186. <table class="table table-bordered table-striped table-condensed">
  187. <thead>
  188. <tr>
  189. <th>Type</th>
  190. <th>Description</th>
  191. </tr>
  192. </thead>
  193. <tbody>
  194. <tr>
  195. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  196. <td><p>the hex form of the array</p>
  197. </td>
  198. </tr>
  199. </tbody>
  200. </table>
  201. <span class="small pull-right mobile-hide">
  202. <span class="divider">|</span>
  203. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils_CopyAll_System_IO_DirectoryInfo_System_IO_DirectoryInfo_System_String_System_Func_System_Exception_System_IO_FileInfo_System_Boolean__.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils.CopyAll(System.IO.DirectoryInfo%2CSystem.IO.DirectoryInfo%2CSystem.String%2CSystem.Func%7BSystem.Exception%2CSystem.IO.FileInfo%2CSystem.Boolean%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  204. </span>
  205. <span class="small pull-right mobile-hide">
  206. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L99">View Source</a>
  207. </span>
  208. <a id="IPA_Utilities_Utils_CopyAll_" data-uid="IPA.Utilities.Utils.CopyAll*"></a>
  209. <h4 id="IPA_Utilities_Utils_CopyAll_System_IO_DirectoryInfo_System_IO_DirectoryInfo_System_String_System_Func_System_Exception_System_IO_FileInfo_System_Boolean__" data-uid="IPA.Utilities.Utils.CopyAll(System.IO.DirectoryInfo,System.IO.DirectoryInfo,System.String,System.Func{System.Exception,System.IO.FileInfo,System.Boolean})">CopyAll(DirectoryInfo, DirectoryInfo, String, Func&lt;Exception, FileInfo, Boolean&gt;)</h4>
  210. <div class="markdown level1 summary"><p>Copies all files from <code data-dev-comment-type="paramref" class="paramref">source</code> to <code data-dev-comment-type="paramref" class="paramref">target</code>.</p>
  211. </div>
  212. <div class="markdown level1 conceptual"></div>
  213. <h5 class="decalaration">Declaration</h5>
  214. <div class="codewrapper">
  215. <pre><code class="lang-csharp hljs">public static void CopyAll(DirectoryInfo source, DirectoryInfo target, string appendFileName = &quot;&quot;, Func&lt;Exception, FileInfo, bool&gt; onCopyException = null)</code></pre>
  216. </div>
  217. <h5 class="parameters">Parameters</h5>
  218. <table class="table table-bordered table-striped table-condensed">
  219. <thead>
  220. <tr>
  221. <th>Type</th>
  222. <th>Name</th>
  223. <th>Description</th>
  224. </tr>
  225. </thead>
  226. <tbody>
  227. <tr>
  228. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.io.directoryinfo">DirectoryInfo</a></td>
  229. <td><span class="parametername">source</span></td>
  230. <td><p>the source directory</p>
  231. </td>
  232. </tr>
  233. <tr>
  234. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.io.directoryinfo">DirectoryInfo</a></td>
  235. <td><span class="parametername">target</span></td>
  236. <td><p>the destination directory</p>
  237. </td>
  238. </tr>
  239. <tr>
  240. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  241. <td><span class="parametername">appendFileName</span></td>
  242. <td><p>the filename of the file to append together</p>
  243. </td>
  244. </tr>
  245. <tr>
  246. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.func-3">Func</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.exception">Exception</a>, <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.io.fileinfo">FileInfo</a>, <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a>&gt;</td>
  247. <td><span class="parametername">onCopyException</span></td>
  248. <td><p>a delegate called when there is an error copying. Return true to keep going.</p>
  249. </td>
  250. </tr>
  251. </tbody>
  252. </table>
  253. <span class="small pull-right mobile-hide">
  254. <span class="divider">|</span>
  255. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils_CurrentTime.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils.CurrentTime%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  256. </span>
  257. <span class="small pull-right mobile-hide">
  258. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L154">View Source</a>
  259. </span>
  260. <a id="IPA_Utilities_Utils_CurrentTime_" data-uid="IPA.Utilities.Utils.CurrentTime*"></a>
  261. <h4 id="IPA_Utilities_Utils_CurrentTime" data-uid="IPA.Utilities.Utils.CurrentTime">CurrentTime()</h4>
  262. <div class="markdown level1 summary"><p>Gets the current <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.datetime">DateTime</a> if supported, otherwise, if Mono would throw a fit,
  263. returns <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.datetime.minvalue">MinValue</a> plus some value, such that each time it is called
  264. the value will be greater than the previous result. Not suitable for timing.</p>
  265. </div>
  266. <div class="markdown level1 conceptual"></div>
  267. <h5 class="decalaration">Declaration</h5>
  268. <div class="codewrapper">
  269. <pre><code class="lang-csharp hljs">public static DateTime CurrentTime()</code></pre>
  270. </div>
  271. <h5 class="returns">Returns</h5>
  272. <table class="table table-bordered table-striped table-condensed">
  273. <thead>
  274. <tr>
  275. <th>Type</th>
  276. <th>Description</th>
  277. </tr>
  278. </thead>
  279. <tbody>
  280. <tr>
  281. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.datetime">DateTime</a></td>
  282. <td><p>the current <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.datetime">DateTime</a> if supported, otherwise some indeterminant increasing value.</p>
  283. </td>
  284. </tr>
  285. </tbody>
  286. </table>
  287. <span class="small pull-right mobile-hide">
  288. <span class="divider">|</span>
  289. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils_GetRelativePath_System_String_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils.GetRelativePath(System.String%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  290. </span>
  291. <span class="small pull-right mobile-hide">
  292. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L80">View Source</a>
  293. </span>
  294. <a id="IPA_Utilities_Utils_GetRelativePath_" data-uid="IPA.Utilities.Utils.GetRelativePath*"></a>
  295. <h4 id="IPA_Utilities_Utils_GetRelativePath_System_String_System_String_" data-uid="IPA.Utilities.Utils.GetRelativePath(System.String,System.String)">GetRelativePath(String, String)</h4>
  296. <div class="markdown level1 summary"><p>Gets a path relative to the provided folder.</p>
  297. </div>
  298. <div class="markdown level1 conceptual"></div>
  299. <h5 class="decalaration">Declaration</h5>
  300. <div class="codewrapper">
  301. <pre><code class="lang-csharp hljs">public static string GetRelativePath(string file, string folder)</code></pre>
  302. </div>
  303. <h5 class="parameters">Parameters</h5>
  304. <table class="table table-bordered table-striped table-condensed">
  305. <thead>
  306. <tr>
  307. <th>Type</th>
  308. <th>Name</th>
  309. <th>Description</th>
  310. </tr>
  311. </thead>
  312. <tbody>
  313. <tr>
  314. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  315. <td><span class="parametername">file</span></td>
  316. <td><p>the file to relativize</p>
  317. </td>
  318. </tr>
  319. <tr>
  320. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  321. <td><span class="parametername">folder</span></td>
  322. <td><p>the source folder</p>
  323. </td>
  324. </tr>
  325. </tbody>
  326. </table>
  327. <h5 class="returns">Returns</h5>
  328. <table class="table table-bordered table-striped table-condensed">
  329. <thead>
  330. <tr>
  331. <th>Type</th>
  332. <th>Description</th>
  333. </tr>
  334. </thead>
  335. <tbody>
  336. <tr>
  337. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  338. <td><p>a path to get from <code data-dev-comment-type="paramref" class="paramref">folder</code> to <code data-dev-comment-type="paramref" class="paramref">file</code></p>
  339. </td>
  340. </tr>
  341. </tbody>
  342. </table>
  343. <span class="small pull-right mobile-hide">
  344. <span class="divider">|</span>
  345. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils_StringToByteArray_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils.StringToByteArray(System.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  346. </span>
  347. <span class="small pull-right mobile-hide">
  348. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L24">View Source</a>
  349. </span>
  350. <a id="IPA_Utilities_Utils_StringToByteArray_" data-uid="IPA.Utilities.Utils.StringToByteArray*"></a>
  351. <h4 id="IPA_Utilities_Utils_StringToByteArray_System_String_" data-uid="IPA.Utilities.Utils.StringToByteArray(System.String)">StringToByteArray(String)</h4>
  352. <div class="markdown level1 summary"><p>Converts a hex string to a byte array.</p>
  353. </div>
  354. <div class="markdown level1 conceptual"></div>
  355. <h5 class="decalaration">Declaration</h5>
  356. <div class="codewrapper">
  357. <pre><code class="lang-csharp hljs">public static byte[] StringToByteArray(string hex)</code></pre>
  358. </div>
  359. <h5 class="parameters">Parameters</h5>
  360. <table class="table table-bordered table-striped table-condensed">
  361. <thead>
  362. <tr>
  363. <th>Type</th>
  364. <th>Name</th>
  365. <th>Description</th>
  366. </tr>
  367. </thead>
  368. <tbody>
  369. <tr>
  370. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  371. <td><span class="parametername">hex</span></td>
  372. <td><p>the hex stream</p>
  373. </td>
  374. </tr>
  375. </tbody>
  376. </table>
  377. <h5 class="returns">Returns</h5>
  378. <table class="table table-bordered table-striped table-condensed">
  379. <thead>
  380. <tr>
  381. <th>Type</th>
  382. <th>Description</th>
  383. </tr>
  384. </thead>
  385. <tbody>
  386. <tr>
  387. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.byte">Byte</a>[]</td>
  388. <td><p>the corresponding byte array</p>
  389. </td>
  390. </tr>
  391. </tbody>
  392. </table>
  393. <span class="small pull-right mobile-hide">
  394. <span class="divider">|</span>
  395. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils_UnsafeCompare_System_Byte___System_Byte___.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils.UnsafeCompare(System.Byte%5B%5D%2CSystem.Byte%5B%5D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  396. </span>
  397. <span class="small pull-right mobile-hide">
  398. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L56">View Source</a>
  399. </span>
  400. <a id="IPA_Utilities_Utils_UnsafeCompare_" data-uid="IPA.Utilities.Utils.UnsafeCompare*"></a>
  401. <h4 id="IPA_Utilities_Utils_UnsafeCompare_System_Byte___System_Byte___" data-uid="IPA.Utilities.Utils.UnsafeCompare(System.Byte[],System.Byte[])">UnsafeCompare(Byte[], Byte[])</h4>
  402. <div class="markdown level1 summary"><p>Uses unsafe code to compare 2 byte arrays quickly.</p>
  403. </div>
  404. <div class="markdown level1 conceptual"></div>
  405. <h5 class="decalaration">Declaration</h5>
  406. <div class="codewrapper">
  407. <pre><code class="lang-csharp hljs">public static bool UnsafeCompare(byte[] a1, byte[] a2)</code></pre>
  408. </div>
  409. <h5 class="parameters">Parameters</h5>
  410. <table class="table table-bordered table-striped table-condensed">
  411. <thead>
  412. <tr>
  413. <th>Type</th>
  414. <th>Name</th>
  415. <th>Description</th>
  416. </tr>
  417. </thead>
  418. <tbody>
  419. <tr>
  420. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.byte">Byte</a>[]</td>
  421. <td><span class="parametername">a1</span></td>
  422. <td><p>array 1</p>
  423. </td>
  424. </tr>
  425. <tr>
  426. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.byte">Byte</a>[]</td>
  427. <td><span class="parametername">a2</span></td>
  428. <td><p>array 2</p>
  429. </td>
  430. </tr>
  431. </tbody>
  432. </table>
  433. <h5 class="returns">Returns</h5>
  434. <table class="table table-bordered table-striped table-condensed">
  435. <thead>
  436. <tr>
  437. <th>Type</th>
  438. <th>Description</th>
  439. </tr>
  440. </thead>
  441. <tbody>
  442. <tr>
  443. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  444. <td><p>whether or not they are byte-for-byte equal</p>
  445. </td>
  446. </tr>
  447. </tbody>
  448. </table>
  449. <span class="small pull-right mobile-hide">
  450. <span class="divider">|</span>
  451. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils_VersionCompareNoPrerelease_SemVer_Version_SemVer_Version_.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils.VersionCompareNoPrerelease(SemVer.Version%2CSemVer.Version)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  452. </span>
  453. <span class="small pull-right mobile-hide">
  454. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L183">View Source</a>
  455. </span>
  456. <a id="IPA_Utilities_Utils_VersionCompareNoPrerelease_" data-uid="IPA.Utilities.Utils.VersionCompareNoPrerelease*"></a>
  457. <h4 id="IPA_Utilities_Utils_VersionCompareNoPrerelease_SemVer_Version_SemVer_Version_" data-uid="IPA.Utilities.Utils.VersionCompareNoPrerelease(SemVer.Version,SemVer.Version)">VersionCompareNoPrerelease(Version, Version)</h4>
  458. <div class="markdown level1 summary"><p>Compares a pair of <span class="xref">SemVer.Version</span>s ignoring both the prerelease and build fields.</p>
  459. </div>
  460. <div class="markdown level1 conceptual"></div>
  461. <h5 class="decalaration">Declaration</h5>
  462. <div class="codewrapper">
  463. <pre><code class="lang-csharp hljs">public static int VersionCompareNoPrerelease(Version l, Version r)</code></pre>
  464. </div>
  465. <h5 class="parameters">Parameters</h5>
  466. <table class="table table-bordered table-striped table-condensed">
  467. <thead>
  468. <tr>
  469. <th>Type</th>
  470. <th>Name</th>
  471. <th>Description</th>
  472. </tr>
  473. </thead>
  474. <tbody>
  475. <tr>
  476. <td><span class="xref">SemVer.Version</span></td>
  477. <td><span class="parametername">l</span></td>
  478. <td><p>the left value</p>
  479. </td>
  480. </tr>
  481. <tr>
  482. <td><span class="xref">SemVer.Version</span></td>
  483. <td><span class="parametername">r</span></td>
  484. <td><p>the right value</p>
  485. </td>
  486. </tr>
  487. </tbody>
  488. </table>
  489. <h5 class="returns">Returns</h5>
  490. <table class="table table-bordered table-striped table-condensed">
  491. <thead>
  492. <tr>
  493. <th>Type</th>
  494. <th>Description</th>
  495. </tr>
  496. </thead>
  497. <tbody>
  498. <tr>
  499. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.int32">Int32</a></td>
  500. <td><p>&lt; 0 if l is less than r, 0 if they are equal in the numeric portion, or &gt; 0 if l is greater than r</p>
  501. </td>
  502. </tr>
  503. </tbody>
  504. </table>
  505. </article>
  506. </div>
  507. <div class="hidden-sm col-md-2" role="complementary">
  508. <div class="sideaffix">
  509. <div class="contribution">
  510. <ul class="nav">
  511. <li>
  512. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Utils.md&amp;value=---%0Auid%3A%20IPA.Utilities.Utils%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
  513. </li>
  514. <li>
  515. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/098bf1888a224d49289736583cc5addcf20ddbbd/IPA.Loader/Utilities/Utils.cs/#L17" class="contribution-link">View Source</a>
  516. </li>
  517. </ul>
  518. </div>
  519. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  520. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  521. </nav>
  522. </div>
  523. </div>
  524. </div>
  525. </div>
  526. <footer>
  527. <div class="grad-bottom"></div>
  528. <div class="footer">
  529. <div class="container">
  530. <span class="pull-right">
  531. <a href="#top">Back to top</a>
  532. </span>
  533. <span>Generated by <strong>DocFX</strong></span>
  534. </div>
  535. </div>
  536. </footer>
  537. </div>
  538. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  539. <script type="text/javascript" src="../styles/docfx.js"></script>
  540. <script type="text/javascript" src="../styles/main.js"></script>
  541. </body>
  542. </html>