Loading...
Searching...
No Matches
juce_AndroidDocumentInputSource.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API AndroidDocumentInputSource : public InputSource
{
public:
//==============================================================================
explicit AndroidDocumentInputSource (const AndroidDocument& doc)
: document (doc) {}
//==============================================================================
InputStream* createInputStream() override
{
return document.createInputStream().release();
}
InputStream* createInputStreamFor (const String& relatedItemPath) override
{
return relatedItemPath.isEmpty() ? document.createInputStream().release() : nullptr;
}
int64 hashCode() const override
{
return document.getUrl().toString (true).hashCode64();
}
private:
AndroidDocument document;
};
} // namespace juce
juce::AndroidDocumentInputSource::hashCode
int64 hashCode() const override
Definition juce_AndroidDocumentInputSource.h:70
juce::AndroidDocumentInputSource::createInputStreamFor
InputStream * createInputStreamFor(const String &relatedItemPath) override
Definition juce_AndroidDocumentInputSource.h:63
juce::AndroidDocumentInputSource::createInputStream
InputStream * createInputStream() override
Definition juce_AndroidDocumentInputSource.h:49
juce::AndroidDocumentInputSource::AndroidDocumentInputSource
AndroidDocumentInputSource(const AndroidDocument &doc)
Definition juce_AndroidDocumentInputSource.h:40
juce::AndroidDocument
Definition juce_AndroidDocument.h:242
juce::InputStream
Definition juce_InputStream.h:37
juce::String
Definition juce_String.h:53
juce::String::isEmpty
bool isEmpty() const noexcept
Definition juce_String.h:310