From 0d0e97e8cd0e3e0d294b622ad4de9f13f86b5d3f Mon Sep 17 00:00:00 2001 From: Selmar Kok Date: Wed, 22 Aug 2018 14:01:57 +0200 Subject: [PATCH] forward declare DataURI helper functions to allow usage outside of implementation file (in case of custom image handling) --- tiny_gltf.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index e253fce..fb8070d 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -189,6 +189,11 @@ static inline int32_t GetTypeSizeInBytes(uint32_t ty) { } } +bool IsDataURI(const std::string &in); +bool DecodeDataURI(std::vector *out, + std::string &mime_type, const std::string &in, + size_t reqBytes, bool checkSize); + #ifdef __clang__ #pragma clang diagnostic push // Suppress warning for : static Value null_value @@ -1608,7 +1613,7 @@ static void UpdateImageObject(Image &image, std::string &baseDir, int index, } } -static bool IsDataURI(const std::string &in) { +bool IsDataURI(const std::string &in) { std::string header = "data:application/octet-stream;base64,"; if (in.find(header) == 0) { return true; @@ -1647,7 +1652,7 @@ static bool IsDataURI(const std::string &in) { return false; } -static bool DecodeDataURI(std::vector *out, +bool DecodeDataURI(std::vector *out, std::string &mime_type, const std::string &in, size_t reqBytes, bool checkSize) { std::string header = "data:application/octet-stream;base64,";