Loading...
Searching...
No Matches
juce_FileInputSource.cpp
/*
==============================================================================
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
{
FileInputSource::FileInputSource (const File& f, bool useFileTimeInHash)
: file (f), useFileTimeInHashGeneration (useFileTimeInHash)
{
}
FileInputSource::~FileInputSource()
{
}
InputStream* FileInputSource::createInputStream()
{
return file.createInputStream().release();
}
InputStream* FileInputSource::createInputStreamFor (const String& relatedItemPath)
{
return file.getSiblingFile (relatedItemPath).createInputStream().release();
}
int64 FileInputSource::hashCode() const
{
int64 h = file.hashCode();
if (useFileTimeInHashGeneration)
h ^= file.getLastModificationTime().toMilliseconds();
return h;
}
} // namespace juce
juce::FileInputSource::~FileInputSource
~FileInputSource() override
Definition juce_FileInputSource.cpp:31
juce::FileInputSource::hashCode
int64 hashCode() const override
Definition juce_FileInputSource.cpp:45
juce::FileInputSource::createInputStreamFor
InputStream * createInputStreamFor(const String &relatedItemPath) override
Definition juce_FileInputSource.cpp:40
juce::FileInputSource::createInputStream
InputStream * createInputStream() override
Definition juce_FileInputSource.cpp:35
juce::FileInputSource::FileInputSource
FileInputSource(const File &file, bool useFileTimeInHashGeneration=false)
Definition juce_FileInputSource.cpp:26
juce::File
Definition juce_File.h:45
juce::InputStream
Definition juce_InputStream.h:37
juce::String
Definition juce_String.h:53