MiKTeX 23.10-next
A scalable TeX distribution
|
An instance of this class controls the run-time behaviour of a MiKTeX application. More...
#include <miktex/App/Application.h>
Public Member Functions | |
Application (const Application &other)=delete | |
Application & | operator= (const Application &other)=delete |
Application (Application &&other)=delete | |
Application & | operator= (Application &&other)=delete |
virtual std::string | ExamineArgs (std::vector< const char * > &args, MiKTeX::Core::Session::InitInfo &initInfo) |
virtual std::string | ExamineArgs (std::vector< char * > &args, MiKTeX::Core::Session::InitInfo &initInfo) |
virtual void | Init (const MiKTeX::Core::Session::InitInfo &initInfo, std::vector< const char * > &args) |
virtual void | Init (const MiKTeX::Core::Session::InitInfo &initInfo, std::vector< char * > &args) |
virtual void | Init (const MiKTeX::Core::Session::InitInfo &initInfo) |
virtual void | Init (std::vector< const char * > &args) |
virtual void | Init (std::vector< char * > &args) |
virtual void | Init (const std::string &programInvocationName) |
virtual void | Init (const std::string &programInvocationName, const std::string &theNameOfTheGame) |
virtual void | Finalize () |
Frees application resources. More... | |
virtual void | Finalize2 (int exitCode) |
virtual void | GetLibraryVersions (std::vector< MiKTeX::Core::LibraryVersion > &versions) const |
virtual void | ShowLibraryVersions () const |
Prints version information of loaded libraries. More... | |
bool | InstallPackage (const std::string &packageId, const MiKTeX::Util::PathName &trigger, MiKTeX::Util::PathName &installRoot) override |
Install a package. More... | |
bool | TryCreateFile (const MiKTeX::Util::PathName &fileName, MiKTeX::Core::FileType fileType) override |
Creates a file. More... | |
void | ReportLine (const std::string &message) override |
Prints an installer message. More... | |
bool | OnRetryableError (const std::string &message) override |
Handles an installer error. More... | |
bool | OnProgress (MiKTeX::Packages::Notification nf) override |
Handles an installer notification. More... | |
bool | Trace (const TraceCallback::TraceMessage &traceMessage) override |
Logs a trace message. More... | |
void | EnableInstaller (MiKTeX::Configuration::TriState tri) |
void | FatalError (const std::string &message) |
void | Warning (const std::string &message) |
void | SecurityRisk (const std::string &message) |
void | InvokeEditor (const MiKTeX::Util::PathName &editFileName, int editLineNumber, MiKTeX::Core::FileType editFileType, const MiKTeX::Util::PathName &transcriptFileName) const |
void | Sorry (const std::string &name, const MiKTeX::Core::MiKTeXException &ex) |
void | Sorry (const std::string &name, const std::exception &ex) |
void | Sorry (const std::string &name, const std::string &description, const std::string &remedy, const std::string &url) |
void | Sorry (const std::string &name) |
bool | GetQuietFlag () const |
void | SetQuietFlag (bool b) |
std::shared_ptr< MiKTeX::Core::Session > | GetSession () const |
MiKTeX::Configuration::TriState | GetEnableInstaller () const |
void | LogInfo (const std::string &message) const |
void | LogWarn (const std::string &message) const |
void | LogError (const std::string &message) const |
void | CheckCancel () |
Throws an exception if the application should be terminated. More... | |
virtual bool | InstallPackage (const std::string &packageId, const MiKTeX::Util::PathName &trigger, MiKTeX::Util::PathName &installRoot)=0 |
virtual bool | TryCreateFile (const MiKTeX::Util::PathName &fileName, FileType fileType)=0 |
virtual void | ReportLine (const std::string &str)=0 |
virtual bool | OnRetryableError (const std::string &message)=0 |
virtual bool | OnProgress (Notification nf)=0 |
Public Member Functions inherited from MiKTeX::Trace::TraceCallback | |
virtual bool | Trace (const TraceMessage &traceMessage)=0 |
Static Public Member Functions | |
static Application * | GetApplication () |
Static Protected Member Functions | |
static bool | Cancelled () |
An instance of this class controls the run-time behaviour of a MiKTeX application.
|
staticprotected |
Gets an indication whether the application should be terminated.
true
, if SIGINT
or SIGTERM
has been received. void MiKTeX::App::Application::CheckCancel | ( | ) |
Throws an exception if the application should be terminated.
void MiKTeX::App::Application::EnableInstaller | ( | MiKTeX::Configuration::TriState | tri | ) |
Enables or disables the auto-installer.
tri | The new state (on, off, inherit configuration default). |
|
virtual |
Filters out and processes special MiKTeX command-line arguments.
[in,out] | args | The command-line arguments to examine and modify. |
[in,out] | initInfo | The session initialization options to modify. |
|
virtual |
Filters out and processes special MiKTeX command-line arguments.
[in,out] | args | The command-line arguments to examine and modify. |
[in,out] | initInfo | The session initialization options to modify. |
void MiKTeX::App::Application::FatalError | ( | const std::string & | message | ) |
Terminates the application with an error.
message | The error message. |
|
virtual |
Frees application resources.
Reimplemented in MiKTeX::TeXAndFriends::ETeXApp, MiKTeX::TeXAndFriends::MetafontApp, MiKTeX::TeXAndFriends::TeXApp, MiKTeX::TeXAndFriends::TeXMFApp, MiKTeX::TeXAndFriends::WebApp, and MiKTeX::TeXAndFriends::WebAppInputLine.
|
virtual |
Frees application resources.
exitCode | The exit code to write to the log file. |
|
static |
Gets the current application object.
MiKTeX::Configuration::TriState MiKTeX::App::Application::GetEnableInstaller | ( | ) | const |
Gets the current auto-installer mode.
|
inlinevirtual |
Collects version information of loaded libraries.
[in,out] | versions | The version table to modify. |
bool MiKTeX::App::Application::GetQuietFlag | ( | ) | const |
Gets an indication whether the application is in quiet mode.
true
, if the application is in quiet mode. std::shared_ptr< MiKTeX::Core::Session > MiKTeX::App::Application::GetSession | ( | ) | const |
Gets the current session.
|
virtual |
Initializes the application.
initInfo | Session initialization options. |
|
virtual |
Initializes the application.
initInfo | Session initialization options. | |
[in,out] | args | The command-line arguments to examine and modify. |
|
virtual |
Initializes the application.
initInfo | Session initialization options. | |
[in,out] | args | The command-line arguments to examine and modify. |
|
virtual |
Initializes the application.
programInvocationName | The program invocation name. |
|
virtual |
Initializes the application.
programInvocationName | The program invocation name. |
theNameOfTheGame | The user friendly program name. |
|
virtual |
Initializes the application.
[in,out] | args | The command-line arguments to examine and modify. |
Reimplemented in MiKTeX::TeXAndFriends::ETeXApp, MiKTeX::TeXAndFriends::MetafontApp, MiKTeX::TeXAndFriends::TeXApp, MiKTeX::TeXAndFriends::TeXMFApp, MiKTeX::TeXAndFriends::WebApp, and MiKTeX::TeXAndFriends::WebAppInputLine.
|
virtual |
Initializes the application.
[in,out] | args | The command-line arguments to examine and modify. |
|
overridevirtual |
Install a package.
This method gets called by the session object when a package needs to be installed.
packageId | The ID of the requested package. |
trigger | The path to the file which triggered the auto-installer. |
installRoot | The path to the installation root directory. |
true
, if the package has been installed. Implements MiKTeX::Core::IFindFileCallback.
void MiKTeX::App::Application::InvokeEditor | ( | const MiKTeX::Util::PathName & | editFileName, |
int | editLineNumber, | ||
MiKTeX::Core::FileType | editFileType, | ||
const MiKTeX::Util::PathName & | transcriptFileName | ||
) | const |
Starts a text editor.
editFileName | Path to the file to be edited. |
editLineNumber | The line where the edit cursor should be moved to. |
editFileType | The file type. |
transcriptFileName | Path to a secondary file (usually a log file). |
void MiKTeX::App::Application::LogError | ( | const std::string & | message | ) | const |
Logs an error message.
message | The message to log. |
void MiKTeX::App::Application::LogInfo | ( | const std::string & | message | ) | const |
Logs an informational message.
message | The message to log. |
void MiKTeX::App::Application::LogWarn | ( | const std::string & | message | ) | const |
Logs a warning message.
message | The message to log. |
|
overridevirtual |
Handles an installer notification.
This method gets called by the installer when the current phase ends or when a new phase begins.
nf | The notification. |
Implements MiKTeX::Packages::PackageInstallerCallback.
|
overridevirtual |
Handles an installer error.
This method gets called by the installer when an error occured.
message | The error message. |
false
to cancel the installer. Implements MiKTeX::Packages::PackageInstallerCallback.
|
overridevirtual |
Prints an installer message.
This method gets called by the installer when a message should be written to the report stream.
message | The message text. |
Implements MiKTeX::Packages::PackageInstallerCallback.
void MiKTeX::App::Application::SecurityRisk | ( | const std::string & | message | ) |
Print a security warning nessage.
message | The security warning message. |
void MiKTeX::App::Application::SetQuietFlag | ( | bool | b | ) |
|
virtual |
Prints version information of loaded libraries.
|
inline |
Prints a user friendly error message.
name | User friendly program name. |
void MiKTeX::App::Application::Sorry | ( | const std::string & | name, |
const MiKTeX::Core::MiKTeXException & | ex | ||
) |
Prints a user friendly error message.
name | User friendly program name. |
ex | Error information. |
void MiKTeX::App::Application::Sorry | ( | const std::string & | name, |
const std::exception & | ex | ||
) |
Prints a user friendly error message.
name | User friendly program name. |
ex | Error information. |
void MiKTeX::App::Application::Sorry | ( | const std::string & | name, |
const std::string & | description, | ||
const std::string & | remedy, | ||
const std::string & | url | ||
) |
Prints a user friendly error message.
name | User friendly program name. |
description | A user friendly description of the error. |
remedy | A user friendly recipe to remedy the error. |
url | A link to a help page. |
|
override |
Logs a trace message.
This method gets called when a trace message should be logged.
traceMessage | The trace message to log. |
|
overridevirtual |
Creates a file.
This method gets called by the session object when a file (e.g., pdflatex.fmt
) needs to be created.
fileName | The path to the file. |
fileType | The file type. |
true
, if the file has been created. Implements MiKTeX::Core::IFindFileCallback.
void MiKTeX::App::Application::Warning | ( | const std::string & | message | ) |
Print a warning nessage.
message | The warning message. |