-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a file format page to the docs
- Loading branch information
Showing
19 changed files
with
325 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Packaged data file format | ||
------------------------- | ||
|
||
Although the builder and loader for this format are implemented in Python, the format can of course be read by any languange. | ||
|
||
* ``0x00`` (8-byte unsigned little-endian int): Size of the file location header, in bytes, as stored in the file (i.e. after compression). | ||
* ``0x08`` (1-byte bool): Whether the header is compressed (not including these first 10 bytes, which are never compressed). | ||
* ``0x09`` (1-byte bool): Whether the file paths use crc32 encoding. | ||
* ``0x0A`` (UTF-8 string): The file location header, as JSON. | ||
* The rest is file data, placed end-to-end. | ||
|
||
File location header (JSON) | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: none | ||
{"folder\\file1.txt": | ||
[file location, relative to the end of the entire header (int), | ||
file size, after compression if enabled (int), | ||
file is compressed (bool), | ||
first byte of file (int), | ||
last byte of file (int)], | ||
"folder\\file2.txt": [...], ...} | ||
.. note:: | ||
This example is multi-line for readability, but the actual format has no newlines. | ||
|
||
.. note:: | ||
File paths are stored as actual double backslashes (``\\``). Python's JSON loader handles this automatically, make sure yours does or reformat the string. | ||
|
||
.. note:: | ||
If using crc32 file paths, they are stored as strings of integers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ Usage guide | |
:maxdepth: 2 | ||
|
||
guide/funcs | ||
guide/format | ||
|
||
Contribute | ||
---------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,241 @@ | ||
|
||
|
||
<!DOCTYPE html> | ||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> | ||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> | ||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<title>Packaged data file format — fast-package-file 1.1 documentation</title> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<script type="text/javascript" src="../_static/js/modernizr.min.js"></script> | ||
|
||
|
||
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> | ||
<script type="text/javascript" src="../_static/jquery.js"></script> | ||
<script type="text/javascript" src="../_static/underscore.js"></script> | ||
<script type="text/javascript" src="../_static/doctools.js"></script> | ||
<script type="text/javascript" src="../_static/language_data.js"></script> | ||
|
||
<script type="text/javascript" src="../_static/js/theme.js"></script> | ||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> | ||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> | ||
<link rel="index" title="Index" href="../genindex.html" /> | ||
<link rel="search" title="Search" href="../search.html" /> | ||
<link rel="prev" title="Function reference" href="funcs.html" /> | ||
</head> | ||
|
||
<body class="wy-body-for-nav"> | ||
|
||
|
||
<div class="wy-grid-for-nav"> | ||
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search" > | ||
|
||
|
||
|
||
<a href="../index.html" class="icon icon-home"> fast-package-file | ||
|
||
|
||
|
||
</a> | ||
|
||
|
||
|
||
|
||
<div class="version"> | ||
1.1 | ||
</div> | ||
|
||
|
||
|
||
|
||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
|
||
|
||
</div> | ||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<ul class="current"> | ||
<li class="toctree-l1"><a class="reference internal" href="funcs.html">Function reference</a></li> | ||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Packaged data file format</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="#file-location-header-json">File location header (JSON)</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
|
||
|
||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> | ||
|
||
|
||
<nav class="wy-nav-top" aria-label="top navigation"> | ||
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="../index.html">fast-package-file</a> | ||
|
||
</nav> | ||
|
||
|
||
<div class="wy-nav-content"> | ||
|
||
<div class="rst-content"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div role="navigation" aria-label="breadcrumbs navigation"> | ||
|
||
<ul class="wy-breadcrumbs"> | ||
|
||
<li><a href="../index.html">Docs</a> »</li> | ||
|
||
<li>Packaged data file format</li> | ||
|
||
|
||
<li class="wy-breadcrumbs-aside"> | ||
|
||
|
||
<a href="../_sources/guide/format.rst.txt" rel="nofollow"> View page source</a> | ||
|
||
|
||
</li> | ||
|
||
</ul> | ||
|
||
|
||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<div class="section" id="packaged-data-file-format"> | ||
<h1>Packaged data file format<a class="headerlink" href="#packaged-data-file-format" title="Permalink to this headline">¶</a></h1> | ||
<p>Although the builder and loader for this format are implemented in Python, the format can of course be read by any languange.</p> | ||
<blockquote> | ||
<div><ul class="simple"> | ||
<li><p><code class="docutils literal notranslate"><span class="pre">0x00</span></code> (8-byte unsigned little-endian int): Size of the file location header, in bytes, as stored in the file (i.e. after compression).</p></li> | ||
<li><p><code class="docutils literal notranslate"><span class="pre">0x08</span></code> (1-byte bool): Whether the header is compressed (not including these first 10 bytes, which are never compressed).</p></li> | ||
<li><p><code class="docutils literal notranslate"><span class="pre">0x09</span></code> (1-byte bool): Whether the file paths use crc32 encoding.</p></li> | ||
<li><p><code class="docutils literal notranslate"><span class="pre">0x0A</span></code> (UTF-8 string): The file location header, as JSON.</p></li> | ||
<li><p>The rest is file data, placed end-to-end.</p></li> | ||
</ul> | ||
</div></blockquote> | ||
<div class="section" id="file-location-header-json"> | ||
<h2>File location header (JSON)<a class="headerlink" href="#file-location-header-json" title="Permalink to this headline">¶</a></h2> | ||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>{"folder\\file1.txt": | ||
[file location, relative to the end of the entire header (int), | ||
file size, after compression if enabled (int), | ||
file is compressed (bool), | ||
first byte of file (int), | ||
last byte of file (int)], | ||
"folder\\file2.txt": [...], ...} | ||
</pre></div> | ||
</div> | ||
<div class="admonition note"> | ||
<p class="admonition-title">Note</p> | ||
<p>This example is multi-line for readability, but the actual format has no newlines.</p> | ||
</div> | ||
<div class="admonition note"> | ||
<p class="admonition-title">Note</p> | ||
<p>File paths are stored as actual double backslashes (<code class="docutils literal notranslate"><span class="pre">\\</span></code>). Python’s JSON loader handles this automatically, make sure yours does or reformat the string.</p> | ||
</div> | ||
<div class="admonition note"> | ||
<p class="admonition-title">Note</p> | ||
<p>If using crc32 file paths, they are stored as strings of integers.</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
</div> | ||
|
||
</div> | ||
<footer> | ||
|
||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> | ||
|
||
|
||
<a href="funcs.html" class="btn btn-neutral float-left" title="Function reference" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> | ||
|
||
</div> | ||
|
||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p> | ||
© Copyright 2019, Kataiser | ||
|
||
</p> | ||
</div> | ||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
|
||
</footer> | ||
|
||
</div> | ||
</div> | ||
|
||
</section> | ||
|
||
</div> | ||
|
||
|
||
|
||
<script type="text/javascript"> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
|
||
|
||
|
||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.