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
 
void save (UT_OptionsHolder &dict) const
 
bool load (const UT_JSONValue &value, bool strict=true)
 
bool load (const UT_OptionsHolder &dict, bool strict=true)
 

Static Public Member Functions

static void save (const Array &array, UT_JSONWriter &writer)
 Saves a file array to json. More...
 
static void save (const Array &array, const UT_StringHolder &key, UT_OptionsHolder &dict)
 Saves a file array to UT_Options. More...
 
static bool load (Array &array, const UT_JSONValue &value, bool strict=true)
 Loads a fle array from json. More...
 
static bool load (Array &array, const UT_StringHolder &key, const UT_OptionsHolder &options, bool strict=true)
 Loads a file array from a dict. 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 28 of file PDG_File.h.

Member Typedef Documentation

Array of files.

Definition at line 32 of file PDG_File.h.

The file hash/modtime type.

Definition at line 39 of file PDG_File.h.

Definition at line 40 of file PDG_File.h.

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

Definition at line 36 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 44 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 96 of file PDG_File.h.

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

Definition at line 102 of file PDG_File.h.

bool PDG_File::isExpected ( ) const
inline

Definition at line 87 of file PDG_File.h.

bool PDG_File::isGenerated ( ) const
inline

Definition at line 89 of file PDG_File.h.

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

Loads a fle array from json.

static bool PDG_File::load ( Array array,
const UT_StringHolder key,
const UT_OptionsHolder options,
bool  strict = true 
)
static

Loads a file array from a dict.

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 111 of file PDG_File.h.

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

Saves a file array to json.

static void PDG_File::save ( const Array array,
const UT_StringHolder key,
UT_OptionsHolder dict 
)
static

Saves a file array to UT_Options.

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 108 of file PDG_File.h.

const UT_StringHolder& PDG_File::tag ( ) const
inline

Definition at line 99 of file PDG_File.h.

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

Definition at line 105 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 56 of file PDG_File.h.

const PDG_File PDG_File::theEmptyFile
static

Global empty file and empty file list statics.

Definition at line 64 of file PDG_File.h.

const Array PDG_File::theEmptyFileArray
static

Definition at line 65 of file PDG_File.h.

const UT_StringHolder PDG_File::theHashKey
static

Definition at line 58 of file PDG_File.h.

constexpr Hash PDG_File::theInvalidHash = 0
static

Default/invalid hash value.

Definition at line 53 of file PDG_File.h.

const UT_StringHolder PDG_File::theOwnKey
static

Definition at line 60 of file PDG_File.h.

const UT_StringHolder PDG_File::theSizeKey
static

Definition at line 59 of file PDG_File.h.

const UT_StringHolder PDG_File::theTagKey
static

Definition at line 57 of file PDG_File.h.

const UT_StringHolder PDG_File::theTypeKey
static

Definition at line 61 of file PDG_File.h.


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