#include "IddFile.hpp"
Public Member Functions | |
std::string | version () const |
std::string | build () const |
std::string | header () const |
std::vector< IddObject > | objects () const |
std::vector< std::string > | groups () const |
std::vector< IddObject > | getObjectsInGroup (const std::string &group) const |
std::vector< IddObject > | getObjects (const boost::regex &objectRegex) const |
boost::optional< IddObject > | versionObject () const |
boost::optional< IddObject > | getObject (const std::string &objectName) const |
boost::optional< IddObject > | getObject (IddObjectType objectType) const |
std::vector< IddObject > | requiredObjects () const |
std::vector< IddObject > | uniqueObjects () const |
Protected Member Functions | |
void | addObject (const IddObject &object) |
void | setBuild (const std::string &build) |
void | setHeader (const std::string &header) |
void | setVersion (const std::string &version) |
Related Functions | |
typedef std::vector< IddFile > | IddFileVector |
std::ostream & | operator<< (std::ostream &os, const IddFile &iddFile) |
typedef boost::optional< IddFile > | OptionalIddFile |
Constructors | |
IddFile () | |
IddFile (const IddFile &other) | |
static IddFile | catchallIddFile () |
Serialization | |
std::ostream & | print (std::ostream &os) const |
bool | save (const openstudio::path &p, bool overwrite=false) |
static boost::optional< IddFile > | load (std::istream &is) |
static boost::optional< IddFile > | load (const openstudio::path &p) |
static std::pair < VersionString, std::string > | parseVersionBuild (const openstudio::path &p) |
IddFile provides parsing and printing of text files in Input Data Definition (IDD) format.
IDD is a schema definition format defined by the EnergyPlus team, adopted with slight modifications for the OpenStudio project. IddFile is a shared object.
openstudio::IddFile::IddFile | ( | ) |
Default constructor returns an IddFile with no version, no header, and no objects.
openstudio::IddFile::IddFile | ( | const IddFile & | other | ) |
Copy constructor returns an IddFile that shares its data with other.
|
protected |
add an object
std::string openstudio::IddFile::build | ( | ) | const |
Returns the file build (as specified in the header).
|
static |
boost::optional<IddObject> openstudio::IddFile::getObject | ( | const std::string & | objectName | ) | const |
Returns the object named objectName (case-insensitive).
Return value will evaluate to false if there is no such object in the IddFile.
boost::optional<IddObject> openstudio::IddFile::getObject | ( | IddObjectType | objectType | ) | const |
Returns the object of type objectType, if possible.
Return value will evaluate to false if there is no such object in the IddFile, or if IddObjectType == IddObjectType::UserCustom.
std::vector<IddObject> openstudio::IddFile::getObjects | ( | const boost::regex & | objectRegex | ) | const |
Returns the objects whose names match objectRegex.
std::vector<IddObject> openstudio::IddFile::getObjectsInGroup | ( | const std::string & | group | ) | const |
Returns all objects in group (e.g.
"Simulation Parameters").
std::vector<std::string> openstudio::IddFile::groups | ( | ) | const |
Returns all groups in the file (e.g.
"" and "Simulation Parameters").
std::string openstudio::IddFile::header | ( | ) | const |
Returns the file header.
|
static |
Load an IddFile from std::istream, if possible.
|
static |
Load an IddFile from path p, if possible.
std::vector<IddObject> openstudio::IddFile::objects | ( | ) | const |
Returns all the objects in the file.
|
static |
Returns the version and build SHA from the given Idd.
If build SHA is not present .second will be empty.
an | exception with a meaningful error message if something goes wrong |
std::ostream& openstudio::IddFile::print | ( | std::ostream & | os | ) | const |
Prints this file to std::ostream os.
std::vector<IddObject> openstudio::IddFile::requiredObjects | ( | ) | const |
Returns all objects in the file that are required.
An IdfFile or Workspace conforming to this IddFile must contain at least one object of each of these types to be valid at StrictnessLevel::Final.
bool openstudio::IddFile::save | ( | const openstudio::path & | p, |
bool | overwrite = false |
||
) |
Saves file to path p.
Will construct the parent folder if necessary and if its parent folder already exists. Will only overwrite an existing file if overwrite==true. If no extension is provided will use 'idd'.
|
protected |
set build
|
protected |
set header
|
protected |
set version
std::vector<IddObject> openstudio::IddFile::uniqueObjects | ( | ) | const |
Returns all objects in the file that are marked as unique.
An IdfFile or Workspace conforming to this IddFile must contain at most one object of each of these types to be valid at StrictnessLevel::Final.
std::string openstudio::IddFile::version | ( | ) | const |
Returns the file version (as specified in the header).
boost::optional<IddObject> openstudio::IddFile::versionObject | ( | ) | const |
Returns the version IddObject for this file, if possible.
|
related |
|
related |
|
related |