winIDEA SDK
|
This class can be used to handle documents in winIDEA.
Python example: test_doc_close.py
#include <CDocumentController.h>
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... | |
void | clearMarker () |
Clears the existing marker - implemented only for text documents. More... | |
void | close () |
Closes the document. More... | |
void | closeAll () |
Closes all documents. More... | |
void | closeDiscard () |
Closes the document and discards any unsaved changes. More... | |
CIDEControllerSPtr | getIConnectIDE () |
Returns the isystem.connect IDE interface. More... | |
void | reset (IConnectIDE::EDocumentResetParameter resetScope) |
Resets contents of the document. More... | |
void | resume () |
Starts recording but keeps existing coverage data. 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 | saveAsPrompt () |
Saves the document, winIDEA prompts the user for a new name. More... | |
void | saveCopy (const std::string &newFileName) |
Saves copy of the document under a given file name. More... | |
void | setFocus (int lineNumber) |
Sets focus to the view containing the document. More... | |
void | setMarker (int lineNumber) |
Sets marker at the given line - implemented only for text documents. More... | |
void | start () |
Starts default document action. More... | |
void | start1 () |
Starts alternate document action. More... | |
void | stop () |
Stops document action. More... | |
Protected Member Functions | |
CDocumentController (std::shared_ptr< ConnectionMgr > connectionMgr, const std::string &fileName) | |
Instantiates object. More... | |
|
protected |
Instantiates object.
To be used by derived classes.
connectionMgr | class which maintains connection to winIDEA. Connection must be established before this call. |
fileName | name of the file associated with the document |
Python example: test_doc_close.py
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.
connectionMgr | class which maintains connection to winIDEA. Connection must be established before this call. |
mode | document 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. |
fileName | if 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. |
IOException | in case of an error. |
Python example: test_doc_close.py
void isys::CDocumentController::clearMarker | ( | ) |
Clears the existing marker - implemented only for text documents.
IOException | in case of an error. |
Python example: test_marker.py
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.
IOException | in case of an error. |
Python example: test_doc_close.py
void isys::CDocumentController::closeAll | ( | ) |
Closes all documents.
If there are no documents opened via isystem.connect, CIDEController::closeAllDocuments() can also be used.
IOException | in case of an error. |
Python example: test_doc_close.py
void isys::CDocumentController::closeDiscard | ( | ) |
Closes the document and discards any unsaved changes.
IOException | in case of an error. |
Python example: test_doc_close.py
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.
void isys::CDocumentController::reset | ( | IConnectIDE::EDocumentResetParameter | resetScope | ) |
Resets contents of the document.
resetScope | defines which part of the document to reset. |
Python example: test_reset.py
void isys::CDocumentController::resume | ( | ) |
Starts recording but keeps existing coverage data.
Works on coverage analyzer documents only.
IOException | in case of an error. |
Python example: test_doc_control.py
void isys::CDocumentController::save | ( | ) |
void isys::CDocumentController::saveAs | ( | const std::string & | fileName, |
bool | isForceOverwrite = false |
||
) |
Saves the document with a new name.
IOException | in case of an error. |
Python example: test_save.py
void isys::CDocumentController::saveAsPrompt | ( | ) |
Saves the document, winIDEA prompts the user for a new name.
IOException | in case of an error. |
Python example: test_save.py
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.
IOException | in case of an error. |
Python example: test_save.py
void isys::CDocumentController::setFocus | ( | int | lineNumber | ) |
Sets focus to the view containing the document.
lineNumber | line number in text document to be displayed. |
IOException | in case of an error. |
Python example: test_focus.py
void isys::CDocumentController::setMarker | ( | int | lineNumber | ) |
Sets marker at the given line - implemented only for text documents.
IOException | in case of an error. |
Python example: test_marker.py
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.
IOException | in case of an error. |
Python example: test_doc_control.py
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).
IOException | in case of an error. |
Python example: test_doc_control.py
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:
For script document this method terminates the script.
IOException | in case of an error. |
Python example: test_doc_control.py