Files
tgstation-server/_platform_identifier_8cs_source.html

134 lines
14 KiB
HTML

<!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.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tgstation-server: src/Tgstation.Server.Host/System/PlatformIdentifier.cs 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>
<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="projectalign">
<div id="projectname">tgstation-server<span id="projectnumber">&#160;6.19.3</span>
</div>
<div id="projectbrief">The /tg/station 13 server suite</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @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&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_34761767c1c3cd212f9d2f80ea0828a8.html">Tgstation.Server.Host</a></li><li class="navelem"><a class="el" href="dir_3d220027e29e19c608b6d51ce3029c32.html">System</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">PlatformIdentifier.cs</div></div>
</div><!--header-->
<div class="contents">
<a href="_platform_identifier_8cs.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="keyword">using </span>System;</div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="keyword">using </span>System.Runtime.InteropServices;</div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="keyword">using </span>System.Runtime.Versioning;</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="keyword">namespace </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_system.html">Tgstation.Server.Host.System</a></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span>{</div>
<div class="foldopen" id="foldopen00008" data-start="{" data-end="};">
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html"> 8</a></span> <span class="keyword">sealed</span> <span class="keyword">class </span><a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html">PlatformIdentifier</a> : <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_system_1_1_i_platform_identifier.html">IPlatformIdentifier</a></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> [SupportedOSPlatformGuard(<span class="stringliteral">&quot;windows&quot;</span>)]</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#acb15bcd0271ceb5c551ee21293310d8f"> 12</a></span> <span class="keyword">public</span> <span class="keywordtype">bool</span> <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#acb15bcd0271ceb5c551ee21293310d8f">IsWindows</a> { <span class="keyword">get</span>; }</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#ad297b56dc4222debfe147d786e7c3c78"> 15</a></span> <span class="keyword">public</span> <span class="keywordtype">string</span> <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#ad297b56dc4222debfe147d786e7c3c78">ScriptFileExtension</a> { <span class="keyword">get</span>; }</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="}">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#ab29c252e971636fca5893880d01f9595"> 20</a></span> <span class="keyword">public</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#ab29c252e971636fca5893880d01f9595">PlatformIdentifier</a>()</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> <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#acb15bcd0271ceb5c551ee21293310d8f">IsWindows</a> = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#ad297b56dc4222debfe147d786e7c3c78">ScriptFileExtension</a> = <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#acb15bcd0271ceb5c551ee21293310d8f">IsWindows</a> ? <span class="stringliteral">&quot;bat&quot;</span> : <span class="stringliteral">&quot;sh&quot;</span>;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> }</div>
</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="foldopen" id="foldopen00027" data-start="{" data-end="}">
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#a63e9b75d329abb436267bea7496ffca9"> 27</a></span> <span class="keyword">public</span> <span class="keywordtype">string</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#a63e9b75d329abb436267bea7496ffca9">NormalizePath</a>(<span class="keywordtype">string</span> path)</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> ArgumentNullException.ThrowIfNull(path);</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">if</span> (<a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#acb15bcd0271ceb5c551ee21293310d8f">IsWindows</a>)</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> path = path.Replace(<span class="charliteral">&#39;\\&#39;</span>, <span class="charliteral">&#39;/&#39;</span>);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">return</span> path;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> }</div>
</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> }</div>
</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span>}</div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html">Tgstation.Server.Host.System.PlatformIdentifier</a></div><div class="ttdef"><b>Definition</b> <a href="_platform_identifier_8cs_source.html#l00008">PlatformIdentifier.cs:9</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier_html_a63e9b75d329abb436267bea7496ffca9"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#a63e9b75d329abb436267bea7496ffca9">Tgstation.Server.Host.System.PlatformIdentifier.NormalizePath</a></div><div class="ttdeci">string NormalizePath(string path)</div><div class="ttdoc">Normalize a path for consistency.The normalized path.</div><div class="ttdef"><b>Definition</b> <a href="_platform_identifier_8cs_source.html#l00027">PlatformIdentifier.cs:27</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier_html_ab29c252e971636fca5893880d01f9595"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#ab29c252e971636fca5893880d01f9595">Tgstation.Server.Host.System.PlatformIdentifier.PlatformIdentifier</a></div><div class="ttdeci">PlatformIdentifier()</div><div class="ttdoc">Initializes a new instance of the PlatformIdentifier class.</div><div class="ttdef"><b>Definition</b> <a href="_platform_identifier_8cs_source.html#l00020">PlatformIdentifier.cs:20</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier_html_acb15bcd0271ceb5c551ee21293310d8f"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#acb15bcd0271ceb5c551ee21293310d8f">Tgstation.Server.Host.System.PlatformIdentifier.IsWindows</a></div><div class="ttdeci">bool IsWindows</div><div class="ttdoc">If the current platform is a Windows platform.</div><div class="ttdef"><b>Definition</b> <a href="_platform_identifier_8cs_source.html#l00012">PlatformIdentifier.cs:12</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier_html_ad297b56dc4222debfe147d786e7c3c78"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_system_1_1_platform_identifier.html#ad297b56dc4222debfe147d786e7c3c78">Tgstation.Server.Host.System.PlatformIdentifier.ScriptFileExtension</a></div><div class="ttdeci">string ScriptFileExtension</div><div class="ttdoc">The extension of executable script files for the system.</div><div class="ttdef"><b>Definition</b> <a href="_platform_identifier_8cs_source.html#l00015">PlatformIdentifier.cs:15</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_system_1_1_i_platform_identifier_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_system_1_1_i_platform_identifier.html">Tgstation.Server.Host.System.IPlatformIdentifier</a></div><div class="ttdoc">For identifying the current platform.</div><div class="ttdef"><b>Definition</b> <a href="_i_platform_identifier_8cs_source.html#l00008">IPlatformIdentifier.cs:9</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_system_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_system.html">Tgstation.Server.Host.System</a></div><div class="ttdef"><b>Definition</b> <a href="_assembly_information_provider_8cs_source.html#l00008">AssemblyInformationProvider.cs:9</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>