summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/platform/wasm/qstdweb.cpp10
-rw-r--r--src/corelib/platform/wasm/qstdweb_p.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/platform/wasm/qstdweb.cpp b/src/corelib/platform/wasm/qstdweb.cpp
index fc2bf9cf96..2bbf57953b 100644
--- a/src/corelib/platform/wasm/qstdweb.cpp
+++ b/src/corelib/platform/wasm/qstdweb.cpp
@@ -117,6 +117,11 @@ uint64_t File::size() const
return uint64_t(m_file["size"].as<uint53_t>());
}
+std::string Blob::type() const
+{
+ return m_blob["type"].as<std::string>();
+}
+
// Streams partial file content into the given buffer asynchronously. The completed
// callback is called on completion.
void File::stream(uint32_t offset, uint32_t length, char *buffer, const std::function<void ()> &completed) const
@@ -162,6 +167,11 @@ void File::stream(char *buffer, const std::function<void ()> &completed) const
stream(0, size(), buffer, completed);
}
+std::string File::type() const
+{
+ return m_file["type"].as<std::string>();
+}
+
FileList::FileList(const emscripten::val &fileList)
:m_fileList(fileList)
{
diff --git a/src/corelib/platform/wasm/qstdweb_p.h b/src/corelib/platform/wasm/qstdweb_p.h
index fc52dc1a71..9d5e2418ec 100644
--- a/src/corelib/platform/wasm/qstdweb_p.h
+++ b/src/corelib/platform/wasm/qstdweb_p.h
@@ -88,6 +88,7 @@ namespace qstdweb {
uint32_t size() const;
static Blob copyFrom(const char *buffer, uint32_t size);
emscripten::val val();
+ std::string type() const;
private:
friend class FileReader;
@@ -102,6 +103,7 @@ namespace qstdweb {
Blob slice(uint64_t begin, uint64_t end) const;
std::string name() const;
uint64_t size() const;
+ std::string type() const;
void stream(uint32_t offset, uint32_t length, char *buffer, const std::function<void ()> &completed) const;
void stream(char *buffer, const std::function<void ()> &completed) const;