This is the data-format-validation Reference Manual, version 0.2.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:52:23 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
data-format-validation
Validation and conversion between user and internal data.
Dr. John A.R. Williams
Dr. John A.R. Williams
GPL v3
0.2.0
cl-ppcre
(system).
defpackage.lisp
(file).
validation.lisp
(file).
parse-time.lisp
(file).
parse-number.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
data-format-validation/data-format-validation.asd
data-format-validation/defpackage.lisp
data-format-validation/validation.lisp
data-format-validation/parse-time.lisp
data-format-validation/parse-number.lisp
data-format-validation/data-format-validation.asd
data-format-validation
(system).
data-format-validation/defpackage.lisp
data-format-validation
(system).
data-format-validation/validation.lisp
defpackage.lisp
(file).
parse-number.lisp
(file).
parse-time.lisp
(file).
data-format-validation
(system).
*timezone*
(special variable).
date
(function).
duration
(function).
eng
(function).
equivalent
(generic function).
format-output
(generic function).
invalid-format
(condition).
invalid-format-reason
(reader method).
invalid-format-type
(reader method).
invalid-format-value
(reader method).
join-strings
(function).
parse-arguments
(function).
parse-input
(generic function).
parse-options
(function).
split-string
(function).
+engineering-units+
(special variable).
+month-names+
(special variable).
+roman-numeral-map+
(special variable).
+time-zones+
(special variable).
+week-days+
(special variable).
+ws+
(special variable).
format-time
(function).
invalid-format-error
(macro).
is-nil-string
(function).
lookup-field
(function).
data-format-validation/parse-time.lisp
defpackage.lisp
(file).
data-format-validation
(system).
*default-date-time-patterns*
(special variable).
*error-on-mismatch*
(special variable).
*http-date-time-patterns*
(special variable).
*month-strings*
(special variable).
*special-strings*
(special variable).
*weekday-strings*
(special variable).
*zone-strings*
(special variable).
am-pm
(function).
convert-to-unitime
(function).
copy-decoded-time
(function).
date-divider
(function).
date-dividers
(special variable).
day
(function).
deal-with-am-pm
(function).
deal-with-izone
(function).
deal-with-noon-midn
(function).
decoded-time
(structure).
decoded-time-day
(reader).
(setf decoded-time-day)
(writer).
decoded-time-dotw
(reader).
(setf decoded-time-dotw)
(writer).
decoded-time-hour
(reader).
(setf decoded-time-hour)
(writer).
decoded-time-minute
(reader).
(setf decoded-time-minute)
(writer).
decoded-time-month
(reader).
(setf decoded-time-month)
(writer).
decoded-time-p
(function).
decoded-time-second
(reader).
(setf decoded-time-second)
(writer).
decoded-time-year
(reader).
(setf decoded-time-year)
(writer).
decoded-time-zone
(reader).
(setf decoded-time-zone)
(writer).
decompose-string
(function).
hashlist
(macro).
hour
(function).
izone
(function).
make-decoded-time
(function).
make-default-time
(function).
match-pattern
(function).
match-pattern-element
(function).
match-substring
(function).
minute
(function).
month
(function).
month-table-size
(special variable).
noon-midn
(function).
now
(function).
parse-time
(function).
secondp
(function).
set-current-value
(function).
set-time-values
(function).
special-string-p
(function).
special-table-size
(special variable).
time-divider
(function).
time-dividers
(special variable).
today
(function).
tomorrow
(function).
weekday
(function).
weekday-table-size
(special variable).
whitespace-chars
(special variable).
year
(function).
yesterday
(function).
zone
(function).
zone-table-size
(special variable).
data-format-validation/parse-number.lisp
defpackage.lisp
(file).
data-format-validation
(system).
*white-space-characters*
(special variable).
invalid-number
(condition).
number-value
(function).
parse-integer-and-places
(function).
parse-integers
(function).
parse-number
(function).
parse-positive-real-number
(function).
parse-real-number
(function).
places
(function).
reason
(reader method).
value
(reader method).
white-space-p
(function).
Packages are listed by definition order.
data-format-validation
Exports API for validation and conversion of user data to internal types and back again.
dfv
cl-ppcre
.
common-lisp
.
*timezone*
(special variable).
date
(function).
duration
(function).
eng
(function).
equivalent
(generic function).
format-output
(generic function).
invalid-format
(condition).
invalid-format-reason
(generic reader).
invalid-format-type
(generic reader).
invalid-format-value
(generic reader).
join-strings
(function).
parse-arguments
(function).
parse-input
(generic function).
parse-options
(function).
split-string
(function).
*default-date-time-patterns*
(special variable).
*error-on-mismatch*
(special variable).
*http-date-time-patterns*
(special variable).
*month-strings*
(special variable).
*special-strings*
(special variable).
*weekday-strings*
(special variable).
*white-space-characters*
(special variable).
*zone-strings*
(special variable).
+engineering-units+
(special variable).
+month-names+
(special variable).
+roman-numeral-map+
(special variable).
+time-zones+
(special variable).
+week-days+
(special variable).
+ws+
(special variable).
am-pm
(function).
convert-to-unitime
(function).
copy-decoded-time
(function).
date-divider
(function).
date-dividers
(special variable).
day
(function).
deal-with-am-pm
(function).
deal-with-izone
(function).
deal-with-noon-midn
(function).
decoded-time
(structure).
decoded-time-day
(reader).
(setf decoded-time-day)
(writer).
decoded-time-dotw
(reader).
(setf decoded-time-dotw)
(writer).
decoded-time-hour
(reader).
(setf decoded-time-hour)
(writer).
decoded-time-minute
(reader).
(setf decoded-time-minute)
(writer).
decoded-time-month
(reader).
(setf decoded-time-month)
(writer).
decoded-time-p
(function).
decoded-time-second
(reader).
(setf decoded-time-second)
(writer).
decoded-time-year
(reader).
(setf decoded-time-year)
(writer).
decoded-time-zone
(reader).
(setf decoded-time-zone)
(writer).
decompose-string
(function).
format-time
(function).
hashlist
(macro).
hour
(function).
invalid-format-error
(macro).
invalid-number
(condition).
is-nil-string
(function).
izone
(function).
lookup-field
(function).
make-decoded-time
(function).
make-default-time
(function).
match-pattern
(function).
match-pattern-element
(function).
match-substring
(function).
minute
(function).
month
(function).
month-table-size
(special variable).
noon-midn
(function).
now
(function).
number-value
(function).
parse-integer-and-places
(function).
parse-integers
(function).
parse-number
(function).
parse-positive-real-number
(function).
parse-real-number
(function).
parse-time
(function).
places
(function).
reason
(generic reader).
secondp
(function).
set-current-value
(function).
set-time-values
(function).
special-string-p
(function).
special-table-size
(special variable).
time-divider
(function).
time-dividers
(special variable).
today
(function).
tomorrow
(function).
value
(generic reader).
weekday
(function).
weekday-table-size
(special variable).
white-space-p
(function).
whitespace-chars
(special variable).
year
(function).
yesterday
(function).
zone
(function).
zone-table-size
(special variable).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Default timezone for date handling
Formatter which formats a universal time for output as a date and time
Modifiers:
- os: an output stream designator
- arg: a universal time
- colon-p: a generalised boolean (default false).
If true use month and day names in date
- at-p: a generalised boolean (default false) - if true print in yyyy-mm-dd
(sortable) format rather than dd-mm-yyy
- precision: what precision to print it to. 6 is to the second,
7 includes timezone, a negative number counts backward.
- timezone: an integer (default nil).
If nil no timezone used and time is in current timezone
adjusted for daylight saving time.
Result:
nil
Examples:
(format nil "~/date/" (get-universal-time)) => "19-03-2009 08:30"
Formatter which outputs its numerical argument ‘arg‘ in engineering format
to stream ‘os‘.
It takes arguments d,padchar,exponentchar where
d is the number of decimal places to display after the decimal point
padchar is the character to pad the start of the number
exponentchar is the character to use to display between radix and exponent
It also takes the : modifier which will cause it to output the exponent
as an SI units prefix rather than a number.
Arguments:
- ‘os‘: an output stream designator
- ‘arg‘: a number
- ‘colon-p‘: a generalised boolean (default false)
- ‘at-p‘: a generalised boolean (default false) - if set right align field
- ‘d‘: an integer (default 2)
- ‘padchar‘: a character (default ‘space‘)
- ‘exponentchar‘: a character (default ‘e‘))
Result:
nil
Examples:
‘(format nil "~/eng/" 35000) => "35.00e+3"‘
Return a new string by joining together the STRINGS, separating each string with a SEPARATOR character or string
Parse a string of whitespace delimited arguments according to spec.
The specification is a list of entries each
of which lists the name, and optionally type and default values. The
output is an alist of variable names and parsed values.
If allow-spaces is true, last element can contain spaces
Parse an option list (alist of names and strings to be parsed) against a specification. The specification is a list of entries each of which lists the name, and optionally type and default values. The output is an alist of variable names and parsed values. Options in options-list not in spec are not returned and will signal an error unless allow-other-options is true
Split ‘string’ along whitespace as defined by the sequence ‘ws’. Whitespace which causes a split is elided from the result. The whole string will be split, unless ‘max’ is provided, in which case the string will be split into ‘max’ tokens at most, the last one containing the whole rest of the given ‘string’, if any.
Returns true if the parsed value input is
equivalent (equals) the reference value according to the stype
specification. If specification is a list the first element specifies
the actual validation method and the rest of the list are passed as
keyword arguments to the specific method.
(eql data-format-validation:dimensional-parameter)
) input reference &rest rest) ¶list
) input reference &rest rest) ¶(eql number)
) input reference &key tol &allow-other-keys) ¶Return a string representation of value formatted
according to a specification. If specification is a list the first
element specifies the actual validation method and the rest of the
list are passed as keyword arguments to the specific method e.g.
(format-output ’(date :fmt :rfc2822) (get-universal-time))
>"Mon, 10 Jul 2006 15:43:45 +00"
(eql data-format-validation:percentage)
) num &key places %-p mult) ¶Return a percentage value formatted for user output (default 0 places)
(eql data-format-validation:dimensional-parameter)
) value &key padchar decimal-places nil-allowed &allow-other-keys) ¶Output in engineering style with units. If units is a string then the output will contain that unit and the appropriate suffix. If t only the suffix is output. If nil no units or suffix is output
(eql bit-vector)
) (input bit-vector
) &key &allow-other-keys) ¶(eql data-format-validation:roman)
) (n integer
) &key &allow-other-keys) ¶convert integer to Roman numeral
(eql data-format-validation:eng)
) (value number
) &key units padchar decimal-places &allow-other-keys) ¶Output in engineering style with units. If units is a string then the output will contain that unit and the appropriate suffix. If t only the suffix is output. If nil no units or suffix is output
(eql data-format-validation:headers)
) (headers list
) &key field-specifications if-no-specification stream preserve-newlines-p) ¶(eql data-format-validation:time-period)
) (value number
) &key &allow-other-keys) ¶(eql member)
) output &key type) ¶(eql list)
) output &key type separator) ¶(eql read)
) output &key multiplep package) ¶Parse input using read. If multiple is true will read until finsihed, returning a list of values.
(eql integer)
) output &key format &allow-other-keys) ¶(eql number)
) output &key radix format &allow-other-keys) ¶(eql data-format-validation:date)
) output &key fmt zone if-nil &allow-other-keys) ¶(eql nil)
) output &key &allow-other-keys) ¶No validation - just output value
function
) output &key &allow-other-keys) ¶string
) output &key &allow-other-keys) ¶No validation - just output value
list
) output &rest rest) ¶Dispatch a list spec to appropriate method
(eql data-format-validation:separated)
) (value list
) &key separator type) ¶(eql boolean)
) input &key fmt &allow-other-keys) ¶invalid-format
)) ¶invalid-format
)) ¶type
.
invalid-format
)) ¶Validate and parse user input according to
specification, returning the validated object. Throws an invalid-format
condition if input is invalid. If specification is a list the first
element specifies the actual validation method and the rest of the
list are passed as keyword arguments to the specific method e.g.
(parse-input ’(integer :min 0) input)
will return the integer value from string if it is >0, or signal and
invalid-format condition if not.
(parse-input ’(member :type integer :set (1 5 7)) input)
will return it only if it has a value in the set.
The use-value restart may be used to provide substitute value if the input is invalid.
(eql data-format-validation:percentage)
) (value string
) &key min max nil-allowed &allow-other-keys) ¶(eql data-format-validation:dimensional-parameter)
) (value string
) &key &allow-other-keys) ¶(eql bit-vector)
) (input string
) &key &allow-other-keys) ¶(eql data-format-validation:roman)
) (s string
) &key &allow-other-keys) ¶Convert roman numeral to integer
(eql data-format-validation:eng)
) (value string
) &key units &allow-other-keys) ¶(eql data-format-validation:headers)
) (is stream
) &key skip-blanks-p field-specifications preserve-newlines-p termination-test if-no-specification &allow-other-keys) ¶(eql data-format-validation:headers)
) (p pathname
) &rest rest) ¶(eql data-format-validation:headers)
) (s string
) &rest rest) ¶(eql data-format-validation:time-period)
) (value string
) &key &allow-other-keys) ¶A time period in hours, minutes and (optionally) seconds
(eql data-format-validation:separated)
) (value sequence
) &key separator type) ¶(eql eval)
) (value string
) &key type package) ¶(eql read)
) (value string
) &key multiplep type package) ¶Parse input using read. If multiple is true will read until finished, returning a list of values. If type is set, then returned value(s) must be of this type
(eql data-format-validation:date)
) (input string
) &key nil-allowed zone patterns) ¶(eql list)
) input &key separator type min-length max-length) ¶Validates that a list of given of between min-length and max-length in length. Each member of list is validated against type
(eql data-format-validation:filename)
) value &key if-invalid replacement) ¶Return a safe filename from a string path value. May return an error or replace invalid characters.
(eql data-format-validation:pathnames)
) (input string
) &key must-exist wild-allowed nil-allowed) ¶(eql pathname)
) (input string
) &key must-exist wild-allowed nil-allowed) ¶(eql member)
) input &key type set test key) ¶(eql symbol)
) (input string
) &key nil-allowed package convert) ¶(eql string)
) s &key strip-return nil-allowed min-word-count max-word-count min-length max-length) ¶(eql number)
) (input string
) &key min max nil-allowed format radix rational-as-float-p coerce-to) ¶Real, integer or rational numbers
(eql integer)
) (input string
) &key min max nil-allowed radix) ¶(eql boolean)
) input &key &allow-other-keys) ¶function
) input &key &allow-other-keys) ¶Function - call it with data
(eql nil)
) input &key &allow-other-keys) ¶No validation - just return string
list
) input &rest rest) ¶Dispatch a list spec to appropriate method
symbol
) input &rest args) ¶condition
.
The type specification
common-lisp
.
(quote nil)
:type
This slot is read-only.
The value input
(quote nil)
:value
This slot is read-only.
Textual description of reason value is invalid.
(quote nil)
:reason
This slot is read-only.
If t, an error will be signalled if parse-time is unable to determine the time/date format of the string.
The names of the months.
The string representations of the time zones.
The names of the days of the week.
Bag of white space delimiter characters
Generate an invalid-format error for given value using reason
day
.
dotw
.
hour
.
year
.
zone
.
Formats a universal time for output.
OUT controls where the result will go. If OUT is T, then the output
is sent to the standard output stream. If it is NIL, then the output
is returned in a string as the value of the call. Otherwise, OUT must
be a stream to which the output will be sent.
UTIME is the universal time to be output (default is current time)
TZ is the time zone default will give local time.
FMT is a keyword symbol specifying which output format is used as follows
:RFC2822 - output as per RFC2822 for internet messages
:SHORT - output in a shorter format (same as :ISO)
:TIME-ONLY - outputs time as hh:mm:ss
:DATE-ONLY - outputs date as dd-mm-yyyy
:ISO - output as per ISO 8602
Given a string, and start, end, and radix parameters, produce a number according to the syntax definitions in the Common Lisp Hyperspec.
Given a string, and start, end, and radix parameters, produce a number according to the syntax definitions in the Common Lisp Hyperspec – except for complex numbers and negative numbers.
Given a string, and start, end, and radix parameters, produce a number according to the syntax definitions in the Common Lisp Hyperspec – except for complex numbers.
Tries very hard to make sense out of the argument time-string and returns a single integer representing the universal time if successful. If not, it returns nil. If the :error-on-mismatch keyword is true, parse-time will signal an error instead of returning nil. Default values for each part of the time/date can be specified by the appropriate :default- keyword. These keywords can be given a numeric value or the keyword :current to set them to the current value. The default-default values are 00:00:00 on the current date, current time-zone.
invalid-number
)) ¶invalid-number
)) ¶condition
.
structure-object
.
common-lisp
.
integer
0
integer
0
integer
0
integer
1
integer
1
integer
1900
(or rational null)
integer
0
Jump to: | (
A C D E F G H I J L M N P R S T V W Y Z |
---|
Jump to: | (
A C D E F G H I J L M N P R S T V W Y Z |
---|
Jump to: | *
+
D H M R S T V W Y Z |
---|
Jump to: | *
+
D H M R S T V W Y Z |
---|
Jump to: | C D F I P S V |
---|
Jump to: | C D F I P S V |
---|