Files
harbour-core/contrib/hbamf
Viktor Szakats cfb1dfd8fa 2013-04-08 00:52 UTC+0200 Viktor Szakats (harbour syenar.net)
* bin/check.hb
    + will now check for missing copyright/license message
      in source files (except for tests and files shorter
      than 20 lines)

  * contrib/hbamf/amf.h
  * contrib/hbamf/amfstdio.c
  * contrib/hbamf/hbamfobj.prg
  * contrib/hbamf/hbcls.c
  * contrib/hbgt/strasint.c
  * contrib/hbhttpd/core.prg
  * contrib/hbhttpd/widgets.prg
  * contrib/hbmisc/hbedit.prg
  * contrib/hbmisc/hbeditc.c
  * contrib/hbmisc/stringsx.c
  * contrib/hbmisc/udpds.prg
  * contrib/hbnf/aredit.prg
  * contrib/hbnf/easter.prg
  * contrib/hbnf/mouse1.prg
  * contrib/xhb/hbsyslog.c
  * extras/guestbk/_cgi.prg
  * extras/guestbk/_inifile.prg
  * extras/guestbk/cgi.ch
  * extras/hbdroid/hvminit.c
  * extras/hbdroid/msginfo.c
  * extras/hbusb/core.c
  * extras/hbvpdf/hbvpdf.ch
    + added copyright/license headers where missing

  * tests/inifiles.prg
    + synced with another copy

  * include/hbclass.ch
  * src/compiler/expropta.c
  * src/compiler/exproptb.c
  * src/macro/macroa.c
  * src/macro/macrob.c
    * minor cleanup
2013-04-08 00:53:37 +02:00
..

--------------------------------------
Short description of Harbour functions
--------------------------------------

   cAMF := amf3_Encode( xVal, symConvOut, lBinaryStrings )
   xVal           - any supported datatype:
                    Character (String/MEMO), Numeric (Integer/Double), NIL, Logical, Date (encoded as DateTime),
                    DateTime, Array, Hash (String and Integer keys only),
                    Object (anonymous hash-like, externalizable, class-mapped)

                    AMF supports references, so this example a1 value will be serialized correctly.
                      a1 := { NIL }
                      a2 := { a1 }
                      a1[ 1 ] := a2

   symConvOut     - function symbol for outbound conversion
                    Acts recursively, so if xVal is array,
                    all of it's values will be passed to this
                    function.

   lBinaryStrings - treat strings as binary, resulting AMF
                    datatype will be ByteArray. Normally
                    a string is encoded to UTF-8.

   xVal := amf3_Decode( cAMF, symConvIn )
   cAMF           - AMF3 serialized binary string
   symConvIn      - function symbol for inbound conversion

   cAMF := amf3_FromWA( [ <bWhile> ], [ <bFor> ], [ <aFields> ], [ <nCount> ], [ <lStrTrim> ], [ <nPackage> ], [ pContext ] )

   Function to convert current workarea to AMF3 Array.

   bWhile   - COPY TO like WHILE codeblock
   bFor     - COPY TO like FOR codeblock
   aFields  - array of fieldnames (codeblocks are going to be supported here too)
   nCount   - NEXT like, process only specified count of records
   lStrTrim - RTrim() strings, default is .T.

   nPackage - determine the exact output AMF format
              0 - Array of records contains Arrays of fields (default)
              1 - Array of records contains Anonymous objects
              2 - ArrayCollection object
              Lower number means lesser packet size on the network.

   pContext - when this function is used inside AMF3_ENCODE specified
              outbound conversion function, you must pass pointer to
              encoding context, otherwise AMF3 references will encoded
              incorrectly. Example code of such case:
              STATIC FUNCTION ConvOut( xVal, pOuterContext )
                 LOCAL lClose

                 IF HB_ISOBJECT( xVal )
                     IF xVal:className() == "WORKAREAEXPORT"
                       lClose := xVal:lCloseWA
                       SELECT ( xVal:nWorkArea )

                       xVal := amf_Raw():New( amf3_FromWA( xVal:bWhile, xVal:bFor, xVal:aFields, xVal:nCount, xVal:lStrTrim, 1, pOuterContext ) )
                       IF lClose
                          CLOSE
                       ENDIF
                    ENDIF
                 ENDIF

              RETURN xVal