Add hexadecimal binary output conversion option

This commit adds another binary output conversion option to convert
binary blobs into hexadecimal notation, similar to the output of the
following command:
  xxd -p binaryfile.bin | tr -d '\n'

(In other words, a single line string of hexadecimal characters
representing a binary blob)

When exporting SQL INSERT statements for SQLite and PostgreSQL and when
the hexadecimal notation is specified with 'mdb-export -b hex ...',
special consideration is given to ensure that binary blobs are safely
written to the SQLite or PostgreSQL database.

Signed-off-by: David Hicks <david@hicks.id.au>
This commit is contained in:
David Hicks
2014-06-29 01:26:50 +10:00
parent 95cf90d8ea
commit f2890dc1d0
4 changed files with 49 additions and 18 deletions

View File

@@ -180,7 +180,8 @@ enum {
enum {
MDB_BINEXPORT_STRIP,
MDB_BINEXPORT_RAW,
MDB_BINEXPORT_OCTAL
MDB_BINEXPORT_OCTAL,
MDB_BINEXPORT_HEXADECIMAL
};
#define IS_JET4(mdb) (mdb->f->jet_version==MDB_VER_JET4) /* obsolete */