OpenStudio:modelica
Loading...
Searching...
No Matches
Public Member Functions | List of all members
openstudio::modelica::ModelicaFile Class Reference

#include <ModelicaFile.hpp>

Public Member Functions

ClassDefinition addClassDefinition (const std::string &text)
 Append a new class definition represented by text to the file.
 
ClassDefinition getClassDefinitionByName (const std::string &name)
 Retrieve the class definition whose long class specifier matches name.
 
std::vector< ClassDefinitiongetClassDefinitions ()
 Retrieve all top-level class definitions contained in the file.
 
std::string getText () const
 Return the raw Modelica source text represented by this file.
 
 ModelicaFile (const openstudio::path &path)
 Construct a ModelicaFile by reading and parsing the file located at path.
 
void parse (const std::string &text)
 Parse Modelica source text, replacing the current contents.
 
std::string printTree () const
 Return a formatted representation of the parse tree primarily for debugging.
 
 ~ModelicaFile ()
 Destroy the ModelicaFile.
 
Special member functions
 ModelicaFile (const ModelicaFile &other)
 Copy-construct a ModelicaFile, sharing the underlying implementation.
 
 ModelicaFile (ModelicaFile &&other) noexcept
 Move-construct a ModelicaFile, transferring ownership of the implementation.
 
ModelicaFileoperator= (const ModelicaFile &other)
 Copy-assign a ModelicaFile, sharing the underlying implementation.
 
ModelicaFileoperator= (ModelicaFile &&other) noexcept
 Move-assign a ModelicaFile, transferring ownership of the implementation.
 

Detailed Description

A parsed Modelica source file backed by the OpenStudio Modelica parser.

ModelicaFile owns the parsed token stream and exposes helper methods for interrogating and mutating the class definitions contained in the file.

Constructor & Destructor Documentation

◆ ModelicaFile() [1/3]

openstudio::modelica::ModelicaFile::ModelicaFile ( const openstudio::path & path)

Construct a ModelicaFile by reading and parsing the file located at path.

◆ ModelicaFile() [2/3]

openstudio::modelica::ModelicaFile::ModelicaFile ( const ModelicaFile & other)

Copy-construct a ModelicaFile, sharing the underlying implementation.

◆ ModelicaFile() [3/3]

openstudio::modelica::ModelicaFile::ModelicaFile ( ModelicaFile && other)
noexcept

Move-construct a ModelicaFile, transferring ownership of the implementation.

◆ ~ModelicaFile()

openstudio::modelica::ModelicaFile::~ModelicaFile ( )

Destroy the ModelicaFile.

Member Function Documentation

◆ addClassDefinition()

ClassDefinition openstudio::modelica::ModelicaFile::addClassDefinition ( const std::string & text)

Append a new class definition represented by text to the file.

◆ getClassDefinitionByName()

ClassDefinition openstudio::modelica::ModelicaFile::getClassDefinitionByName ( const std::string & name)

Retrieve the class definition whose long class specifier matches name.

◆ getClassDefinitions()

std::vector< ClassDefinition > openstudio::modelica::ModelicaFile::getClassDefinitions ( )

Retrieve all top-level class definitions contained in the file.

◆ getText()

std::string openstudio::modelica::ModelicaFile::getText ( ) const

Return the raw Modelica source text represented by this file.

◆ operator=() [1/2]

ModelicaFile & openstudio::modelica::ModelicaFile::operator= ( const ModelicaFile & other)

Copy-assign a ModelicaFile, sharing the underlying implementation.

◆ operator=() [2/2]

ModelicaFile & openstudio::modelica::ModelicaFile::operator= ( ModelicaFile && other)
noexcept

Move-assign a ModelicaFile, transferring ownership of the implementation.

◆ parse()

void openstudio::modelica::ModelicaFile::parse ( const std::string & text)

Parse Modelica source text, replacing the current contents.

◆ printTree()

std::string openstudio::modelica::ModelicaFile::printTree ( ) const

Return a formatted representation of the parse tree primarily for debugging.