CFS is a serialization format that uses human-readable text to transmit key=)value pairs. The primary purpose is for passing large data sets between applications, but is not limited, and can be utilized in place of XML or JSON.
CFS is not bound to any particular language, however, in order for a language to use CFS must have both a parser and encoder for transmission.
CFS files are distinguished by the .cfs
file extension.
The first thing to understand about CFS is that it is strongly typed.
By default, CFS will handle every value as a string
unless otherwise indicated.
CFS currently supports the following data types:
String
Integer
Boolean
Object
Array
null
By default, CFS will handle every value as a string. What this means is that regardless of what type of value you may have - if you do not indicate it is of another data type, it will automatically be handled as a string.
With this, you no longer have a need to add quotes or any other characters to indicate its type.
(:
name =) Brandon Ryall
:)
In order for you to define an integer you must add a pound #
sign in front of the number.
(:
age =) #25
:)
To define a boolean within CFS, you must include a !
sign in front of your bool.
(:
over18 =) !true
:)
An object is defined by opening and closing parens + colon. An object may be defined as any value, but CFS requires that all CFS data structures also begin as an object.
(:
myObject =) (:
name =) Ralph Mancinelli
age =) 23
over18 =) !true
:)
:)
An array can be defined by opening and closing brackets + colon. An array can be defined as any value, however, it cannot be the start of a CFS data structure.
Array values also must be separated by a new line.
(:
myArray =) [:
Brandon
Ralph
Tony
Keith
:]
:)
In order to add a NULL value to your key, you must add the @
character in front of the null.
(:
myNull =) @null
:)