Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
The Data Formatting Utility

This example will demonstrate the construction and use of the data formatting utility.

Displaying bytes and Unicode code points which often do not have printing ASCII character counterparts is a common problem with many applications. This object provides a common solution to this problem. It is roughly patterned after the Linux hexdump command. Once the object has been created it can be used as an iterator to display fixed line length displays of the data in several common formats.

  • application code must include header files:
    • ../../utilities/utilities.h
  • application compilation must include source code from the directories:
    • ../../library
    • ../../utilities
  • application compilation must define macros:
    • (none)

The compiled example will execute the following cases. Run the application with no arguments for application usage.

  • case 1: Display application information. (type names, type sizes and defined macros)
  • case 2: Display 8-bit bytes, illustrating indentation and limits.
  • case 3: Display a mix of ASCII and non-ASCII bytes in all formats.
  • case 4: Display Unicode data in the Unicode format.
APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.