ezEngine  Milestone 7
ezDependencyFile Class Reference

This class represents a set of files of which one wants to know when any one of them changes. More...

#include <DependencyFile.h>

Classes

struct  FileCheckCache
 

Public Member Functions

void Clear ()
 Clears all files that were added with AddFileDependency()
 
void AddFileDependency (const char *szFile)
 Adds one file as a dependency to the list.
 
const ezHybridArray< ezString, 16 > & GetFileDependencies () const
 Allows read access to all currently stored file dependencies.
 
ezResult WriteDependencyFile (ezStreamWriterBase &stream) const
 Writes the current state to a stream. Note that you probably should call StoreCurrentTimeStamp() before this, to serialize the latest file stamp.
 
ezResult ReadDependencyFile (ezStreamReaderBase &stream)
 Reads the state from a stream. Call HasAnyFileChanged() afterwards to determine whether anything has changed since when the data was serialized.
 
ezResult WriteDependencyFile (const char *szFile) const
 Writes the current state to a file. Note that you probably should call StoreCurrentTimeStamp() before this, to serialize the latest file stamp.
 
ezResult ReadDependencyFile (const char *szFile)
 Reads the state from a file. Call HasAnyFileChanged() afterwards to determine whether anything has changed since when the data was serialized.
 
bool HasAnyFileChanged ()
 Retrieves the current file time stamps from the filesystem and determines whether any file has changed since the last call to StoreCurrentTimeStamp() (or ReadDependencyFile())
 
void StoreCurrentTimeStamp ()
 Retrieves the current file time stamps from the filesystem and stores it for later comparison. This value is also serialized through WriteDependencyFile(), so it should be called before that, to store the latest state.
 

Private Member Functions

ezResult RetrieveFileTimeStamp (const char *szFile, ezTimestamp &out_Result)
 

Private Attributes

ezHybridArray< ezString, 16 > m_FileDependencies
 
ezInt64 m_iMaxTimeStampStored
 

Static Private Attributes

static ezMap< ezString,
FileCheckCache
s_FileTimestamps
 

Detailed Description

This class represents a set of files of which one wants to know when any one of them changes.

ezDependencyFile stores a list of files that are the 'dependency set'. It can be serialized. Through HasAnyFileChanged() one can detect whether any of the files has changed, since the last call to StoreCurrentTimeStamp(). The time stamp that is retrieved through StoreCurrentTimeStamp() will also be serialized.


Class Documentation

struct ezDependencyFile::FileCheckCache
Class Members
ezTimestamp m_FileTimestamp
ezTime m_LastCheck

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