winIDEA SDK
isys::CDocumentController Class Reference

Description

This class can be used to handle documents in winIDEA.

Python example: test_doc_close.py

#include <CDocumentController.h>

Inheritance diagram for isys::CDocumentController:
isys::WrapperBase isys::CAnalyzerDocController isys::CTerminalDocController isys::CCoverageController2 isys::CProfilerController2 isys::CTraceController

Public Member Functions

 CDocumentController (std::shared_ptr< ConnectionMgr > connectionMgr, const std::string &fileName, const std::string &mode)
 Creates a new document or opens an existing one. More...
 
CIDEControllerSPtr getIConnectIDE ()
 Returns the isystem.connect IDE interface. More...
 
void start ()
 Starts default document action. More...
 
void start1 ()
 Starts alternate document action. More...
 
void stop ()
 Stops document action. More...
 
void resume ()
 Starts recording but keeps existing coverage data. More...
 
void close ()
 Closes the document. More...
 
void closeDiscard ()
 Closes the document and discards any unsaved changes. More...
 
void closeAll ()
 Closes all documents. More...
 
void reset (IConnectIDE::EDocumentResetParameter resetScope)
 Resets contents of the document. More...
 
void save ()
 Saves the document. More...
 
void saveAs (const std::string &fileName, bool isForceOverwrite=false)
 Saves the document with a new name. More...
 
void saveCopy (const std::string &newFileName)
 Saves copy of the document under a given file name. More...
 
void saveAsPrompt ()
 Saves the document, winIDEA prompts the user for a new name. More...
 
void setMarker (int lineNumber)
 Sets marker at the given line - implemented only for text documents. More...
 
void clearMarker ()
 Clears the existing marker - implemented only for text documents. More...
 
void setFocus (int lineNumber)
 Sets focus to the view containing the document. More...
 

Protected Member Functions

 CDocumentController (std::shared_ptr< ConnectionMgr > connectionMgr, const std::string &fileName)
 Instantiates object. More...
 

Constructor & Destructor Documentation

◆ CDocumentController() [1/2]

isys::CDocumentController::CDocumentController ( std::shared_ptr< ConnectionMgr connectionMgr,
const std::string &  fileName 
)
protected

Instantiates object.

To be used by derived classes.

Parameters
connectionMgrclass which maintains connection to winIDEA. Connection must be established before this call.
fileNamename of the file associated with the document

Python example: test_doc_close.py

◆ CDocumentController() [2/2]

isys::CDocumentController::CDocumentController ( std::shared_ptr< ConnectionMgr connectionMgr,
const std::string &  fileName,
const std::string &  mode 
)

Creates a new document or opens an existing one.

Parameters
connectionMgrclass which maintains connection to winIDEA. Connection must be established before this call.
modedocument open mode. 'u' opens existing file for update (file must exist), 'w' opens existing file and deletes contents, or creates a new file, 'a' opens existing file and keeps contents, or creates a new file if it does not exist.
fileNameif not an empty string, it is used, otherwise the user is prompted for fileName by winIDEA. In the later case this object can not be used, because the file name is known only in winIDEA.
Exceptions
IOExceptionin case of an error.

Python example: test_doc_close.py

Member Function Documentation

◆ clearMarker()

void isys::CDocumentController::clearMarker ( )

Clears the existing marker - implemented only for text documents.

Exceptions
IOExceptionin case of an error.

Python example: test_marker.py

◆ close()

void isys::CDocumentController::close ( )

Closes the document.

If the document is changed but not saved, winIDEA prompts user if he would like to save the file.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_close.py

◆ closeAll()

void isys::CDocumentController::closeAll ( )

Closes all documents.

If there are no documents opened via isystem.connect, CIDEController::closeAllDocuments() can also be used.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_close.py

◆ closeDiscard()

void isys::CDocumentController::closeDiscard ( )

Closes the document and discards any unsaved changes.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_close.py

◆ getIConnectIDE()

CIDEControllerSPtr isys::CDocumentController::getIConnectIDE ( )

Returns the isystem.connect IDE interface.

Use this method only when some functionality of the IConnectIDE interface regarding workspace handling is not accessible from this wrapper.

◆ reset()

void isys::CDocumentController::reset ( IConnectIDE::EDocumentResetParameter  resetScope)

Resets contents of the document.

Parameters
resetScopedefines which part of the document to reset.

Python example: test_reset.py

◆ resume()

void isys::CDocumentController::resume ( )

Starts recording but keeps existing coverage data.

Works on coverage analyzer documents only.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_control.py

◆ save()

void isys::CDocumentController::save ( )

Saves the document.

Exceptions
IOExceptionin case of an error.

Python example: test_save.py

◆ saveAs()

void isys::CDocumentController::saveAs ( const std::string &  fileName,
bool  isForceOverwrite = false 
)

Saves the document with a new name.

Exceptions
IOExceptionin case of an error.

Python example: test_save.py

◆ saveAsPrompt()

void isys::CDocumentController::saveAsPrompt ( )

Saves the document, winIDEA prompts the user for a new name.

Exceptions
IOExceptionin case of an error.

Python example: test_save.py

◆ saveCopy()

void isys::CDocumentController::saveCopy ( const std::string &  newFileName)

Saves copy of the document under a given file name.

The name of the opened document does not change. If the destination file already exists, it is overwritten. Use this method to save intermediate results, for example coverage between several runs.

Exceptions
IOExceptionin case of an error.

Python example: test_save.py

◆ setFocus()

void isys::CDocumentController::setFocus ( int  lineNumber)

Sets focus to the view containing the document.

Parameters
lineNumberline number in text document to be displayed.
Exceptions
IOExceptionin case of an error.

Python example: test_focus.py

◆ setMarker()

void isys::CDocumentController::setMarker ( int  lineNumber)

Sets marker at the given line - implemented only for text documents.

Exceptions
IOExceptionin case of an error.

Python example: test_marker.py

◆ start()

void isys::CDocumentController::start ( )

Starts default document action.

Starts recording if the document type is coverage, profiler or trace, or executes the script if it is a script document. Existing contents of analyzer document is always deleted when this method is called. It is possible to preserve existing coverage information by calling method resume(), instead of this method.

Note: If analyzer is started, then option 'Reactivate session after CPU stop' has no effect. Analyzer will not be automatically started.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_control.py

◆ start1()

void isys::CDocumentController::start1 ( )

Starts alternate document action.

Repeats analysis on a previously recorded data if the document type is analyzer. Usage example: if document is recorded as trace (trace trigger is used), but we want to perform profiler analysis later (with profiler trigger).

Exceptions
IOExceptionin case of an error.

Python example: test_doc_control.py

◆ stop()

void isys::CDocumentController::stop ( )

Stops document action.

For analyzer documents this action is deprecated. Use one of stop...() methods of CAnalyzerController instead.

This method triggers the following state transitions on analyzer document:

  • waiting for trigger: forces trigger, sampling starts
  • sampling: stops sampling, enters loading state and waits until loading is finished
  • loading (data from debugger to PC): waits until loading finishes, does NOT stop it!
  • analyzing: stops analysis. If coverage and profiler analysis are running, call this method twice to stop both.
  • idle: does nothing

For script document this method terminates the script.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_control.py