OpenStudioCore:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
List of all members
openstudio::ImfFile Class Reference

#include <ImfFile.hpp>

Public Member Functions

Constructors
 ImfFile (IddFileType iddFileType=IddFileType("EnergyPlus"))
 default constructor More...
 
Getters
IddFile iddFile () const
 Get the IddFile. More...
 
IddFileType iddFileType () const
 Get the IddFile's IddFileType. More...
 
StringVector sectionNames () const
 Return the names of all sections. More...
 
IdfObjectVector section (const std::string &section) const
 Get a section by name. More...
 
Queries
unsigned numSections () const
 Return the number of sections in the ImfFile. More...
 

Serialization

std::ostream & print (std::ostream &os) const
 print file to std::stream More...
 
bool save (const openstudio::path &p, bool overwrite=false)
 Save IddFile to path. More...
 
static boost::optional< ImfFileload (std::istream &is, IddFileType iddFileType)
 load file from std::istream. assumes objects are in sub-idd file fileType of IddFactory. More...
 
static boost::optional< ImfFileload (std::istream &is, const IddFile &iddFile)
 load file from std::istream. use user-supplied IddFile. More...
 
static boost::optional< ImfFileload (const openstudio::path &p, IddFileType iddFileType)
 load from file path More...
 
static boost::optional< ImfFileload (const openstudio::path &p, const IddFile &iddFile)
 load from file path More...
 

Detailed Description

ImfFile represents an Imf file.

ImfFile does not have any copy or assignment operators so it is not a shared object. ImfFile does not support advanced imf syntax, only sectioning by

##def Schedules[]

, etc.

Constructor & Destructor Documentation

openstudio::ImfFile::ImfFile ( IddFileType  iddFileType = IddFileType("EnergyPlus"))

default constructor

Member Function Documentation

IddFile openstudio::ImfFile::iddFile ( ) const

Get the IddFile.

If one is not explicitly held by this object, returns one from IddFactory per the documentation for this class.

IddFileType openstudio::ImfFile::iddFileType ( ) const

Get the IddFile's IddFileType.

static boost::optional<ImfFile> openstudio::ImfFile::load ( std::istream &  is,
IddFileType  iddFileType 
)
static

load file from std::istream. assumes objects are in sub-idd file fileType of IddFactory.

static boost::optional<ImfFile> openstudio::ImfFile::load ( std::istream &  is,
const IddFile iddFile 
)
static

load file from std::istream. use user-supplied IddFile.

static boost::optional<ImfFile> openstudio::ImfFile::load ( const openstudio::path &  p,
IddFileType  iddFileType 
)
static

load from file path

static boost::optional<ImfFile> openstudio::ImfFile::load ( const openstudio::path &  p,
const IddFile iddFile 
)
static

load from file path

unsigned openstudio::ImfFile::numSections ( ) const

Return the number of sections in the ImfFile.

std::ostream& openstudio::ImfFile::print ( std::ostream &  os) const

print file to std::stream

bool openstudio::ImfFile::save ( const openstudio::path &  p,
bool  overwrite = false 
)

Save IddFile to path.

Will construct parent folder, but no further up the chain. Will only overwrite an existing file if overwrite==true. If no extension is provided will use 'imf'.

IdfObjectVector openstudio::ImfFile::section ( const std::string &  section) const

Get a section by name.

StringVector openstudio::ImfFile::sectionNames ( ) const

Return the names of all sections.