JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::FileInputSource Class Reference

A type of InputSource that represents a normal file. More...

#include <juce_FileInputSource.h>

Inheritance diagram for juce::FileInputSource:
Collaboration diagram for juce::FileInputSource:

Public Member Functions

 FileInputSource (const File &file, bool useFileTimeInHashGeneration=false)
 Creates a FileInputSource for a file. More...
 
 ~FileInputSource () override
 Destructor. More...
 
InputStreamcreateInputStream () override
 Returns a new InputStream to read this item. More...
 
InputStreamcreateInputStreamFor (const String &relatedItemPath) override
 Returns a new InputStream to read an item, relative. More...
 
int64 hashCode () const override
 Returns a hash code that uniquely represents this item. More...
 

Private Attributes

const File file
 
bool useFileTimeInHashGeneration
 

Detailed Description

A type of InputSource that represents a normal file.

See also
InputSource

@tags{Core}

Constructor & Destructor Documentation

◆ FileInputSource()

juce::FileInputSource::FileInputSource ( const File file,
bool  useFileTimeInHashGeneration = false 
)

Creates a FileInputSource for a file.

If the useFileTimeInHashGeneration parameter is true, then this object's hashCode() method will incorporate the file time into its hash code; if false, only the file name will be used for the hash.

◆ ~FileInputSource()

juce::FileInputSource::~FileInputSource ( )
override

Destructor.

Member Function Documentation

◆ createInputStream()

InputStream* juce::FileInputSource::createInputStream ( )
overridevirtual

Returns a new InputStream to read this item.

Returns
an inputstream that the caller will delete, or nullptr if the filename isn't found.

Implements juce::InputSource.

◆ createInputStreamFor()

InputStream* juce::FileInputSource::createInputStreamFor ( const String relatedItemPath)
overridevirtual

Returns a new InputStream to read an item, relative.

Parameters
relatedItemPaththe relative pathname of the resource that is required
Returns
an inputstream that the caller will delete, or nullptr if the item isn't found.

Implements juce::InputSource.

◆ hashCode()

int64 juce::FileInputSource::hashCode ( ) const
overridevirtual

Returns a hash code that uniquely represents this item.

Implements juce::InputSource.

Member Data Documentation

◆ file

const File juce::FileInputSource::file
private

◆ useFileTimeInHashGeneration

bool juce::FileInputSource::useFileTimeInHashGeneration
private

The documentation for this class was generated from the following file: