(C) 1998 AROS - The Amiga Research OS


NAME
#include <proto/locale.h>

BOOL ParseDate (locale , date , fmtTemplate , getCharFunc)

LOCATION
In LocaleBase at offset 27

SYNOPSIS
struct Locale * locale
struct DateStamp * date
STRPTR fmtTemplate
struct Hook * getCharFunc

FUNCTION
This function will convert a stream of characters into an AmigaDOS DateStamp structure. It will obtain its characters from the getCharFunc callback hook, and the given formatting template will be used to direct the parse.

INPUTS
locale
the locale to use for the formatting
date
where to put the converted date. If this is NULL, then this function can be used to verify a date string.
fmtTemplate
the date template used to direct the parse of the data. The following FormatDate() formatting controls can be used: %a %A %b %B %d %e %h %H %I %m %M %p %S %y %Y

See FormatDate() autodoc for more information.

getCharFunc
A callback Hook which is used to read the data from a stream. The hook is called with:

A0 - address of the Hook structure A1 - locale pointer A2 - NULL

The read character should be returned in D0. Note that this is a 32 bit character not an 8 bit character. Return a NULL character if you reach the end of the stream.

RESULT
TRUE - If the parse could be performed. FALSE - If the format of the data did not match the formatting string.

EXAMPLE

SEE ALSO
FormatDate()

NOTES
This has a few differences from the implementation in locale.library v38. In particular: - %p does not have to be at the end of the line. - %d and %e are not effectively the same, ie %d requires a leading zero, but %e can not handle leading 0's.

BUGS
%d, %e probably needs some work.

INTERNALS

HISTORY
26.11.1998 iaint
Fixed a large number of errors. Even compiles now. Doesnt work though...
20.10.1998 hkiel
Amiga Research OS
16.08.1998 iaint
Initial - not working - locale.library. mmf.s is the meta makefile