HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_File Class Reference

#include <PDG_File.h>

Public Types

enum  FileType { eFileGenerated, eFileExpected, eFileRuntime, eFileRuntimeExpected }
 
using Array = UT_Array< PDG_File >
 Array of files. More...
 
using Set = UT_ArraySet< PDG_File >
 
using Hash = int64
 The file hash/modtime type. More...
 
using HashArray = UT_ValArray< Hash >
 

Public Member Functions

 PDG_File ()
 
 PDG_File (const UT_StringHolder &data, bool own)
 
 PDG_File (const UT_StringHolder &data, const UT_StringHolder &tag, Hash hash, bool own)
 
 PDG_File (const UT_StringHolder &data, const UT_StringHolder &tag, Hash hash, FileType type, bool own)
 
int64 getMemoryUsage (bool inclusive) const
 
UT_StringHolder localizePath (const PDG_Scheduler *scheduler) const
 Updates and return the local_path. More...
 
bool isExpected () const
 
bool isGenerated () const
 
const UT_StringHolderlocal_data () const
 
void setLocalData (const UT_StringHolder &local_data)
 
const UT_StringHolderdata () const
 
void setData (const UT_StringHolder &data)
 
const UT_StringHoldertag () const
 
void setTag (const UT_StringHolder &tag)
 
Hash hash () const
 
void setHash (Hash hash)
 
PDG_File::FileType type () const
 
void setType (FileType type)
 
exint size () const
 
void setSize (exint size)
 
bool own () const
 
void setOwn (bool own)
 
void updateStat (const PDG_WorkItem *work_item, bool force)
 
void clearStat ()
 
bool operator== (const PDG_File &other) const
 
bool operator!= (const PDG_File &other) const
 
bool operator< (const PDG_File &other) const
 
bool operator<= (const PDG_File &other) const
 
bool operator> (const PDG_File &other) const
 
bool operator>= (const PDG_File &other) const
 
void save (UT_JSONWriter &writer) const
 
bool load (const UT_JSONValue &value, bool strict=true)
 

Static Public Member Functions

static void save (const Array &array, UT_JSONWriter &writer)
 Saves a file array to json. More...
 
static bool load (Array &array, const UT_JSONValue &value, bool strict=true)
 Loads a fle array from json. More...
 

Static Public Attributes

static constexpr Hash theInvalidHash = 0
 Default/invalid hash value. More...
 
static const UT_StringHolder theDataKey
 JSON Serialization keys. More...
 
static const UT_StringHolder theTagKey
 
static const UT_StringHolder theHashKey
 
static const UT_StringHolder theSizeKey
 
static const UT_StringHolder theOwnKey
 
static const UT_StringHolder theTypeKey
 
static const PDG_File theEmptyFile
 Global empty file and empty file list statics. More...
 
static const Array theEmptyFileArray
 

Detailed Description

Definition at line 27 of file PDG_File.h.

Member Typedef Documentation

Array of files.

Definition at line 31 of file PDG_File.h.

The file hash/modtime type.

Definition at line 38 of file PDG_File.h.

Definition at line 39 of file PDG_File.h.

Set of files, which uses the default clear struct defined at the bottom of this file

Definition at line 35 of file PDG_File.h.

Member Enumeration Documentation

Enumeration of file types, used to maintain whether the file is an expected output, a generated output, or a file reported at cook time.

Enumerator
eFileGenerated 
eFileExpected 
eFileRuntime 
eFileRuntimeExpected 

Definition at line 43 of file PDG_File.h.

Constructor & Destructor Documentation

PDG_File::PDG_File ( )
PDG_File::PDG_File ( const UT_StringHolder data,
bool  own 
)
PDG_File::PDG_File ( const UT_StringHolder data,
const UT_StringHolder tag,
Hash  hash,
bool  own 
)
PDG_File::PDG_File ( const UT_StringHolder data,
const UT_StringHolder tag,
Hash  hash,
FileType  type,
bool  own 
)

Member Function Documentation

void PDG_File::clearStat ( )
const UT_StringHolder& PDG_File::data ( ) const
inline

Definition at line 95 of file PDG_File.h.

int64 PDG_File::getMemoryUsage ( bool  inclusive) const
Hash PDG_File::hash ( void  ) const
inline

Definition at line 101 of file PDG_File.h.

bool PDG_File::isExpected ( ) const
inline

Definition at line 86 of file PDG_File.h.

bool PDG_File::isGenerated ( ) const
inline

Definition at line 88 of file PDG_File.h.

bool PDG_File::load ( const UT_JSONValue value,
bool  strict = true 
)
static bool PDG_File::load ( Array array,
const UT_JSONValue value,
bool  strict = true 
)
static

Loads a fle array from json.

const UT_StringHolder& PDG_File::local_data ( ) const

Return the local path. Note that this will not do the old PDG_DIR localization automatically, call localizePath first.

UT_StringHolder PDG_File::localizePath ( const PDG_Scheduler scheduler) const

Updates and return the local_path.

bool PDG_File::operator!= ( const PDG_File other) const
bool PDG_File::operator< ( const PDG_File other) const
bool PDG_File::operator<= ( const PDG_File other) const
bool PDG_File::operator== ( const PDG_File other) const
bool PDG_File::operator> ( const PDG_File other) const
bool PDG_File::operator>= ( const PDG_File other) const
bool PDG_File::own ( ) const
inline

Definition at line 110 of file PDG_File.h.

void PDG_File::save ( UT_JSONWriter writer) const
static void PDG_File::save ( const Array array,
UT_JSONWriter writer 
)
static

Saves a file array to json.

void PDG_File::setData ( const UT_StringHolder data)
void PDG_File::setHash ( Hash  hash)
void PDG_File::setLocalData ( const UT_StringHolder local_data)
void PDG_File::setOwn ( bool  own)
void PDG_File::setSize ( exint  size)
void PDG_File::setTag ( const UT_StringHolder tag)
void PDG_File::setType ( FileType  type)
exint PDG_File::size ( void  ) const
inline

Definition at line 107 of file PDG_File.h.

const UT_StringHolder& PDG_File::tag ( ) const
inline

Definition at line 98 of file PDG_File.h.

PDG_File::FileType PDG_File::type ( ) const
inline

Definition at line 104 of file PDG_File.h.

void PDG_File::updateStat ( const PDG_WorkItem work_item,
bool  force 
)

Member Data Documentation

const UT_StringHolder PDG_File::theDataKey
static

JSON Serialization keys.

Definition at line 55 of file PDG_File.h.

const PDG_File PDG_File::theEmptyFile
static

Global empty file and empty file list statics.

Definition at line 63 of file PDG_File.h.

const Array PDG_File::theEmptyFileArray
static

Definition at line 64 of file PDG_File.h.

const UT_StringHolder PDG_File::theHashKey
static

Definition at line 57 of file PDG_File.h.

constexpr Hash PDG_File::theInvalidHash = 0
static

Default/invalid hash value.

Definition at line 52 of file PDG_File.h.

const UT_StringHolder PDG_File::theOwnKey
static

Definition at line 59 of file PDG_File.h.

const UT_StringHolder PDG_File::theSizeKey
static

Definition at line 58 of file PDG_File.h.

const UT_StringHolder PDG_File::theTagKey
static

Definition at line 56 of file PDG_File.h.

const UT_StringHolder PDG_File::theTypeKey
static

Definition at line 60 of file PDG_File.h.


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