Add constructor that takes generic std::istream objects (#11)

This commit is contained in:
Juha Reunanen
2021-04-02 20:31:04 +03:00
committed by GitHub
parent a41f1c89f7
commit d75f772ffa
4 changed files with 42 additions and 32 deletions

View File

@@ -100,6 +100,7 @@ class TINYEXIF_LIB EXIFInfo {
public:
EXIFInfo();
EXIFInfo(EXIFStream& stream);
EXIFInfo(std::istream& stream); // NB: the stream must have been opened in binary mode
EXIFInfo(const uint8_t* data, unsigned length);
// Parsing function for an entire JPEG image stream.
@@ -110,6 +111,7 @@ public:
// RETURN: PARSE_SUCCESS (0) on success with 'result' filled out
// error code otherwise, as defined by the PARSE_* macros
int parseFrom(EXIFStream& stream);
int parseFrom(std::istream& stream); // NB: the stream must have been opened in binary mode
int parseFrom(const uint8_t* data, unsigned length);
// Parsing function for an EXIF segment. This is used internally by parseFrom()