diff --git a/FileSystem/7ZDataFormat.7z b/FileSystem/7ZDataFormat.7z new file mode 100644 index 0000000..f420496 Binary files /dev/null and b/FileSystem/7ZDataFormat.7z differ diff --git a/FileSystem/CPIODataFormat.cpio b/FileSystem/CPIODataFormat.cpio new file mode 100644 index 0000000..443af49 Binary files /dev/null and b/FileSystem/CPIODataFormat.cpio differ diff --git a/FileSystem/TARDataFormat.tar b/FileSystem/TARDataFormat.tar new file mode 100644 index 0000000..190e01a Binary files /dev/null and b/FileSystem/TARDataFormat.tar differ diff --git a/FileSystem/TarXzDataFormat.tar.xz b/FileSystem/TarXzDataFormat.tar.xz new file mode 100644 index 0000000..20887b6 Binary files /dev/null and b/FileSystem/TarXzDataFormat.tar.xz differ diff --git a/FileSystem/ZIPDataFormat.zip b/FileSystem/ZIPDataFormat.zip new file mode 100644 index 0000000..e25878f Binary files /dev/null and b/FileSystem/ZIPDataFormat.zip differ diff --git a/Markup/SXML/README b/Markup/SXML/README new file mode 100644 index 0000000..2c772b7 --- /dev/null +++ b/Markup/SXML/README @@ -0,0 +1,6 @@ +https://en.wikipedia.org/wiki/SXML + +The SXMLDataFormat should inherit from +SymbolicExpressionDataFormat so we can +take advantage of only having to write +S-expr parsing once! diff --git a/Markup/SXML/example1.html b/Markup/SXML/example1.html new file mode 100644 index 0000000..c490d94 --- /dev/null +++ b/Markup/SXML/example1.html @@ -0,0 +1,11 @@ + + + An example page + + +

Hi, there!

+

This is just an ">>example<<" to show XHTML & SXML.

+ + + diff --git a/Markup/SXML/example1.sxml b/Markup/SXML/example1.sxml new file mode 100644 index 0000000..1724e41 --- /dev/null +++ b/Markup/SXML/example1.sxml @@ -0,0 +1,7 @@ + (*TOP* (@ (*NAMESPACES* (x "http://www.w3.org/1999/xhtml"))) + (x:html (@ (xml:lang "en") (lang "en")) + (x:head + (x:title "An example page")) + (x:body + (x:h1 (@ (id "greeting")) "Hi, there") + (x:p "This is just an \">>example<<\" to show XHTML & SXML.")))) diff --git a/Markup/SXML/example2.sxml b/Markup/SXML/example2.sxml new file mode 100644 index 0000000..cceb2a0 --- /dev/null +++ b/Markup/SXML/example2.sxml @@ -0,0 +1,5 @@ +(tag (@ (attr1 "value1") + (attr2 "value2")) + (nested "Text node") + (empty)) + \ No newline at end of file diff --git a/Markup/SXML/example2.xml b/Markup/SXML/example2.xml new file mode 100644 index 0000000..9c35778 --- /dev/null +++ b/Markup/SXML/example2.xml @@ -0,0 +1,5 @@ + + Text node + + \ No newline at end of file diff --git a/Markup/TODO b/Markup/TODO new file mode 100644 index 0000000..6b6f808 --- /dev/null +++ b/Markup/TODO @@ -0,0 +1,33 @@ +SOX - Simple Outline XML +https://en.wikipedia.org/wiki/Simple_Outline_XML + +writing: +html> + xmlns=http://www.w3.org/1999/xhtml + head> + title> Sample page + body> + p> A very brief page + +results in: + + + Sample page + + +

A very brief page

+ + + + +HAML - a compact form of XML/HTML +https://en.wikipedia.org/wiki/Haml + +writing: +%p{:class => "sample", :id => "welcome"} Hello, World! +- or - +%p.sample#welcome Hello, World! + +results in: +

Hello, World!

+ diff --git a/Markup/XML/XMLDataFormat.xml b/Markup/XML/XMLDataFormat.xml new file mode 100644 index 0000000..d7c81ae --- /dev/null +++ b/Markup/XML/XMLDataFormat.xml @@ -0,0 +1,39 @@ + + + + + + + + +] +> + + + Example XML File + + + + +

Define your auto-closing tags (like BR, HR, and P) in XMLDataFormat.AutoCloseTagNames

+
Yes, the case mismatch is intentional here, even though it drives my OCD mad
+
+ + + + <% + // example Preprocessor Directive section with type ASP.NET (%) + // anything can go here as well, just make sure you register your + // custom preprocessor directive prefix in XMLDataFormat.PreprocessorDirectives! + %> +
+
\ No newline at end of file diff --git a/PropertyList/ExtendedINIDataFormat.xni b/PropertyList/ExtendedINIDataFormat.xni new file mode 100644 index 0000000..f55a397 --- /dev/null +++ b/PropertyList/ExtendedINIDataFormat.xni @@ -0,0 +1,38 @@ +// Extended INI Data Format +// One of my very first custom data formats +// +// I needed something quick and easy, but more versatile +// than plain-old INI. So I decided to combine C-like +// syntax and INI properties; this was the result. +group1 +{ + groups can be nested { + // make sure inline braces get parsed correctly + nested key=nested value + + semicolons are optional=but they could be parsed; to allow multiple keys=on the same line + // end of lines automatically end the property, just like plain INI + } + + the sky's the limit + { + here's another one + { + oh boy + { + and yes=all the spaces should be preserved! + } + } + } +} + +// new to this version of Editor, we should support syntax like this: +lazy_list_test +{ + value 1 + value 2 + value 3 +} + +// this would simply create three properties with those names, and NULL as their value +// some C-like configuration languages use this syntax to declare stuff diff --git a/PropertyList/INIDataFormat.ini b/PropertyList/INIDataFormat.ini new file mode 100644 index 0000000..43125a8 --- /dev/null +++ b/PropertyList/INIDataFormat.ini @@ -0,0 +1,18 @@ +[Section] +# Key Comment, can be ignored or preserved +Key1=Value1 +Key2="Quoted values should preserve spaces, remove quotes" +Key3=Unquoted values probably should preserve spaces too +InlineKeyComment=Value # not sure what GetPrivateProfileString does here + +# Section Comment +# Comments may be ignored, or preserved +[Section with Spaces which should be Preserved] +Section2Key1=Value2 +StronglyTypedTestInt32=2 # this should be cast to Int32 +StronglyTypedTestDouble=3.5 +StronglyTypedTestBoolean=false + +[FakeHierarchy:ConfigurableSeparator:Section] +WeCanDoThat=Too! +Can keys have spaces?=Probably, why not? diff --git a/PropertyList/JSONDataFormat.json b/PropertyList/JSONDataFormat.json new file mode 100644 index 0000000..6c8c144 --- /dev/null +++ b/PropertyList/JSONDataFormat.json @@ -0,0 +1,16 @@ +// JSON does not technically support comments, but this is our own parser, so who cares :) +{ + "key": "string value", + "bool": true, + "int32": 32046, + "double": 32.91568, + "array": [ + "hi", + "arrays aren't type safe", + 42 + ], + "nested object": { + "oops": "I did it again", + "nested array": [ 2, 4, 6, 8, "who do we appreciate?" ] + } +} diff --git a/mkfs.examples b/mkfs.examples new file mode 100755 index 0000000..0431f30 --- /dev/null +++ b/mkfs.examples @@ -0,0 +1,35 @@ +#!/bin/bash + +# This script was used to generate FileSystem example archives +# Until it occurred to me that on platforms other than Linux +# these utilities are not really that easily useful... :( + +FILELIST="Markup/XML/XMLDataFormat.xml Markup/TODO LICENSE README.md" + +if [ ! -d FileSystem ]; then + mkdir FileSystem +fi + +echo $FILELIST + +echo "Generating PKZIP example archive..." +zip ZIPDataFormat.zip $FILELIST + +echo "Generating 7-Zip example archive..." +7z a 7ZDataFormat.7z $FILELIST + +echo "Generating CPIO example archive..." +echo $FILELIST | tr ' ' '\n' > filelist.tmp +cpio -v --create < filelist.tmp > CPIODataFormat.cpio +rm filelist.tmp + +echo "Generating TAR example archive..." +tar cfv TARDataFormat.tar $FILELIST + +mv ./ZIPDataFormat.zip ./FileSystem +mv ./7ZDataFormat.7z ./FileSystem +mv ./CPIODataFormat.cpio ./FileSystem +mv ./TARDataFormat.tar ./FileSystem + +cp ./FileSystem/TARDataFormat.tar ./FileSystem/TarXzDataFormat.tar +xz ./FileSystem/TarXzDataFormat.tar