OpenStudioCore:runmanager/lib
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Public Attributes | List of all members
openstudio::runmanager::FileInfo Struct Reference

#include <FileInfo.hpp>

Public Member Functions

void addRequiredFile (const QUrl &t_url, const openstudio::path &t_target)
 Adds a "requiredFile" for tracking for this FileInfo object. More...
 
void addRequiredFile (const QUrl &t_url)
 Adds a required file with the target path being the filename of the passed in url. More...
 
void addRequiredFile (const openstudio::path &t_location, const openstudio::path &t_target)
 Adds a required file with the given target name. More...
 
void addRequiredFile (const openstudio::path &t_location)
 Adds a required file with the target path being the filename of the passed in path. More...
 
FileInfo complete (const openstudio::path &t_basePath) const
 
 FileInfo (const std::string &t_filename, const openstudio::DateTime &t_lastModified, const std::string &t_key, const openstudio::path &t_fullPath=openstudio::path(), bool t_exists=true)
 Construct a FileInfo object. More...
 
 FileInfo (const openstudio::path &t_path, const std::string &t_key)
 Construct a FileInfo from a openstudio::path. More...
 
 FileInfo ()
 
std::pair< QUrl, openstudio::path > getRequiredFile (const openstudio::path &filename)
 Returns the details of a required file attached to this FileInfo if it exists. More...
 
bool hasRequiredFile (const openstudio::path &filename)
 
bool operator!= (const FileInfo &t_rhs) const
 
bool operator< (const FileInfo &fi) const
 
bool operator== (const FileInfo &t_rhs) const
 
void prependRequiredFilePath (const openstudio::path &t_path)
 Prepends a path onto the requiredFiles. More...
 

Public Attributes

bool exists
 True if the file exists, false if it was removed. More...
 
std::string filename
 Short filename. More...
 
openstudio::path fullPath
 Full local filename. More...
 
std::string key
 A key identifying the type / usage of this file. More...
 
openstudio::DateTime lastModified
 Date of last file modification. More...
 
std::vector< std::pair< QUrl,
openstudio::path > > 
requiredFiles
 Files required by this FileInfo object. More...
 

Detailed Description

Basic file information class used by runmanager for handling tracking of which input and output files to and from Job objects.

Constructor & Destructor Documentation

openstudio::runmanager::FileInfo::FileInfo ( const std::string &  t_filename,
const openstudio::DateTime &  t_lastModified,
const std::string &  t_key,
const openstudio::path &  t_fullPath = openstudio::path(),
bool  t_exists = true 
)

Construct a FileInfo object.

Parameters
[in]t_filenameThe short file name of the file
[in]t_lastModifiedThe last modified time of the file
[in]t_keyThe "key" by which this file is known. For example, an in.idf for processing might be known as "idf" for other idf based tools to find it
[in]t_fullPathThe full path of the file on the local disk. If this represents a file on a remote disk, this item might not provided.
[in]t_existsTrue if the file exists, false if it represents a (recently) removed file.
openstudio::runmanager::FileInfo::FileInfo ( const openstudio::path &  t_path,
const std::string &  t_key 
)

Construct a FileInfo from a openstudio::path.

Parameters
[in]t_pathFull path of file
[in]t_keyKey to use for this FileInfo
openstudio::runmanager::FileInfo::FileInfo ( )

Member Function Documentation

void openstudio::runmanager::FileInfo::addRequiredFile ( const QUrl &  t_url,
const openstudio::path &  t_target 
)

Adds a "requiredFile" for tracking for this FileInfo object.

When a FileInfo is used as input to a Job, the required files attached to the given FileInfo are brought along automatically. They (or references to them) are placed in the working directory that the Job uses during execution.

Parameters
[in]t_urlUrl of required file
[in]t_targetTarget filename of required file
Todo:
implement handling of remote (ftp/http) required files.
void openstudio::runmanager::FileInfo::addRequiredFile ( const QUrl &  t_url)

Adds a required file with the target path being the filename of the passed in url.

Parameters
[in]t_urlUrl of requried file
See also
FileInfo::addRequiredFile(const QUrl &, const openstudio::path &)
void openstudio::runmanager::FileInfo::addRequiredFile ( const openstudio::path &  t_location,
const openstudio::path &  t_target 
)

Adds a required file with the given target name.

Parameters
[in]t_locationPath of the required file. Converted to a QUrl internally
[in]t_targetTarget filename of required file
See also
FileInfo::addRequiredFile(const QUrl &, const openstudio::path &)
void openstudio::runmanager::FileInfo::addRequiredFile ( const openstudio::path &  t_location)

Adds a required file with the target path being the filename of the passed in path.

Parameters
[in]t_locationPath of the required file. Converted to a QUrl internally
See also
FileInfo::addRequiredFile(const QUrl &, const openstudio::path &)
FileInfo openstudio::runmanager::FileInfo::complete ( const openstudio::path &  t_basePath) const
std::pair<QUrl, openstudio::path> openstudio::runmanager::FileInfo::getRequiredFile ( const openstudio::path &  filename)

Returns the details of a required file attached to this FileInfo if it exists.

The lookup is performed on the target location of the file.

Exceptions
std::runtime_errorif the required file could not be found
bool openstudio::runmanager::FileInfo::hasRequiredFile ( const openstudio::path &  filename)
bool openstudio::runmanager::FileInfo::operator!= ( const FileInfo t_rhs) const
bool openstudio::runmanager::FileInfo::operator< ( const FileInfo fi) const
bool openstudio::runmanager::FileInfo::operator== ( const FileInfo t_rhs) const
void openstudio::runmanager::FileInfo::prependRequiredFilePath ( const openstudio::path &  t_path)

Prepends a path onto the requiredFiles.

Member Data Documentation

bool openstudio::runmanager::FileInfo::exists

True if the file exists, false if it was removed.

std::string openstudio::runmanager::FileInfo::filename

Short filename.

openstudio::path openstudio::runmanager::FileInfo::fullPath

Full local filename.

std::string openstudio::runmanager::FileInfo::key

A key identifying the type / usage of this file.

openstudio::DateTime openstudio::runmanager::FileInfo::lastModified

Date of last file modification.

std::vector<std::pair<QUrl, openstudio::path> > openstudio::runmanager::FileInfo::requiredFiles

Files required by this FileInfo object.