swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
function  

base64.reader

 
 

Library: Base 64 (OMFFBASE64)
Import: omffbase64.xmd
Return type: String source

Returns: A scannable input source for streaming data.


Declaration

export external string source function reader
                  from value string source input-data


Purpose

Use reader to read a value string source, its argument, and return the binary data of that file converted from a Base 64 encoding to "raw" binary octets. That is, the provided source is in Base 64, but the program sees binary data.

Any input data not recognized as part of a Base 64 encoding is ignored, so this library should not be used to validate Base 64 encoding.

Usage Note

To use reader, you must import omffbase64.xmd into your program using a statement like this:

  import "omffbase64.xmd" prefixed by base64.

(Please see the import topic for more on importing.)

Example


  ; Read as much BASE64 encoded data as can be found in #current-input,
  ; pass it through the BASE64 reader -- which converts it from
  ; BASE64 to raw data -- and return the raw data as a function's
  ; result.
  import "omffbase64.xmd" prefixed by base64.
  define string function read-attachment as
     as
     return base64.reader from
        (#current-input take [letter | digit | "+/=%10#%13#"]+)

    Related Topics
 
Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.