Files
harbour-core/contrib/hbamf
Przemysław Czerpak ae90545eb1 2016-01-21 20:42 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/gtalleg/gtallegd.c
  * contrib/hbamf/amfdec.c
  * contrib/hbamf/amfenc.c
  * contrib/hbbz2/core.c
  * contrib/hbbz2io/bz2io.c
  * contrib/hbct/atrepl.c
  * contrib/hbct/charrepl.c
  * contrib/hbct/envparam.c
  * contrib/hbct/pack.c
  * contrib/hbct/token2.c
  * contrib/hbfimage/fi_wrp.c
  * contrib/hbgd/gdwrp.c
  * contrib/hbgs/core.c
  * contrib/hbgzio/gzio.c
  * contrib/hbhpdf/core.c
  * contrib/hbhpdf/image.c
  * contrib/hbmlzo/core.c
  * contrib/hbmxml/core.c
  * contrib/hbodbc/odbc.c
  * contrib/hbsqlit3/core.c
  * contrib/hbssl/bio.c
  * contrib/hbssl/ssl.c
  * contrib/rddads/ads1.c
  * contrib/rddads/adsfunc.c
  * contrib/rddads/adsmgmnt.c
  * contrib/rddads/adsx.c
  * contrib/rddads/rddads.h
  * contrib/sddodbc/core.c
  * contrib/xhb/cstructc.c
  * include/hbapi.h
  * include/hbdefs.h
  * src/common/expropt1.c
  * src/common/expropt2.c
  * src/common/hbmem.c
  * src/compiler/complex.c
  * src/compiler/harbour.y
  * src/compiler/harbour.yyc
  * src/compiler/harbour.yyh
  * src/compiler/hbident.c
  * src/macro/macrolex.c
  * src/nortl/nortl.c
  * src/pp/ppcore.c
  * src/rdd/hbsix/sxcompr.c
  * src/rdd/hbsix/sxfname.c
  * src/rdd/usrrdd/usrrdd.c
  * src/rtl/cdpapi.c
  * src/rtl/filebuf.c
  * src/rtl/filesys.c
  * src/rtl/fslink.c
  * src/rtl/gtcrs/gtcrs.c
  * src/rtl/gtsln/gtsln.c
  * src/rtl/gtsln/mousesln.c
  * src/rtl/gtxwc/gtxwc.c
  * src/rtl/hbbfsock.c
  * src/rtl/hbgtcore.c
  * src/rtl/hbsocket.c
  * src/rtl/hbzlib.c
  * src/rtl/hbznet.c
  * src/rtl/hbzsock.c
  * src/rtl/iousr.c
  * src/rtl/langapi.c
  * src/vm/cmdarg.c
  * src/vm/codebloc.c
  * src/vm/hvm.c
  * src/vm/itemapi.c
  * src/vm/macro.c
  * src/vm/set.c
  * src/vm/strapi.c
    * cleaned const qualifier dropping
    ! fixed few bugs I found analyzing related code
    ; I left untouched two places in HBSSL which IMO should be fixed yet
2016-01-21 20:42:30 +01: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