diff --git a/doc/highlight.pack.js b/doc/highlight.pack.js new file mode 100644 index 0000000..d45d419 --- /dev/null +++ b/doc/highlight.pack.js @@ -0,0 +1 @@ +var hljs=new function(){function k(v){return v.replace(/&/gm,"&").replace(//gm,">")}function t(v){return v.nodeName.toLowerCase()}function i(w,x){var v=w&&w.exec(x);return v&&v.index==0}function d(v){return Array.prototype.map.call(v.childNodes,function(w){if(w.nodeType==3){return b.useBR?w.nodeValue.replace(/\n/g,""):w.nodeValue}if(t(w)=="br"){return"\n"}return d(w)}).join("")}function r(w){var v=(w.className+" "+(w.parentNode?w.parentNode.className:"")).split(/\s+/);v=v.map(function(x){return x.replace(/^language-/,"")});return v.filter(function(x){return j(x)||x=="no-highlight"})[0]}function o(x,y){var v={};for(var w in x){v[w]=x[w]}if(y){for(var w in y){v[w]=y[w]}}return v}function u(x){var v=[];(function w(y,z){for(var A=y.firstChild;A;A=A.nextSibling){if(A.nodeType==3){z+=A.nodeValue.length}else{if(t(A)=="br"){z+=1}else{if(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);v.push({event:"stop",offset:z,node:A})}}}}return z})(x,0);return v}function q(w,y,C){var x=0;var F="";var z=[];function B(){if(!w.length||!y.length){return w.length?w:y}if(w[0].offset!=y[0].offset){return(w[0].offset"}function E(G){F+=""}function v(G){(G.event=="start"?A:E)(G.node)}while(w.length||y.length){var D=B();F+=k(C.substr(x,D[0].offset-x));x=D[0].offset;if(D==w){z.reverse().forEach(E);do{v(D.splice(0,1)[0]);D=B()}while(D==w&&D.length&&D[0].offset==x);z.reverse().forEach(A)}else{if(D[0].event=="start"){z.push(D[0].node)}else{z.pop()}v(D.splice(0,1)[0])}}return F+k(C.substr(x))}function m(y){function v(z){return(z&&z.source)||z}function w(A,z){return RegExp(v(A),"m"+(y.cI?"i":"")+(z?"g":""))}function x(D,C){if(D.compiled){return}D.compiled=true;D.k=D.k||D.bK;if(D.k){var z={};function E(G,F){if(y.cI){F=F.toLowerCase()}F.split(" ").forEach(function(H){var I=H.split("|");z[I[0]]=[G,I[1]?Number(I[1]):1]})}if(typeof D.k=="string"){E("keyword",D.k)}else{Object.keys(D.k).forEach(function(F){E(F,D.k[F])})}D.k=z}D.lR=w(D.l||/\b[A-Za-z0-9_]+\b/,true);if(C){if(D.bK){D.b=D.bK.split(" ").join("|")}if(!D.b){D.b=/\B|\b/}D.bR=w(D.b);if(!D.e&&!D.eW){D.e=/\B|\b/}if(D.e){D.eR=w(D.e)}D.tE=v(D.e)||"";if(D.eW&&C.tE){D.tE+=(D.e?"|":"")+C.tE}}if(D.i){D.iR=w(D.i)}if(D.r===undefined){D.r=1}if(!D.c){D.c=[]}var B=[];D.c.forEach(function(F){if(F.v){F.v.forEach(function(G){B.push(o(F,G))})}else{B.push(F=="self"?D:F)}});D.c=B;D.c.forEach(function(F){x(F,D)});if(D.starts){x(D.starts,C)}var A=D.c.map(function(F){return F.bK?"\\.?\\b("+F.b+")\\b\\.?":F.b}).concat([D.tE]).concat([D.i]).map(v).filter(Boolean);D.t=A.length?w(A.join("|"),true):{exec:function(F){return null}};D.continuation={}}x(y)}function c(S,L,J,R){function v(U,V){for(var T=0;T";U+=Z+'">';return U+X+Y}function N(){var U=k(C);if(!I.k){return U}var T="";var X=0;I.lR.lastIndex=0;var V=I.lR.exec(U);while(V){T+=U.substr(X,V.index-X);var W=E(I,V);if(W){H+=W[1];T+=w(W[0],V[0])}else{T+=V[0]}X=I.lR.lastIndex;V=I.lR.exec(U)}return T+U.substr(X)}function F(){if(I.sL&&!f[I.sL]){return k(C)}var T=I.sL?c(I.sL,C,true,I.continuation.top):g(C);if(I.r>0){H+=T.r}if(I.subLanguageMode=="continuous"){I.continuation.top=T.top}return w(T.language,T.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(V,U){var T=V.cN?w(V.cN,"",true):"";if(V.rB){D+=T;C=""}else{if(V.eB){D+=k(U)+T;C=""}else{D+=T;C=U}}I=Object.create(V,{parent:{value:I}})}function G(T,X){C+=T;if(X===undefined){D+=Q();return 0}var V=v(X,I);if(V){D+=Q();P(V,X);return V.rB?0:X.length}var W=z(I,X);if(W){var U=I;if(!(U.rE||U.eE)){C+=X}D+=Q();do{if(I.cN){D+=""}H+=I.r;I=I.parent}while(I!=W.parent);if(U.eE){D+=k(X)}C="";if(W.starts){P(W.starts,"")}return U.rE?0:X.length}if(A(X,I)){throw new Error('Illegal lexeme "'+X+'" for mode "'+(I.cN||"")+'"')}C+=X;return X.length||1}var M=j(S);if(!M){throw new Error('Unknown language: "'+S+'"')}m(M);var I=R||M;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D=w(K.cN,D,true)}}var C="";var H=0;try{var B,y,x=0;while(true){I.t.lastIndex=x;B=I.t.exec(L);if(!B){break}y=G(L.substr(x,B.index-x),B[0]);x=B.index+y}G(L.substr(x));for(var K=I;K.parent;K=K.parent){if(K.cN){D+=""}}return{r:H,value:D,language:S,top:I}}catch(O){if(O.message.indexOf("Illegal")!=-1){return{r:0,value:k(L)}}else{throw O}}}function g(y,x){x=x||b.languages||Object.keys(f);var v={r:0,value:k(y)};var w=v;x.forEach(function(z){if(!j(z)){return}var A=c(z,y,false);A.language=z;if(A.r>w.r){w=A}if(A.r>v.r){w=v;v=A}});if(w.language){v.second_best=w}return v}function h(v){if(b.tabReplace){v=v.replace(/^((<[^>]+>|\t)+)/gm,function(w,z,y,x){return z.replace(/\t/g,b.tabReplace)})}if(b.useBR){v=v.replace(/\n/g,"
")}return v}function p(z){var y=d(z);var A=r(z);if(A=="no-highlight"){return}var v=A?c(A,y,true):g(y);var w=u(z);if(w.length){var x=document.createElementNS("http://www.w3.org/1999/xhtml","pre");x.innerHTML=v.value;v.value=q(w,u(x),y)}v.value=h(v.value);z.innerHTML=v.value;z.className+=" hljs "+(!A&&v.language||"");z.result={language:v.language,re:v.r};if(v.second_best){z.second_best={language:v.second_best.language,re:v.second_best.r}}}var b={classPrefix:"hljs-",tabReplace:null,useBR:false,languages:undefined};function s(v){b=o(b,v)}function l(){if(l.called){return}l.called=true;var v=document.querySelectorAll("pre code");Array.prototype.forEach.call(v,p)}function a(){addEventListener("DOMContentLoaded",l,false);addEventListener("load",l,false)}var f={};var n={};function e(v,x){var w=f[v]=x(this);if(w.aliases){w.aliases.forEach(function(y){n[y]=v})}}function j(v){return f[v]||f[n[v]]}this.highlight=c;this.highlightAuto=g;this.fixMarkup=h;this.highlightBlock=p;this.configure=s;this.initHighlighting=l;this.initHighlightingOnLoad=a;this.registerLanguage=e;this.getLanguage=j;this.inherit=o;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.TM={cN:"title",b:this.IR,r:0};this.UTM={cN:"title",b:this.UIR,r:0}}();hljs.registerLanguage("d",function(x){var b={keyword:"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",built_in:"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short size_t string ubyte ucent uint ulong ushort wchar wstring",literal:"false null true"};var c="(0|[1-9][\\d_]*)",q="(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)",h="0[bB][01_]+",v="([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)",y="0[xX]"+v,p="([eE][+-]?"+q+")",o="("+q+"(\\.\\d*|"+p+")|\\d+\\."+q+q+"|\\."+c+p+"?)",k="(0[xX]("+v+"\\."+v+"|\\.?"+v+")[pP][+-]?"+q+")",l="("+c+"|"+h+"|"+y+")",n="("+k+"|"+o+")";var z="\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};";var m={cN:"number",b:"\\b"+l+"(L|u|U|Lu|LU|uL|UL)?",r:0};var j={cN:"number",b:"\\b("+n+"([fF]|L|i|[fF]i|Li)?|"+l+"(i|[fF]i|Li))",r:0};var s={cN:"string",b:"'("+z+"|.)",e:"'",i:"."};var r={b:z,r:0};var w={cN:"string",b:'"',c:[r],e:'"[cwd]?'};var f={cN:"string",b:'[rq]"',e:'"[cwd]?',r:5};var u={cN:"string",b:"`",e:"`[cwd]?"};var i={cN:"string",b:'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',r:10};var t={cN:"string",b:'q"\\{',e:'\\}"'};var e={cN:"shebang",b:"^#!",e:"$",r:5};var g={cN:"preprocessor",b:"#(line)",e:"$",r:5};var d={cN:"keyword",b:"@[a-zA-Z_][a-zA-Z_\\d]*"};var a={cN:"comment",b:"\\/\\+",c:["self"],e:"\\+\\/",r:10};return{l:x.UIR,k:b,c:[x.CLCM,x.CBLCLM,a,i,w,f,u,t,j,m,s,e,g,d]}}); diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..cd513a4 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,39 @@ + + + + + + +Index + + + + + +
+ + +
+ + + + + + + + diff --git a/doc/search.js b/doc/search.js new file mode 100644 index 0000000..89a7b15 --- /dev/null +++ b/doc/search.js @@ -0,0 +1,59 @@ +"use strict"; +var items = [ +{"tinyendian" : "tinyendian.html"}, +{"tinyendian.UTFEncoding" : "tinyendian/UTFEncoding.html"}, +{"tinyendian.swapByteOrder" : "tinyendian.html#swapByteOrder"}, +{"tinyendian.fixUTFByteOrder" : "tinyendian.html#fixUTFByteOrder"}, +]; +function search(str) { + var re = new RegExp(str.toLowerCase()); + var ret = {}; + for (var i = 0; i < items.length; i++) { + var k = Object.keys(items[i])[0]; + if (re.test(k.toLowerCase())) + ret[k] = items[i][k]; + } + return ret; +} + +function searchSubmit(value, event) { + console.log("searchSubmit"); + var resultTable = document.getElementById("results"); + while (resultTable.firstChild) + resultTable.removeChild(resultTable.firstChild); + if (value === "" || event.keyCode == 27) { + resultTable.style.display = "none"; + return; + } + resultTable.style.display = "block"; + var results = search(value); + var keys = Object.keys(results); + if (keys.length === 0) { + var row = resultTable.insertRow(); + var td = document.createElement("td"); + var node = document.createTextNode("No results"); + td.appendChild(node); + row.appendChild(td); + return; + } + for (var i = 0; i < keys.length; i++) { + var k = keys[i]; + var v = results[keys[i]]; + var link = document.createElement("a"); + link.href = v; + link.textContent = k; + link.attributes.id = "link" + i; + var row = resultTable.insertRow(); + row.appendChild(link); + } +} + +function hideSearchResults(event) { + if (event.keyCode != 27) + return; + var resultTable = document.getElementById("results"); + while (resultTable.firstChild) + resultTable.removeChild(resultTable.firstChild); + resultTable.style.display = "none"; +} + diff --git a/doc/show_hide.js b/doc/show_hide.js new file mode 100644 index 0000000..ab7a50c --- /dev/null +++ b/doc/show_hide.js @@ -0,0 +1,17 @@ +window.onload = function(e) +{ + var elems = document.querySelectorAll( "div.toc ul ul" ); + for( i in elems ) + { + if( elems[i].style.display != "block" ) + elems[i].style.display = "none"; + } +} + +function show_hide(id) +{ + var elem = document.getElementById( id ); + if( elem.style.display == "block" ) + elem.style.display = "none"; + else elem.style.display = "block"; +} diff --git a/doc/style.css b/doc/style.css new file mode 100644 index 0000000..769e7d3 --- /dev/null +++ b/doc/style.css @@ -0,0 +1,726 @@ +html { + font-family: Verdana, "DejaVu Sans", sans; + margin: 0; + padding: 0; + background-color: #333; + border-left: .2em solid #333; + border-right: .2em solid #333; + min-height: 100%; +} + +body { + margin: 0; + padding: 0; +} + +div.main { + overflow: hidden; + background-color: #F8F8F8; +} + + + +/**** BREADCRUMBS ****/ + +div.breadcrumbs { + color: white; + background-color: #333; + padding: 1.0em 0.5em 0.0em 0.5em; + left: 0; + box-sizing: border-box; + text-align: right; + top: 0; + width: 100%; + height: 48px; + font-size: 95%; + + position: fixed; +} + +div.breadcrumbs a { + color: white; +} + +div.breadcrumbs span.highlight, div.breadcrumbs span a { + color: #DAAF07; +} + +div.breadcrumbs input { + width: 7em; + margin-top: -0.1em; +} + +div.breadcrumbs small { + font-size: 0.8em; +} + +/** narrow screen hacks **/ +@media only screen and (max-width: 1000px) +{ + div.breadcrumbs span, div.breadcrumbs small { + font-size: 80%; + } +} +@media only screen and (max-width: 800px) +{ + div.breadcrumbs small { + display: none; + position: fixed; + } + div.breadcrumbs span { + font-size: 75%; + } +} +@media only screen and (max-width: 600px) +{ + div.breadcrumbs span { + font-size: 65%; + } +} + +div.breadcrumbs a.home { + float: left; + font-weight: bold; + font-size: 200%; + margin: 0 2% 0 0%; + margin-top: -0.3em; + text-decoration: none; +} + +div.breadcrumbs input { + float: left; +} + + +/* anchors need to compensate for the fixed-pos breadcrumbs */ +a.anchor +{ + display: block; + position: relative; + top: -48px; + visibility: hidden; +} + +/** SEARCH RESULTS **/ +#results { + position: absolute; + max-height: 30em; + background-color: #eee; + box-shadow: 0 .25em .25em black; + display: none; + text-align: left; + color: black; + margin-top: 2em; + font-size: 70%; + z-index: 1000; + overflow-y: scroll; +} + +#results a { + color: blue; +} + + +/**** SIDEBAR, TABLE OF CONTENTS ****/ + +div.sidebar { + margin-top: 48px; + float: left; + margin-right: -1px; + border-right: 1px solid #D0D0D0; + background-color: #F8F8F0; +} + + +div.toc { + padding: 1.5em 0.75em 1em 0.5em; + font-size: 0.55em; + line-height: 1.95em; + display:block; +} + +@media only screen and (max-width: 800px) +{ + div.toc { + font-size: 0.5em; + padding: 1.5em 0.4em 1em 0.2em; + } +} + + +/* stuff for showing/hiding the sidebar */ +.hide, .show { + display: block; + float: right; + border-right: 1px solid #D0D0D0; + border-bottom: 1px solid #D0D0D0; + border-left: 1px solid #D0D0D0; + /* to avoid having double border */ + margin-right: -1px; + font-size: 1.1em; + padding: 0 0.6em; +} +a.hide, a.show { + color: #111; + text-decoration: none; +} +.hide { + background-color: #F8F8F8; + border-bottom-left-radius:3px; + border-right: 1px solid #F8F8F8; +} +.show { + background-color: #F8F8F0; + border-bottom-right-radius:3px; + display: none; +} +.hide:target + .show { + display: inline; + position: absolute; +} +.hide:target { + display: none; +} +.hide:target ~ .toc { + display:none; +} + + +div.toc .toc-additional { + border-bottom: 1px dashed #333; + line-height: 1.5em; +} + +div.toc .toc-additional p, div.toc .toc-additional ul { + margin: 0.4em 0; +} + +div.toc ul { + list-style-type: none; + padding-left: 0; + padding-bottom: 0.5em; +} + +div.toc ul ul { + list-style-type: none; + padding-left: 0.5em; +} + + +div.toc a { + color: #111; + font-size: 1.25em; +} + +@media only screen and (max-width: 800px) +{ + div.toc ul ul { + padding-left: 0.2em; + } +} + +div.toc span.package { + cursor: pointer; + line-height: 1.8em; + font-weight: bold; + border: 1px solid rgba(0, 0, 0, 0.12); + border-radius: 2px; + background-color: #F0F0F0; + font-size: 1.25em; + padding: 0 0.2em; + /* counteracts the text movement caused by the padding */ + margin: 0 -0.2em; +} + +div.toc span.package a { + font-size: 1em; +} + +/* Highlight the current module/package */ +div.toc .selected { + border-radius: 2px; + background-color: #DAAF07 !important; + padding: 0.325em 0.2em; + /* counteracts the text movement caused by the padding */ + margin: -0.325em -0.2em; +} + + + +/**** MAIN CONTENT ****/ + +div.content { + margin-top: 48px; + padding: 1.5em; + font-size: 90%; + line-height: 130%; + overflow: hidden; + border-left: 1px solid #D0D0D0; +} +@media only screen and (max-width: 800px) +{ + div.content { + font-size: 82%; + } +} +@media only screen and (max-width: 600px) +{ + div.content { + font-size: 70%; + padding: 1.5em 0.3em 1.5em 0.5em; + } +} + +div.content h2 { + margin: .35em 0 .45em 0; + padding-top: .35em; + font-size: 1.3em; +} + +div.content h3 { + font-size: 1.1em; +} + +div.content tr { + margin: 0; +} + +div.content table { + border-collapse: collapse; + border-bottom: 1px dashed #333; + font-size: 90%; + line-height: 130%; + margin: 1em 0; +} + +div.content td { + border-top: 1px dashed #333; + margin: 0; + padding: .32em; +} + +div.content td:first-child { + text-align: center; +} + +/* prevent function attribs from wrapping, make the cell wider instead */ +div.content td:first-child * { + white-space: nowrap +} + +/* The first markdown-generated paragraph in e.g. Params tables shouldn't add any vertical + * space + */ +div.content td p:first-child { + margin: 0; +} + +div.content p strong { + font-size: 92%; +} + +.paramName { + font-weight: bold; + width: 6em; +} + +div.section { + padding: 0; + margin: 0; +} + + + +/**** EXTRA INFO IN FUNCTION/CLASS/ETC LISTS ****/ + +div.content td .extrainfo{ + display: block; + line-height: 105%; + font-family: monospace; + font-size: 85%; + text-align: center; +} + +.extrainfo div { + display: block; + margin: 0; +} + +.extrainfo .attr-const { color: blueviolet; } +.extrainfo .attr-pure { color: darkslategray; } +.extrainfo .attr-nothrow { color: brown; } +.extrainfo .attr-nogc { color: darkgreen; } +.extrainfo .attr-safe { color: darkblue; } +.extrainfo .attr-trusted { color: firebrick; } +.extrainfo .attr-system { color: darkred; } +.extrainfo .attr-final { color: darkolivegreen; } +.extrainfo .attr-ref { color: fuchsia; } + + +/**** SYMBOLS (not used by the one-file-for-every-variable writer backend) ****/ + +div.aggregate-symbol { + display: flex; + flex-direction: column; + display: -webkit-flex; + -webkit-flex-direction: column; +} + +div.aggregate-symbol div.description { + order: -2; + -webkit-order: -2; +} + +div.aggregate-symbol div.members { + order: -1; + -webkit-order: -1; + padding-bottom: 0.3em; + border-bottom: 10px solid #333; + margin: 1em 0em 1.5em 0em; +} + +div.symbol { + border-radius: 3px; + border: 1px solid #d0d0d0; + padding: 1px 0.4em; + margin: 0.5em 0; +} + +a.anchor:target + div.symbol { + border: 2px solid #DAAF07; + border-radius: 0; + background-color: #F8F8F0; +} + + + +/**** SECTION-SPECIFIC STYLES ****/ + +.section.seealso, .section.note, .section.imports { + font-size: 75%; + line-height: 135%; + /* background-color: #F0F0C0; */ + /* background-color: #DA7F07; */ + /* background-color: #DA8F07; */ + /* background-color: #DA9F07; */ + background-color: #DAAF07; + /* background-color: #EABD08; */ + padding: 1em; + margin-bottom: 0.5em; +} + +.section.seealso h2, .section.note h2 { + display: block; + float: left; + margin: 0 0.7em -0.05em 0em; + padding: 0; + font-size: 1.1em; +} + +.section.imports h2 { + display: inline; + margin: 0.5em 0em; + padding: 0; + font-size: 1.1em; +} + +.section.seealso div.seealso-content, .section.note div.note-content { + display: block; + margin-left: 6.5em; +} + +.section.imports ul { + margin: 0; + list-style-type: none; + padding-left: 1.5em; + + -moz-column-count: 4; + -moz-column-gap: 20px; + -webkit-column-count: 4; + -webkit-column-gap: 20px; + column-count: 4; + column-gap: 20px; +} + +@media only screen and (max-width: 1400px) +{ + .section.imports ul { + -moz-column-count: 3; + -moz-column-gap: 20px; + -webkit-column-count: 3; + -webkit-column-gap: 20px; + column-count: 3; + column-gap: 20px; + } +} + +@media only screen and (max-width: 1100px) +{ + .section.imports ul { + -moz-column-count: 2; + -moz-column-gap: 13px; + -webkit-column-count: 2; + -webkit-column-gap: 13px; + column-count: 2; + column-gap: 13px; + } +} + +@media only screen and (max-width: 800px) +{ + .section.imports ul { + -moz-column-count: 1; + -moz-column-gap: 7px; + -webkit-column-count: 1; + -webkit-column-gap: 7px; + column-count: 1; + column-gap: 7px; + } +} + + +.section.imports ul a { + color: #111; +} + + +.section.seealso *:first-child, .section.note *:first-child { + margin-top: 0em; +} + +.section.seealso ul, .section.note ul { + padding-left: 1.5em; +} + +.section.seealso *:last-child, .section.note *:last-child { + margin-bottom: 0em; +} + +/**** FOOTER ****/ + +footer +{ + text-align: center; + font-size: 60%; + color: white; + background-color: #333; +} + +footer a +{ + color: white; +} + + + +/**** CODE ****/ + +pre { + margin-top: 0.4em; +} + +/* DDoc code examples */ +code { + background-color: #333; + color: #eee; + padding: 0.8em; + border-radius: .1em; + display: block; +} + +code a { + color: white; + text-decoration: none; + border-bottom: 1px dotted #888; +} + +/* hmod/libddoc errors */ +div.error { + color: darkred; +} + +/* Markdown inline code and $(D code) */ +code.prettyprint, .d_inlinecode { + font-family: monospace; + color: #333; + background-color:rgba(0,0,0,0.04); + border-radius: .15em; + border: 1px solid #C0C0C0; + padding: 0.22em; + display: inline; +} + +code.prettyprint a { + color: black; + border-color: #777; +} + +/*do not affect the first
, which is not in a section*/
+div.section pre > code {
+	margin: .5em;
+	border-radius: .1em;
+	padding: 0.8em;
+}
+
+div.section td pre {
+	margin: 0;
+	padding: 0;
+}
+
+
+div.section td code:not(.prettyprint) {
+	margin: 0;
+	padding: 0.6em;
+}
+
+.hljs {
+	display: block; padding: 1em;
+	background: #282B2E;
+	overflow-x: auto;
+	display: block;
+}
+
+.hljs-keyword,
+.hljs-literal,
+.hljs-change,
+.hljs-winutils,
+.hljs-flow,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title,
+.css .hljs-id,
+.tex .hljs-special {
+	color: #93C763;
+}
+
+.hljs-number {
+	color: #FFCD22;
+}
+
+.hljs {
+	color: #E0E2E4;
+}
+
+.css .hljs-tag,
+.css .hljs-pseudo {
+	color: #D0D2B5;
+}
+
+.hljs-attribute,
+.hljs .hljs-constant {
+	color: #668BB0;
+}
+
+.xml .hljs-attribute {
+	color: #B3B689;
+}
+
+.xml .hljs-tag .hljs-value {
+	color: #E8E2B7;
+}
+
+.hljs-code,
+.hljs-class .hljs-title,
+.hljs-header {
+	color: white;
+}
+
+.hljs-class,
+.hljs-hexcolor {
+	color: #93C763;
+}
+
+.hljs-regexp {
+	color: #D39745;
+}
+
+.hljs-at_rule,
+.hljs-at_rule .hljs-keyword {
+	color: #A082BD;
+}
+
+.hljs-doctype {
+	color: #557182;
+}
+
+.hljs-link_url,
+.hljs-tag,
+.hljs-tag .hljs-title,
+.hljs-bullet,
+.hljs-subst,
+.hljs-emphasis,
+.haskell .hljs-type,
+.hljs-preprocessor,
+.hljs-pragma,
+.ruby .hljs-class .hljs-parent,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.django .hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-javadoc,
+.django .hljs-filter .hljs-argument,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-addition,
+.hljs-stream,
+.hljs-envvar,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.tex .hljs-command,
+.hljs-prompt {
+	color: #8CBBAD;
+}
+
+.hljs-string {
+	color: #EC7600;
+}
+
+.hljs-comment,
+.java .hljs-annotation,
+.hljs-blockquote,
+.hljs-horizontal_rule,
+.python .hljs-decorator,
+.hljs-template_comment,
+.hljs-pi,
+.hljs-deletion,
+.hljs-shebang,
+.apache .hljs-sqbracket,
+.tex .hljs-formula {
+	color: #818E96;
+}
+
+.hljs-keyword,
+.hljs-literal,
+.css .hljs-id,
+.hljs-phpdoc,
+.hljs-title,
+.hljs-header,
+.haskell .hljs-type,
+.vbscript .hljs-built_in,
+.sql .hljs-aggregate,
+.rsl .hljs-built_in,
+.smalltalk .hljs-class,
+.diff .hljs-header,
+.hljs-chunk,
+.hljs-winutils,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.tex .hljs-special,
+.hljs-request,
+.hljs-at_rule .hljs-keyword,
+.hljs-status {
+	font-weight: bold;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+	opacity: 0.5;
+}
diff --git a/doc/tinyendian.html b/doc/tinyendian.html
new file mode 100644
index 0000000..be69219
--- /dev/null
+++ b/doc/tinyendian.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+tinyendian
+
+
+
+
+
+
+
tinyendian

A minimal library providing functionality for changing the endianness of data. +

+
+ +tinyendian +
+ +
+
public @system pure nothrow @nogc void swapByteOrder(T)(T[] array) 
+if([2, 4].canFind(T.sizeof))
+
+

Swap byte order of items in an array in place. +

+ + +
+

Parameters

+ + + +
T

Item type. Must be either 2 or 4 bytes long. +

+
array

Buffer with values to fix byte order of. +

+
+
+
public @system pure nothrow @nogc auto fixUTFByteOrder(ubyte[] array)
+
+

Convert byte order of an array encoded in UTF(8/16/32) to system endianness in place. +

+ + +
+

Uses the UTF byte-order-mark (BOM) to determine UTF encoding. If there is no BOM + at the beginning of array, UTF-8 is assumed (this is compatible with ASCII). The + BOM, if any, will be removed from the buffer. +

+

If the encoding is determined to be UTF-16 or UTF-32 and there aren't enough bytes + for the last code unit (i.e. if array.length is odd for UTF-16 or not divisible by + 4 for UTF-32), the extra bytes (1 for UTF-16, 1-3 for UTF-32) are stripped. +

+

Note that this function does not check if the array is a valid UTF string. It + only works with the BOM and 1,2 or 4-byte items. +

+ + +
+

Parameters

+ + +
array

The array with UTF-data. +

+
+
+

Returns

+

A struct with the following members: +

+

ubyte[] array A slice of the input array containing data in correct + byte order, without BOM and in case of UTF-16/UTF-32, + without stripped bytes, if any. + UTFEncoding encoding Encoding of the result (UTF-8, UTF-16 or UTF-32) + std.system.Endian endian Endianness of the original array. + uint bytesStripped Number of bytes stripped from a UTF-16/UTF-32 array, if + any. This is non-zero only if array.length was not + divisible by 2 or 4 for UTF-16 and UTF-32, respectively. +

+ + +
+

Complexity

+

(BIGOH array.length) +

+ + +
+

A minimal library providing functionality for changing the endianness of data. +

+ + +
+

Enums

UTFEncoding

Unicode UTF encodings. +

+

Functions

swapByteOrder

Swap byte order of items in an array in place. +

+
autofixUTFByteOrder

Convert byte order of an array encoded in UTF(8/16/32) to system endianness in place. +

+
+
+
+ +
+ +
+ + diff --git a/doc/tinyendian/UTFEncoding.html b/doc/tinyendian/UTFEncoding.html new file mode 100644 index 0000000..0cde8fc --- /dev/null +++ b/doc/tinyendian/UTFEncoding.html @@ -0,0 +1,46 @@ + + + + + + +UTFEncoding + + + + + +
+ + +
+
public enum UTFEncoding : ubyte
+
+

Unicode UTF encodings. +

+ + +
+

Values

UTF_8
UTF_16
UTF_32
+
+
+ +
+ +
+ +