- extras/hbdoc/_tmplate.prg
- extras/hbdoc/hbdoc.ch
* extras/hbdoc/_genbase.prg
* extras/hbdoc/_genhtml.prg
* extras/hbdoc/_gentxt.prg
* extras/hbdoc/_genxml.prg
* extras/hbdoc/hbdoc.hbp
* extras/hbdoc/hbdoc.prg
+ improve readability by paragraphs spacing in DESCRIPTION sections
+ improve divs in section content for better control via CSS
+ improve readability of tables with borders and
header hightlights
* change default output to single-file
+ add support for the old <table>/<fixed> tags in html output until they
are converted to something better
+ add support for <b>/<b>, <URL:url>, Markdown `inline code`,
_emphasis_, *bold*, character escaping \*, line separators ===/---,
and fenced code using triple backticks.
Very limited and not with standard compliance or completeness
in mind, just to be able to use some basic formatting.
; TODO: Markdown URL and lists, then replace all <b>,<URL>,<fixed>
markup with Markdown equivalents in docs
+ better localization support
+ add support for one file per component output via -output-component
cmdline option
% assemble output in memory and write to disk in a single call
% integrate external header
% replace almost all internal arrays with hashes
% replace self-modifying class and macro expansion with
regular hashes
% internal cleanups
% switch to simpler method for sort weighting
+ merge category/subcategory values into tag list. It
means they will be now be included in the output
% cleanup/fix/simplify value expansions for 'compliance',
'status' and 'platform' fields
% cleanup the way output engines are handles internally
+ add support for 'TAGS' entry to replace/extend the rigid and
ambiguous CATEGORY/SUBCATEGORY-based categorization. It is meant
to be a comma-separated list of freeform tags, possibly with a set
of standard common tags, with the freedom to use anything else deemed
useful by component/doc authors.
+ add footer showing the build date of the doc
+ include Git revision the doc is based on, link to the relevant
source tree version.
* various code refactoring steps to avoid unnecessary
classes, arrays, macro evaluation, and using undocumented
functions
% various HTML5 tag improvements and optimizations
+ load HBX file contents and lookup each referenced
symbol. Emit warning in verbose mode, if docs refers
to non-existing one.
(this replaces slow and broken logic based on hbextern.ch)
+ use core hbdoc API to load the documentation instead
of locally rolled logic
* always show those content problems that are considered
fatal and the input doc to be skipped
+ filter docs to English language by default
+ add ability to choose language using a command-line option
! fix faulty validation logic that resulted in
erronously skipping certain entries
+ identify docs' 'component' property automatically
! fix to not eat empty lines from examples
+ convert "see also" items to links (this works correctly only
in single file output mode)
! fix to not break words (f.e. URLs) when outputting HTML
% use shorter class names
! fix invalid element ID generated
! fix RTE when trying to create output by category
% delete dummy "HTML2" output mode
* convert more ASCII chars to better Unicode equivalents
+ mark more text as code automatically
* drop MS-DOS compatibility
* src/rtl/hbdoc.prg
! fix filling '_LANG' property with the correct value
* switch to use LF instead of CRLF in the field contents
* contrib/hbct/doc/en/*.txt
* contrib/hbgd/doc/en/hbgd.txt
* contrib/hbgt/doc/en/hbgt.txt
* contrib/hbmisc/doc/en/dates2.txt
* contrib/hbnf/doc/en/*.txt
* contrib/rddads/doc/en/adsfuncs.txt
* doc/en/*.txt
* cleanups and fixes
! casing
! fix to always delimit "see also" items with comma (",")
! fix various casing issues and old typos
! various fixes after detecting them using updated hbdoc
! eliminate/fix various rare/unnecessary/invalid field values
! move some embedded docs from hbdoc into their respective
doc sources
! fix a typo
* use backtick
* replace code copyright with reference to COPYING.txt (=LICENSE.txt)
+ mark tables without a header or with double height header
; Above patches come from 3.4 fork commits below:
2016-10-26 12:43 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-26 12:34 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-26 12:20 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-26 03:21 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-26 02:47 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-25 15:05 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-25 14:51 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-25 14:30 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-25 13:19 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-25 12:35 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-25 11:47 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-25 02:48 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-24 22:26 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-24 18:35 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-24 17:58 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-24 16:12 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-24 15:44 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-24 03:36 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-24 02:40 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-24 00:23 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-23 23:09 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-23 16:39 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-23 16:10 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
2016-10-23 13:15 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
968 lines
17 KiB
Plaintext
968 lines
17 KiB
Plaintext
/*
|
|
* Copyright 2009 April White <bright.tigra gmail.com>
|
|
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
|
*
|
|
* See COPYING.txt for licensing terms.
|
|
*
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_Hash()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Returns a hash table
|
|
$SYNTAX$
|
|
hb_Hash( [ <Key1>, <Value1> ], [ <KeyN>, <ValueN> ], ... ) -> hsTable
|
|
$ARGUMENTS$
|
|
<Key1> entry key;
|
|
can be of type: number, date, datetime, string, pointer
|
|
|
|
<Value1> entry value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table
|
|
|
|
Equivalent to:
|
|
hsTable := { => }
|
|
hsTable := { <Key1> => <Value1>, <Key2> => <Value2>, <KeyN> => <ValueN> }
|
|
$RETURNS$
|
|
A hash table built from the initial key/value pairs
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HHasKey()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Determines whether a hash table has an entry with a give key
|
|
$SYNTAX$
|
|
hb_HHasKey( <hsTable>, <Key> ) -> lExists
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<Key> a key value to be queried for;
|
|
can be of type: number, date, datetime, string, pointer
|
|
$RETURNS$
|
|
A logical value indicating whether the key exists within the hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HPos()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Locates the index of a key within a hash table
|
|
$SYNTAX$
|
|
hb_HPos( <hsTable>, <Key> ) -> nPosition
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<Key> key for which its position is to be determined;
|
|
can be of type: number, date, datetime, string, pointer
|
|
$RETURNS$
|
|
A integer number being the index position of the key within the hash table.
|
|
|
|
TODO: what is the return value if the key does not exist? zero (0)? RTE?
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HGet()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Returns a hash value
|
|
$SYNTAX$
|
|
hb_HGet( <hsTable>, <Key> ) -> <Value>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<Key> key to be retrieve from the hash table;
|
|
can be of type: number, date, datetime, string, pointer
|
|
$RETURNS$
|
|
Either the value within the hash table for the given key.
|
|
|
|
An array access error occurs of the key is not found
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HGetDef()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Returns a hash value, or a default value if the key is not present
|
|
$SYNTAX$
|
|
hb_HGetDef( <hsTable>, <Key>, [<DefaultValue>] ) -> <Value>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<Key> key to be retrieve from the hash table;
|
|
can be of type: number, date, datetime, string, pointer
|
|
|
|
<DefaultValue> a default value to be returned if the
|
|
hash table does not contain the key
|
|
$RETURNS$
|
|
Either the value within the hash table for the given key,
|
|
or the default value.
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HSet()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Sets a hash value
|
|
$SYNTAX$
|
|
hb_HSet( <hsTable>, <Key>, <Value> ) -> <hsTable>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<Key> the key of the entry to be set;
|
|
can be of type: number, date, datetime, string, pointer
|
|
|
|
<Value> the entry value
|
|
$RETURNS$
|
|
The hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HDel()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Removes a key/value pair from a hash table
|
|
$SYNTAX$
|
|
hb_HDel( <hsTable>, <Key> ) -> <hsTable>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<Key> key to be removed from the hash table;
|
|
can be of type: number, date, datetime, string, pointer
|
|
$RETURNS$
|
|
The hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HKeyAt()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Gets a hash table key at a given position
|
|
$SYNTAX$
|
|
hb_HKeyAt( <hsTable>, <nPosition> ) -> <Key>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<nPosition> the position of an entry within the hash table that will
|
|
be returned
|
|
$RETURNS$
|
|
The key at the given position of the hash table;
|
|
the type will be one: number, date, datetime, string, pointer
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HValueAt()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Gets/sets a hash value at a given position
|
|
$SYNTAX$
|
|
hb_HValueAt( <hsTable>, <nPosition>, [<NewValue>] ) -> <Value>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<nPosition> the position of an entry within the hash table that will
|
|
be returned
|
|
|
|
<NewValue> a new value to be assigned to the hash table at the given
|
|
position
|
|
$RETURNS$
|
|
The existing value, or the new value if it is given
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HPairAt()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Returns a two-dimensional array of a hash table entry key/value pair
|
|
$SYNTAX$
|
|
hb_HPairAt( <hsTable>, <nPosition> ) -> <aKeyValue>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<nPosition> the position of an entry within the hash table that will
|
|
be returned
|
|
$RETURNS$
|
|
A two-dimensional array of the key/value pair entry of the hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HDelAt()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Removes an entry from a hash table based on its index position
|
|
$SYNTAX$
|
|
hb_HDelAt( <hsTable>, <nPosition> ) -> <hsTable>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<nPosition> the position of an entry within the hash table that will
|
|
be deleted
|
|
$RETURNS$
|
|
The hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HKeys()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Returns an array of the keys of a hash table
|
|
$SYNTAX$
|
|
hb_HKeys( <hsTable> ) -> <aKeys>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
$RETURNS$
|
|
An array of all the hash table keys
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HValues()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Returns an array of the values of a hash table
|
|
$SYNTAX$
|
|
hb_HValues( <hsTable> ) -> <aValues>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
$RETURNS$
|
|
An array of all the hash values
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HFill()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Fills a hash table with a value
|
|
$SYNTAX$
|
|
hb_HFill( <hsTable>, <Value> ) -> <hsTable>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<Value> fill value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table
|
|
$RETURNS$
|
|
The hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HClone()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Creates a copy of a hash table
|
|
$SYNTAX$
|
|
hb_HClone( <hsTable> ) -> <hsDestination>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
$RETURNS$
|
|
A cloned copy of the hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HCopy()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Adds entries from the source hash table to the destination hash table
|
|
$SYNTAX$
|
|
hb_HCopy( <hsDestination>, <hsSource>, [<nStart>], [<nCount>] ) -> <hsDestination>
|
|
$ARGUMENTS$
|
|
<hsDestination> a destination hash table
|
|
|
|
<hsSource> a source hash table
|
|
|
|
<nStart> starting index, defaults to 1 if omitted
|
|
|
|
<nCount> counter, defaults to (length) - <nStart> is omitted
|
|
$RETURNS$
|
|
The destination hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HMerge()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Merges a source hash table into a destination hash table
|
|
$SYNTAX$
|
|
hb_HMerge( <hsDestination>, <hsSource>, <bBlock>|<nPosition> ) -> <hsDestination>
|
|
$ARGUMENTS$
|
|
<hsDestination> a destination hash table
|
|
|
|
<hsSource> a source hash table
|
|
|
|
<bBlock> a code block that will be evaluated for each entry within the
|
|
source hash table; the code block will be passed the entry key, value and
|
|
position; if the code block returns a true value, the entry will be added to
|
|
the destination hash table
|
|
|
|
<nPosition> the position of an entry within the source hash table that will
|
|
be appended to the destination hash table
|
|
|
|
TODO: the source code passes either a number or HB_HASH_UNION; research this
|
|
$RETURNS$
|
|
The destination hash table with the contents of the source hash table merged
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HEval()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Evaluate a code block across the contents of a hash table
|
|
$SYNTAX$
|
|
hb_HEval( <hsTable>, <bBlock>, [<nStart>], [<nCount>] ) -> <hsTable>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<bBlock> code block to be evaluated
|
|
|
|
<nStart> starting index, defaults to 1 if omitted
|
|
|
|
<nCount> counter, defaults to (length) - <nStart> is omitted
|
|
$RETURNS$
|
|
The hash table
|
|
$DESCRIPTION$
|
|
The code block is evaluated for every hash table entry starting at
|
|
<nStart> for <nCount> items.
|
|
|
|
The code block is passed the entry key, value, and numeric position
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HScan()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Scans a hash table
|
|
$SYNTAX$
|
|
hb_HScan( <hsTable>, <Value>, [<nStart>], [<nCount>, [<lExact>] ) -> nPosition
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<Value> to be located within the hash table
|
|
|
|
<nStart> starting index, defaults to 1 if omitted
|
|
|
|
<nCount> counter, defaults to (length) - <nStart> is omitted
|
|
|
|
<lExact> logical valuye indicating whether the comparision
|
|
is to be be exact or not
|
|
$RETURNS$
|
|
The position of the located value within the hash table, or zero (0) if not found.
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HSort()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Reorganizes the internal list of the hash table to be sorted
|
|
$SYNTAX$
|
|
hb_HSort( <hsTable> ) -> <hsSortedTable>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
$RETURNS$
|
|
The hash table sorted
|
|
|
|
TODO: is the original table altered?
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HCaseMatch()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Sets the 'case match' flag for the hash table
|
|
$SYNTAX$
|
|
hb_HCaseMatch( <hsTable>, [<lFlag>] ) -> <lPreviousFlag>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<lFlag> a logical value indicating to turn on or off
|
|
the 'case match' flag of the hash table
|
|
$RETURNS$
|
|
The previous value of the 'case match' flag
|
|
$DESCRIPTION$
|
|
This function returns the old flag value
|
|
$EXAMPLES$
|
|
LOCAL hsTable, lFlag
|
|
hsTable := { "one" => 1, "two" => 2 }
|
|
// turn 'case match' on for a new hash table, storing ol flag
|
|
lFlag := hb_HCaseMatch( hsTable, .T. )
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HBinary()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Sets the 'binary' flag for the hash table
|
|
$SYNTAX$
|
|
hb_HBinary( <hsTable>, [<lFlag>] ) -> <lPreviousFlag>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<lFlag> a logical value indicating to turn on or off
|
|
the 'binary' flag of the hash table
|
|
$RETURNS$
|
|
The previous value of the 'binary' flag
|
|
$DESCRIPTION$
|
|
This function is equivalent to hb_HBinary() but it returns
|
|
the old flag value rather than the hash table
|
|
$EXAMPLES$
|
|
LOCAL hsTable, lFlag
|
|
hsTable := { "one" => 1, "two" => 2 }
|
|
// turn 'binary' on for a new hash table, storing ol flag
|
|
lFlag := hb_HBinary( hsTable, .T. )
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HAutoAdd()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Sets the 'auto add' flag for the hash table
|
|
$SYNTAX$
|
|
hb_HAutoAdd( <hsTable>, [<lFlag>] ) -> <lPreviousFlag>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<lFlag> a logical value indicating to turn on or off
|
|
the 'auto add' flag of the hash table
|
|
$RETURNS$
|
|
The previous value of the 'auto add' flag
|
|
$DESCRIPTION$
|
|
This function is equivalent to hb_HAutoAdd() but it returns
|
|
the old flag value rather than the hash table
|
|
$EXAMPLES$
|
|
LOCAL hsTable, lFlag
|
|
hsTable := { "one" => 1, "two" => 2 }
|
|
// turn 'auto add' on for a new hash table, storing ol flag
|
|
lFlag := hb_HAutoAdd( hsTable, .T. )
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Procedure
|
|
$NAME$
|
|
hb_HAllocate()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Preallocates a hash table
|
|
$SYNTAX$
|
|
hb_HAllocate( <hsTable>, <nItems> )
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<nItems> number of items to preallocate in the hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
|
|
$END$
|
|
*/
|
|
|
|
/* $DOC$
|
|
$TEMPLATE$
|
|
Function
|
|
$NAME$
|
|
hb_HDefault()
|
|
$CATEGORY$
|
|
API
|
|
$SUBCATEGORY$
|
|
Hash table
|
|
$ONELINER$
|
|
Returns/sets a default value for a hash table.
|
|
$SYNTAX$
|
|
hb_HDefault( <hsTable>, <DefaultValue> ) -> <OldDefaultValye>
|
|
$ARGUMENTS$
|
|
<hsTable> a hash table
|
|
|
|
<DefaultValue>
|
|
$RETURNS$
|
|
The previous default value assigned to the hash table
|
|
$DESCRIPTION$
|
|
|
|
$EXAMPLES$
|
|
|
|
$STATUS$
|
|
R
|
|
$COMPLIANCE$
|
|
H
|
|
$PLATFORMS$
|
|
|
|
$FILES$
|
|
|
|
$SEEALSO$
|
|
TODO: locate and list those methods that use this feature
|
|
$END$
|
|
*/
|