Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Data::StudyHeader Class Referencefinal

Header of a study. More...

#include <header.h>

Static Public Member Functions

static bool readVersionFromFile (const std::filesystem::path &filename, std::string &version)
 Get the version of a header.
 

Constructor & Destructor

Yuni::String caption
 Caption of the study.
 
StudyVersion version
 Format version.
 
time_t dateCreated
 Date: Creation (timestamp)
 
time_t dateLastSave
 Date: Last save (timestamp)
 
Yuni::String author
 Author.
 
static StudyVersion tryToFindTheVersion (const std::string &folder)
 Try to determine the version of a study.
 
 StudyHeader ()
 Default constructor.
 
 ~StudyHeader ()=default
 Destructor.
 
void reset ()
 Reset the values.
 
bool loadFromFile (const std::filesystem::path &filename, bool warnings=true)
 Load a study header from a file.
 
bool saveToFile (const AnyString &filename, bool upgradeVersion=true)
 Save a study header into a file.
 
void CopySettingsToIni (IniFile &ini, bool upgradeVersion)
 Copy the internal settings into an INI structure.
 
bool validateVersion ()
 

Detailed Description

Header of a study.

Member Function Documentation

◆ loadFromFile()

bool Antares::Data::StudyHeader::loadFromFile ( const std::filesystem::path & filename,
bool warnings = true )

Load a study header from a file.

Parameters
filenameThe target filename
warningsEnable warnings/errors
Returns
True if the operation succeeded, false otherwise

◆ readVersionFromFile()

bool Antares::Data::StudyHeader::readVersionFromFile ( const std::filesystem::path & filename,
std::string & version )
static

Get the version of a header.

Parameters
filenameThe filename to read
Returns
The version of the study, or 0 if unknown (invalid header)

◆ saveToFile()

bool Antares::Data::StudyHeader::saveToFile ( const AnyString & filename,
bool upgradeVersion = true )

Save a study header into a file.

The property version will be upgraded to the last available and dateLastSave as well.

Parameters
filenameThe target filename
Returns
True if the operation succeeded, false otherwise

◆ tryToFindTheVersion()

StudyVersion Antares::Data::StudyHeader::tryToFindTheVersion ( const std::string & folder)
static

Try to determine the version of a study.

Parameters
folderThe folder where data are located
Returns
The version of the study. unknown if not found

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