The NFIQ2::Data class provides a foundation for binary data handling in NFIQ 2. It extends std::basic_string<uint8_t> and provides convenient methods for reading, writing, and converting binary data.This class serves as the base class for NFIQ2::FingerprintImageData and other data-handling classes in the library.
Generates a hexadecimal string representation of the buffer.Returns: The content of the buffer as a hexadecimal string.Throws:NFIQ2::Exception if no data is available in the buffer.Example:
#include <nfiq2.hpp>// Reading binary data from fileNFIQ2::Data imageData;imageData.readFromFile("fingerprint.raw");// Convert to base64 for transmissionstd::string encoded = imageData.toBase64String();// Later, decode backNFIQ2::Data decodedData;decodedData.fromBase64String(encoded);// Write to new filedecodedData.writeToFile("fingerprint_copy.raw");