Skip to main content

ModelCenter APIs 2025 R2

Interface PHXDATAHISTORYLib::ISaveContext

Last update: 16.07.2025

Definition: LIBS/DataExplorer/PHXDataHistory/PHXDataHistory.odl (line 1209)

Object for assisting in save and restoring files.

Members

Public functions

Function saveFile

boolean PHXDATAHISTORYLib::ISaveContext::saveFile(BSTR sourceLocation, BSTR context)

Save a file into the context. If the save is successful passing the context to restore as the file ID will return the saved file. Parameters:

  • sourceLocation: the location of the source file to save
  • context: context by which to save

Returns:

true if the file was saved successfully; false otherwise

Parameters:

  • BSTR sourceLocation
  • BSTR context

Return type: boolean

Function restoreFile

boolean PHXDATAHISTORYLib::ISaveContext::restoreFile(BSTR fileID, BSTR targetLocation)

Restores the file by ID to the given location. Parameters:

  • fileID: id of the file to restore
  • targetLocation: disk location to restore the file

Returns:

true if a file with the given id was restored, false on failure

Parameters:

  • BSTR fileID
  • BSTR targetLocation

Return type: boolean

Function close

void PHXDATAHISTORYLib::ISaveContext::close()

Closes the save context.

Return type: void

Function getSaveLocation

BSTR PHXDATAHISTORYLib::ISaveContext::getSaveLocation()

Gets the disk location this save context saves. Returns:

the save context file path

Return type: BSTR

Function saveFileStream

LPUNKNOWN PHXDATAHISTORYLib::ISaveContext::saveFileStream(BSTR context)

Gets a stream that can be used for saving a file to the context. Only one stream may be open at a time. Parameters:

  • context: context by which to save

Returns:

output stream for saving

Parameters:

  • BSTR context

Return type: LPUNKNOWN

Function restoreFileStream

LPUNKNOWN PHXDATAHISTORYLib::ISaveContext::restoreFileStream(BSTR fileID)

Gets a stream that can be used for restoring a file saved into the context with the given ID. Only one stream may be open at a time. Parameters:

  • fileID: id of the file to restore

Returns:

input stream for restoring

Parameters:

  • BSTR fileID

Return type: LPUNKNOWN

Function getFileFormat

int PHXDATAHISTORYLib::ISaveContext::getFileFormat()

Get the file format of the save context instance. Returns:

save context file format

Return type: int

Function setFileFormat

void PHXDATAHISTORYLib::ISaveContext::setFileFormat(int fileFormat)

Set the file format of the save context. Parameters:

  • fileFormat: file format of save context instance

Parameters:

  • int fileFormat

Return type: void

Connect with Ansys