MiKTeX 23.10-next
A scalable TeX distribution
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
MiKTeX::Core::Session Class Referenceabstract

The MiKTeX session interface. More...

#include <miktex/Core/Session.h>

Inheritance diagram for MiKTeX::Core::Session:
Inheritance graph
[legend]
Collaboration diagram for MiKTeX::Core::Session:
Collaboration graph
[legend]

Classes

class  InitInfo
 Extended initialization options. More...
 
struct  OpenFileInfo
 Information about an open file. More...
 

Public Types

enum class  FindFileOption { Create , Renew , All , SearchFileSystem }
 Find file options. More...
 
enum class  InitOption { SettingUp , NoFixPath , AdminMode }
 Initialization options. More...
 
enum class  ExamineCommandLineResult { ProbablySafe , MaybeSafe , NotSafe , SyntaxError }
 Result of a command-line examination. More...
 
typedef MiKTeX::Util::OptionSet< FindFileOptionFindFileOptionSet
 
typedef MiKTeX::Util::OptionSet< InitOptionInitOptionSet
 Init flags enum. More...
 

Public Member Functions

virtual void Close ()=0
 Closes this session object. More...
 
virtual void Reset ()=0
 Resets this session object. More...
 
virtual void PushAppName (const std::string &name)=0
 
virtual void PushBackAppName (const std::string &name)=0
 
virtual void AddInputDirectory (const MiKTeX::Util::PathName &path, bool atEnd)=0
 
virtual std::vector< RootDirectoryInfoGetRootDirectories ()=0
 
virtual unsigned GetNumberOfTEXMFRoots ()=0
 
virtual MiKTeX::Util::PathName GetRootDirectoryPath (unsigned r)=0
 
virtual bool IsCommonRootDirectory (unsigned r)=0
 
virtual bool IsOtherRootDirectory (unsigned r)=0
 
virtual MiKTeX::Util::PathName GetMpmRootPath ()=0
 
virtual MiKTeX::Util::PathName GetMpmDatabasePathName ()=0
 
virtual unsigned TryDeriveTEXMFRoot (const MiKTeX::Util::PathName &path)=0
 
virtual unsigned DeriveTEXMFRoot (const MiKTeX::Util::PathName &path)=0
 
virtual bool FindFilenameDatabase (unsigned r, MiKTeX::Util::PathName &path)=0
 
virtual MiKTeX::Util::PathName GetFilenameDatabasePathName (unsigned r)=0
 
virtual bool UnloadFilenameDatabase ()=0
 
virtual bool UnloadFilenameDatabase (std::chrono::duration< double > minIdleTime)=0
 
virtual unsigned SplitTEXMFPath (const MiKTeX::Util::PathName &path, MiKTeX::Util::PathName &root, MiKTeX::Util::PathName &relative)=0
 
virtual void RegisterRootDirectories (const StartupConfig &startupConfig, RegisterRootDirectoriesOptionSet options)=0
 
virtual void RegisterRootDirectory (const MiKTeX::Util::PathName &path, bool other)=0
 
virtual void UnregisterRootDirectory (const MiKTeX::Util::PathName &path, bool other)=0
 
virtual void MoveRootDirectoryUp (unsigned r)=0
 
virtual void MoveRootDirectoryDown (unsigned r)=0
 
virtual bool IsMiKTeXDirect ()=0
 
virtual bool IsMiKTeXPortable ()=0
 
virtual bool GetMETAFONTMode (unsigned idx, MIKTEXMFMODE &mode)=0
 
virtual bool DetermineMETAFONTMode (unsigned dpi, MIKTEXMFMODE &Mode)=0
 
virtual std::string GetEngineName ()=0
 
virtual FILE * OpenFile (const MiKTeX::Util::PathName &path, FileMode mode, FileAccess access, bool isTextFile)=0
 
virtual FILE * TryOpenFile (const MiKTeX::Util::PathName &path, FileMode mode, FileAccess access, bool isTextFile)=0
 
virtual std::pair< bool, OpenFileInfoTryGetOpenFileInfo (FILE *file)=0
 
virtual void CloseFile (FILE *file, int &exitCode)=0
 
virtual void CloseFile (FILE *file)=0
 
virtual bool IsOutputFile (const FILE *file)=0
 
virtual bool IsFileAlreadyOpen (const MiKTeX::Util::PathName &fileName)=0
 
virtual void ScheduleSystemCommand (const std::string &commandLine)=0
 
virtual void ScheduleFileRemoval (const MiKTeX::Util::PathName &path)=0
 
virtual bool StartFileInfoRecorder ()=0
 
virtual bool StartFileInfoRecorder (bool recordPackageNames)=0
 
virtual void SetRecorderPath (const MiKTeX::Util::PathName &path)=0
 
virtual void RecordFileInfo (const MiKTeX::Util::PathName &path, FileAccess access)=0
 
virtual std::vector< FileInfoRecordGetFileInfoRecords ()=0
 
virtual FileType DeriveFileType (const MiKTeX::Util::PathName &fileName)=0
 
virtual LocateResult Locate (const std::string &fileName, const LocateOptions &options)=0
 
virtual bool FindFile (const std::string &fileName, const std::string &searchPath, FindFileOptionSet options, std::vector< MiKTeX::Util::PathName > &result)=0
 
virtual bool FindFile (const std::string &fileName, const std::string &searchPath, std::vector< MiKTeX::Util::PathName > &result)=0
 
virtual bool FindFile (const std::string &fileName, const std::string &searchPath, FindFileOptionSet options, MiKTeX::Util::PathName &result)=0
 
virtual bool FindFile (const std::string &fileName, const std::string &searchPath, MiKTeX::Util::PathName &result)=0
 
virtual bool FindFile (const std::string &fileName, FileType fileType, FindFileOptionSet options, std::vector< MiKTeX::Util::PathName > &result)=0
 
virtual bool FindFile (const std::string &fileName, FileType fileType, std::vector< MiKTeX::Util::PathName > &result)=0
 
virtual bool FindFile (const std::string &fileName, FileType fileType, FindFileOptionSet options, MiKTeX::Util::PathName &result)=0
 
virtual bool FindFile (const std::string &fileName, FileType fileType, MiKTeX::Util::PathName &result)=0
 
virtual bool FindPkFile (const std::string &fontName, const std::string &mfMode, int dpi, MiKTeX::Util::PathName &result)=0
 
virtual bool FindTfmFile (const std::string &fontName, MiKTeX::Util::PathName &result, bool create)=0
 
virtual void SetFindFileCallback (IFindFileCallback *callback)=0
 
virtual void SplitFontPath (const MiKTeX::Util::PathName &fontPath, std::string *fontType, std::string *supplier, std::string *typeface, std::string *fontName, std::string *pointSize)=0
 
virtual bool GetFontInfo (const std::string &fontName, std::string &supplier, std::string &typeface, double *genSize)=0
 
virtual MiKTeX::Util::PathName GetGhostscript (unsigned long *versionNumber)=0
 
virtual std::string GetExpandedSearchPath (FileType fileType)=0
 
virtual bool ConvertToBitmapFile (const MiKTeX::Util::PathName &sourceFileName, MiKTeX::Util::PathName &destFileName, IRunProcessCallback *callback)=0
 
virtual bool EnableFontMaker (bool enable)=0
 
virtual bool GetMakeFontsFlag ()=0
 
virtual std::vector< std::string > MakeMakePkCommandLine (const std::string &fontName, int dpi, int baseDpi, const std::string &mfMode, MiKTeX::Util::PathName &fileName, MiKTeX::Configuration::TriState enableInstaller)=0
 
virtual int RunBatch (int argc, const char **argv)=0
 
virtual int RunExe (int argc, const char **argv)=0
 
virtual int RunGhostscript (int argc, const char **argv)=0
 
virtual int RunPerl (int argc, const char **argv)=0
 
virtual int RunPython (int argc, const char **argv)=0
 
virtual int RunJava (int argc, const char **argv)=0
 
virtual bool ShowManualPageAndWait (HWND hWnd, unsigned long topic)=0
 
virtual std::vector< FileTypeInfoGetFileTypes ()=0
 
virtual std::vector< FormatInfoGetFormats ()=0
 
virtual FormatInfo GetFormatInfo (const std::string &key)=0
 
virtual bool TryGetFormatInfo (const std::string &key, FormatInfo &formatInfo)=0
 
virtual void DeleteFormatInfo (const std::string &key)=0
 
virtual void SetFormatInfo (const FormatInfo &formatInfo)=0
 
virtual std::vector< LanguageInfoGetLanguages ()=0
 
virtual MiKTeX::Util::PathName GetMyProgramFile (bool canonicalized)=0
 
virtual MiKTeX::Util::PathName GetMyLocation (bool canonicalized)=0
 
virtual MiKTeX::Util::PathName GetMyPrefix (bool canonicalized)=0
 
virtual bool RunningAsAdministrator ()=0
 
virtual void SetAdminMode (bool adminMode, bool force=false)=0
 
virtual bool IsAdminMode ()=0
 
virtual bool IsSharedSetup ()=0
 
virtual SetupConfig GetSetupConfig ()=0
 
virtual bool GetPaperSizeInfo (int idx, PaperSizeInfo &paperSize)=0
 
virtual PaperSizeInfo GetPaperSizeInfo (const std::string &dvipsName)=0
 
virtual void SetDefaultPaperSize (const std::string &dvipsName)=0
 
virtual bool TryCreateFromTemplate (const MiKTeX::Util::PathName &path)=0
 
virtual bool IsUserAnAdministrator ()=0
 
virtual void ConfigureFile (const MiKTeX::Util::PathName &pathIn, const MiKTeX::Util::PathName &pathOut, MiKTeX::Configuration::HasNamedValues *callback=nullptr)=0
 
virtual void ConfigureFile (const MiKTeX::Util::PathName &pathRel, MiKTeX::Configuration::HasNamedValues *callback=nullptr)=0
 
virtual void SetTheNameOfTheGame (const std::string &name)=0
 
virtual std::vector< std::string > GetFontDirectories ()=0
 
virtual FileTypeInfo GetFileTypeInfo (FileType fileType)=0
 
virtual std::string Expand (const std::string &toBeExpanded)=0
 
virtual std::string Expand (const std::string &toBeExpanded, MiKTeX::Configuration::HasNamedValues *callback)=0
 
virtual std::string Expand (const std::string &toBeExpanded, ExpandOptionSet options, MiKTeX::Configuration::HasNamedValues *callback)=0
 
virtual void SetLanguageInfo (const LanguageInfo &languageInfo)=0
 
virtual ShellCommandMode GetShellCommandMode ()=0
 
virtual std::vector< std::string > GetAllowedShellCommands ()=0
 
virtual std::tuple< ExamineCommandLineResult, std::string, std::string > ExamineCommandLine (const std::string &commandLine)=0
 
- Public Member Functions inherited from MiKTeX::Configuration::ConfigurationProvider
virtual bool TryGetConfigValue (const std::string &sectionName, const std::string &valueName, HasNamedValues *callback, std::string &value)=0
 
virtual bool TryGetConfigValue (const std::string &sectionName, const std::string &valueName, std::string &value)=0
 
virtual ConfigValue GetConfigValue (const std::string &sectionName, const std::string &valueName, const ConfigValue &defaultValue, HasNamedValues *callback)=0
 
virtual ConfigValue GetConfigValue (const std::string &sectionName, const std::string &valueName, const ConfigValue &defaultValue)=0
 
virtual ConfigValue GetConfigValue (const std::string &sectionName, const std::string &valueName, HasNamedValues *callback)=0
 
virtual ConfigValue GetConfigValue (const std::string &sectionName, const std::string &valueName)=0
 
virtual void SetConfigValue (const std::string &sectionName, const std::string &valueName, const ConfigValue &value)=0
 
virtual MiKTeX::Util::PathName GetSpecialPath (SpecialPath specialPath)=0
 

Static Public Member Functions

static std::shared_ptr< SessionTryGet ()
 
static std::shared_ptr< SessionCreate (const InitInfo &initInfo)
 
static void FatalCrtError (const std::string &functionName, int errorCode, const MiKTeXException::KVMAP &info, const SourceLocation &sourceLocation)
 
static void FatalMiKTeXError (const std::string &message, const std::string &description, const std::string &remedy, const std::string &tag, const MiKTeXException::KVMAP &info, const SourceLocation &sourceLocation)
 
static void FatalWindowsError (const std::string &functionName, unsigned long errorCode, const std::string &description, const std::string &remedy, const std::string &tag, const MiKTeXException::KVMAP &info, const SourceLocation &sourceLocation)
 

Detailed Description

The MiKTeX session interface.

Member Typedef Documentation

◆ InitOptionSet

Init flags enum.

Member Enumeration Documentation

◆ ExamineCommandLineResult

Result of a command-line examination.

Enumerator
ProbablySafe 

It's probably safe to run the command.

MaybeSafe 

It's probably unsafe to run the command.

NotSafe 

It's not safe to run the command.

SyntaxError 

The command-line is not well formed.

◆ FindFileOption

Find file options.

Enumerator
Create 

Try to create the file, if it doesn't exist.

Renew 

Renew the file.

All 

Return all files.

SearchFileSystem 

Search the file system.

◆ InitOption

Initialization options.

Enumerator
SettingUp 

We are setting up MiKTeX.

NoFixPath 

Don't fix PATH.

AdminMode 

Start in administrator mode.

Member Function Documentation

◆ AddInputDirectory()

virtual void MiKTeX::Core::Session::AddInputDirectory ( const MiKTeX::Util::PathName path,
bool  atEnd 
)
pure virtual

Adds an inpit directory.

Parameters
pathThe file system path to the directory.
atEndIndicates wheter the directory shall be added at the end of the list.

◆ Close()

virtual void MiKTeX::Core::Session::Close ( )
pure virtual

Closes this session object.

◆ CloseFile() [1/2]

virtual void MiKTeX::Core::Session::CloseFile ( FILE *  file)
pure virtual

Closes a file.

Parameters
fileThe pointer to the FILE object.

◆ CloseFile() [2/2]

virtual void MiKTeX::Core::Session::CloseFile ( FILE *  file,
int &  exitCode 
)
pure virtual

Closes a file.

Parameters
fileThe pointer to the FILE object.

◆ ConfigureFile() [1/2]

virtual void MiKTeX::Core::Session::ConfigureFile ( const MiKTeX::Util::PathName pathIn,
const MiKTeX::Util::PathName pathOut,
MiKTeX::Configuration::HasNamedValues callback = nullptr 
)
pure virtual

Configures a file.

Parameters
pathInThe file system path to the source file.
pathOutThe file system path to the destination file.
callbackThe pointer to an object which implements the HasNamedValue interface.

◆ ConfigureFile() [2/2]

virtual void MiKTeX::Core::Session::ConfigureFile ( const MiKTeX::Util::PathName pathRel,
MiKTeX::Configuration::HasNamedValues callback = nullptr 
)
pure virtual

Configures a file.

Parameters
pathRelThe relative file system path to the destination file.
callbackThe pointer to an object which implements the HasNamedValue interface.

◆ ConvertToBitmapFile()

virtual bool MiKTeX::Core::Session::ConvertToBitmapFile ( const MiKTeX::Util::PathName sourceFileName,
MiKTeX::Util::PathName destFileName,
IRunProcessCallback callback 
)
pure virtual

Converts a graphics file into a Bitmap file.

Parameters
sourceFileNameThe file system path to the source file.
[out]destFileNameThe file system path to the destination file.
callbackThe pointer to an object implementing the IRunProcessCallback callback.
Returns
Returns true, if the conversion was successful.

◆ Create()

static std::shared_ptr< Session > MiKTeX::Core::Session::Create ( const InitInfo initInfo)
static

Creates a new session object.

Parameters
initInfoInitializtion options.
Returns
Returns a smart pointer to the new session object.

◆ DeleteFormatInfo()

virtual void MiKTeX::Core::Session::DeleteFormatInfo ( const std::string &  key)
pure virtual

Removes a format.

Parameters
keyIdentifies the format.

◆ DeriveFileType()

virtual FileType MiKTeX::Core::Session::DeriveFileType ( const MiKTeX::Util::PathName fileName)
pure virtual

Gets the file type from a given file name.

Parameters
fileNameThe file name.
Returns
Returns the derived file type.

◆ DeriveTEXMFRoot()

virtual unsigned MiKTeX::Core::Session::DeriveTEXMFRoot ( const MiKTeX::Util::PathName path)
pure virtual

Get a root directory index from a file system path.

Parameters
pathThe file system path.
Returns
Returns a root directory index.

◆ DetermineMETAFONTMode()

virtual bool MiKTeX::Core::Session::DetermineMETAFONTMode ( unsigned  dpi,
MIKTEXMFMODE Mode 
)
pure virtual

Gets the METAFONT mode matching a given resolution.

Parameters
dpiThe resolution (in dots per inch).
[out]modeThe METAFONT mode.
Returns
Returns true, if the METAFONT mode could be retrieved.

◆ EnableFontMaker()

virtual bool MiKTeX::Core::Session::EnableFontMaker ( bool  enable)
pure virtual

Enables or disables automatic font file creation.

Parameters
enableIndicates whether automatic font file creation is enabled.
Returns
Returns true, if automatic font creation file was enabled.

◆ ExamineCommandLine()

virtual std::tuple< ExamineCommandLineResult, std::string, std::string > MiKTeX::Core::Session::ExamineCommandLine ( const std::string &  commandLine)
pure virtual

Examines a command-line.

Parameters
commandLineThe command-line to examine.
Returns
Returns three values:
  1. The result of the examination.
  2. The command (argv[0]) to be executed.
  3. The safe command-line.

◆ Expand() [1/3]

virtual std::string MiKTeX::Core::Session::Expand ( const std::string &  toBeExpanded)
pure virtual

Expands values references in a string.

Parameters
toBeExpandedThe string to expand.
Returns
Returns the expanded string.

◆ Expand() [2/3]

virtual std::string MiKTeX::Core::Session::Expand ( const std::string &  toBeExpanded,
ExpandOptionSet  options,
MiKTeX::Configuration::HasNamedValues callback 
)
pure virtual

Expands a string.

Parameters
toBeExpandedThe string to expand.
optionsWhat to expand.
callbackThe pointer to an object which implements the HasNamedValues interface.
Returns
Returns the expanded string.

◆ Expand() [3/3]

virtual std::string MiKTeX::Core::Session::Expand ( const std::string &  toBeExpanded,
MiKTeX::Configuration::HasNamedValues callback 
)
pure virtual

Expands value references in a string.

Parameters
toBeExpandedThe string to expand.
callbackThe pointer to an object which implements the HasNamedValues interface.
Returns
Returns the expanded string.

◆ FatalCrtError()

static void MiKTeX::Core::Session::FatalCrtError ( const std::string &  functionName,
int  errorCode,
const MiKTeXException::KVMAP &  info,
const SourceLocation sourceLocation 
)
static

Throws a C/C++-runtime exception.

Parameters
functionNameThe name of the C/C++-runtime function.
errorCodeThe errno value.
infoAdditional information.
sourceLocationThe source code location.

◆ FatalMiKTeXError()

static void MiKTeX::Core::Session::FatalMiKTeXError ( const std::string &  message,
const std::string &  description,
const std::string &  remedy,
const std::string &  tag,
const MiKTeXException::KVMAP &  info,
const SourceLocation sourceLocation 
)
static

Throws a MiKTeX exception.

Parameters
messageThe short error message.
descriptionA more detailed description of the error.
remedyA user friendly recipe to remedy the error.
tagAn error tag.
infoAdditional information.
sourceLocationThe source code location.

◆ FatalWindowsError()

static void MiKTeX::Core::Session::FatalWindowsError ( const std::string &  functionName,
unsigned long  errorCode,
const std::string &  description,
const std::string &  remedy,
const std::string &  tag,
const MiKTeXException::KVMAP &  info,
const SourceLocation sourceLocation 
)
static

Throws a Windows exception.

Parameters
functionNameThe name of the Windows function.
errorCodeThe last Windows error value.
descriptionA more detailed description of the error.
remedyA user friendly recipe to remedy the error.
tagAn error tag.
infoAdditional information.
sourceLocationThe source code location.

◆ FindFile() [1/8]

virtual bool MiKTeX::Core::Session::FindFile ( const std::string &  fileName,
const std::string &  searchPath,
FindFileOptionSet  options,
MiKTeX::Util::PathName result 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
searchPathThe search path.
optionsSearch options.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindFile() [2/8]

virtual bool MiKTeX::Core::Session::FindFile ( const std::string &  fileName,
const std::string &  searchPath,
FindFileOptionSet  options,
std::vector< MiKTeX::Util::PathName > &  result 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
searchPathThe search path.
optionsSearch options.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindFile() [3/8]

virtual bool MiKTeX::Core::Session::FindFile ( const std::string &  fileName,
const std::string &  searchPath,
MiKTeX::Util::PathName result 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
searchPathThe search path.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindFile() [4/8]

virtual bool MiKTeX::Core::Session::FindFile ( const std::string &  fileName,
const std::string &  searchPath,
std::vector< MiKTeX::Util::PathName > &  result 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
searchPathThe search path.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindFile() [5/8]

virtual bool MiKTeX::Core::Session::FindFile ( const std::string &  fileName,
FileType  fileType,
FindFileOptionSet  options,
MiKTeX::Util::PathName result 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
fileTypeThe file type to search for.
optionsSearch options.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindFile() [6/8]

virtual bool MiKTeX::Core::Session::FindFile ( const std::string &  fileName,
FileType  fileType,
FindFileOptionSet  options,
std::vector< MiKTeX::Util::PathName > &  result 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
fileTypeThe file type to search for.
optionsSearch options.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindFile() [7/8]

virtual bool MiKTeX::Core::Session::FindFile ( const std::string &  fileName,
FileType  fileType,
MiKTeX::Util::PathName result 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
fileTypeThe file type to search for.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindFile() [8/8]

virtual bool MiKTeX::Core::Session::FindFile ( const std::string &  fileName,
FileType  fileType,
std::vector< MiKTeX::Util::PathName > &  result 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
fileTypeThe file type to search for.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindFilenameDatabase()

virtual bool MiKTeX::Core::Session::FindFilenameDatabase ( unsigned  r,
MiKTeX::Util::PathName path 
)
pure virtual

Finds a file name database.

Parameters
rIdentifies the root directory.
[out]pathThe file system path to the databsae.
Returns
Returns true, if the database was found.

◆ FindPkFile()

virtual bool MiKTeX::Core::Session::FindPkFile ( const std::string &  fontName,
const std::string &  mfMode,
int  dpi,
MiKTeX::Util::PathName result 
)
pure virtual

Searches a PK font file.

Parameters
fontNameThe name of the font to search.
mfModeThe METAFONT mode.
dpiThe resolution (in dots per inch) of the requested PK font.
[out]resultThe result of the search.
Returns
Return true, if the file was found.

◆ FindTfmFile()

virtual bool MiKTeX::Core::Session::FindTfmFile ( const std::string &  fontName,
MiKTeX::Util::PathName result,
bool  create 
)
pure virtual

Searches a TFM file.

Parameters
fontNameThe name of the font to search.
[out]resultThe result of the search.
createIndicates, if the TFM file should be created if it was not found.
Returns
Return true, if the file was found.

◆ GetAllowedShellCommands()

virtual std::vector< std::string > MiKTeX::Core::Session::GetAllowedShellCommands ( )
pure virtual

Gets allowed shell commands.

Returns
Returns allowed shell commands.

◆ GetEngineName()

virtual std::string MiKTeX::Core::Session::GetEngineName ( )
pure virtual

Gets the name of the running engine (e.g., pdftex).

Returns
Returns the engine name.

◆ GetExpandedSearchPath()

virtual std::string MiKTeX::Core::Session::GetExpandedSearchPath ( FileType  fileType)
pure virtual

Gets the seach path for a file type.

Parameters
fileTypeThe file type.
Returns
Returns the expanded search path.

◆ GetFileInfoRecords()

virtual std::vector< FileInfoRecord > MiKTeX::Core::Session::GetFileInfoRecords ( )
pure virtual

Gets the recorded file names.

Returns
Returns the recorded file names.

◆ GetFilenameDatabasePathName()

virtual MiKTeX::Util::PathName MiKTeX::Core::Session::GetFilenameDatabasePathName ( unsigned  r)
pure virtual

Gets the file system path to a file name database file.

Parameters
rIdentifies the root directory.
Returns
Returns the file system path to the databsae.

◆ GetFileTypeInfo()

virtual FileTypeInfo MiKTeX::Core::Session::GetFileTypeInfo ( FileType  fileType)
pure virtual

Gets file type data.

Parameters
filetypeIdentifies the file type.
Returns
Returns the file type data.

◆ GetFileTypes()

virtual std::vector< FileTypeInfo > MiKTeX::Core::Session::GetFileTypes ( )
pure virtual

Gets all file types.

Returns
Returns all file types.

◆ GetFontDirectories()

virtual std::vector< std::string > MiKTeX::Core::Session::GetFontDirectories ( )
pure virtual

Get the system font directories.

Returns
Returns the system font directories.

◆ GetFontInfo()

virtual bool MiKTeX::Core::Session::GetFontInfo ( const std::string &  fontName,
std::string &  supplier,
std::string &  typeface,
double *  genSize 
)
pure virtual

Searches a font file.

Parameters
fontNameThe name of the font to search.
[out]Thesupplier of the font.
[out]Thetypeface.
[out]genSizeThe size of the font.
Returns
Returns true, if the font was found.

◆ GetFormatInfo()

virtual FormatInfo MiKTeX::Core::Session::GetFormatInfo ( const std::string &  key)
pure virtual

Gets a format.

Parameters
keyIdentifies the format.
Returns
Returns the format.

◆ GetFormats()

virtual std::vector< FormatInfo > MiKTeX::Core::Session::GetFormats ( )
pure virtual

Gets all formats.

Returns
Returns all formats.

◆ GetGhostscript()

virtual MiKTeX::Util::PathName MiKTeX::Core::Session::GetGhostscript ( unsigned long *  versionNumber)
pure virtual

Searches the Ghostscript program.

Parameters
[out]versionNumberThe Ghostscript version number
Returns
Returns the file system path to the Ghostscript program file.

◆ GetLanguages()

virtual std::vector< LanguageInfo > MiKTeX::Core::Session::GetLanguages ( )
pure virtual

Gets all languages.

Returns
Returns all languages.

◆ GetMakeFontsFlag()

virtual bool MiKTeX::Core::Session::GetMakeFontsFlag ( )
pure virtual

Tests whether automatic font file creation is enabled.

Returns
Returns true, if automatic font creation file is enabled.

◆ GetMETAFONTMode()

virtual bool MiKTeX::Core::Session::GetMETAFONTMode ( unsigned  idx,
MIKTEXMFMODE mode 
)
pure virtual

Gets the next METAFONT mode.

Parameters
Theindex of the next METAFONT mode.
[out]modeThe METAFONT mode.
Returns
Returns true, if the METAFONT mode could be retrieved.

◆ GetMpmDatabasePathName()

virtual MiKTeX::Util::PathName MiKTeX::Core::Session::GetMpmDatabasePathName ( )
pure virtual

Gets a path to the MPM file name database.

Returns
Returns the path to the MPM file name database.

◆ GetMpmRootPath()

virtual MiKTeX::Util::PathName MiKTeX::Core::Session::GetMpmRootPath ( )
pure virtual

Gets the virtual path to the MPM root directory.

Returns
Returns the virtual path to the MPM root directory.

◆ GetMyLocation()

virtual MiKTeX::Util::PathName MiKTeX::Core::Session::GetMyLocation ( bool  canonicalized)
pure virtual

Gets the file system path to the directory of the running program file.

Parameters
canonicalizedIndicates wheter symbolic links should be followed.
Returns
Returns the file system path to the directory of running program file.

◆ GetMyPrefix()

virtual MiKTeX::Util::PathName MiKTeX::Core::Session::GetMyPrefix ( bool  canonicalized)
pure virtual

Gets the file system path to the prefix directory of the running program file.

Parameters
canonicalizedIndicates wheter symbolic links should be followed.
Returns
Returns the file system path to the prefix directory.

◆ GetMyProgramFile()

virtual MiKTeX::Util::PathName MiKTeX::Core::Session::GetMyProgramFile ( bool  canonicalized)
pure virtual

Gets the file system path to the running program file.

Parameters
canonicalizedIndicates wheter symbolic links should be followed.
Returns
Returns the file system path to the running program file.

◆ GetNumberOfTEXMFRoots()

virtual unsigned MiKTeX::Core::Session::GetNumberOfTEXMFRoots ( )
pure virtual

Gets the number of root directories.

Returns
Returns the number of registered root directories.

◆ GetPaperSizeInfo() [1/2]

virtual PaperSizeInfo MiKTeX::Core::Session::GetPaperSizeInfo ( const std::string &  dvipsName)
pure virtual

Gets a paper size.

Parameters
dvipsNameIdentifies the paper size.
Returns
Returns the paper size.

◆ GetPaperSizeInfo() [2/2]

virtual bool MiKTeX::Core::Session::GetPaperSizeInfo ( int  idx,
PaperSizeInfo paperSize 
)
pure virtual

Gets the next paper size.

Parameters
idxIndex of the next entry in the paper size table.
[out]Thepaper size.
Returns
Return true, if the next paper size entry could be retrieved.

◆ GetRootDirectories()

virtual std::vector< RootDirectoryInfo > MiKTeX::Core::Session::GetRootDirectories ( )
pure virtual

Gets registered root directories.

Returns
Returns the list of registered root directories.

◆ GetRootDirectoryPath()

virtual MiKTeX::Util::PathName MiKTeX::Core::Session::GetRootDirectoryPath ( unsigned  r)
pure virtual

Gets the path to a root directory.

Parameters
rIdentifies the root directory.
Returns
Returns the file system path to the root directory.

◆ GetSetupConfig()

virtual SetupConfig MiKTeX::Core::Session::GetSetupConfig ( )
pure virtual

Get the setup configuration.

Returns
Returns the setup configuration.

◆ GetShellCommandMode()

virtual ShellCommandMode MiKTeX::Core::Session::GetShellCommandMode ( )
pure virtual

Gets the configured shell command mode.

Returns
Returns the configured shell command mode.

◆ IsAdminMode()

virtual bool MiKTeX::Core::Session::IsAdminMode ( )
pure virtual

Tests whether the program is running in admin mode.

Returns
Returns true, if the program is running in admin mode.

◆ IsCommonRootDirectory()

virtual bool MiKTeX::Core::Session::IsCommonRootDirectory ( unsigned  r)
pure virtual

Tests whether a root directory is registered system-wide.

Parameters
rIdentifies the root directory.
Returns
Returns true, if this is a system-wide root directory.

◆ IsFileAlreadyOpen()

virtual bool MiKTeX::Core::Session::IsFileAlreadyOpen ( const MiKTeX::Util::PathName fileName)
pure virtual

Tests if a file as been opened.

Parameters
fileNameName of the file to be checked.
Returns
Returns true, if the file has been opened.

◆ IsMiKTeXDirect()

virtual bool MiKTeX::Core::Session::IsMiKTeXDirect ( )
pure virtual

Tests if this is MiKTeXDirect.

Returns
Returns true, if this is a MiKTeXDirect configuration

◆ IsMiKTeXPortable()

virtual bool MiKTeX::Core::Session::IsMiKTeXPortable ( )
pure virtual

Tests if this is MiKTeX Portable.

Returns
Returns true, if this is a MiKTeX Portable configuration

◆ IsOtherRootDirectory()

virtual bool MiKTeX::Core::Session::IsOtherRootDirectory ( unsigned  r)
pure virtual

Tests whether a root directory is from another TeX system.

Parameters
rIdentifies the root directory.
Returns
Returns true, if this root directory is from another TeX system.

◆ IsOutputFile()

virtual bool MiKTeX::Core::Session::IsOutputFile ( const FILE *  file)
pure virtual

Tests whether a file has been opened for output.

Parameters
fileThe pointer to the FILE object.
Returns
Returns true, if it is an output file.

◆ IsSharedSetup()

virtual bool MiKTeX::Core::Session::IsSharedSetup ( )
pure virtual

Tests whether this is a system-wide installation.

Returns
Returns true, if this is a system-wide installation.

◆ IsUserAnAdministrator()

virtual bool MiKTeX::Core::Session::IsUserAnAdministrator ( )
pure virtual

Tests whether the current user is an administrator.

Returns
Returns true, if the current user is an administrator.

◆ Locate()

virtual LocateResult MiKTeX::Core::Session::Locate ( const std::string &  fileName,
const LocateOptions options 
)
pure virtual

Searches a file.

Parameters
fileNameThe name of the file to search.
optionsSearch options.
Returns
Return the result of the search.

◆ MakeMakePkCommandLine()

virtual std::vector< std::string > MiKTeX::Core::Session::MakeMakePkCommandLine ( const std::string &  fontName,
int  dpi,
int  baseDpi,
const std::string &  mfMode,
MiKTeX::Util::PathName fileName,
MiKTeX::Configuration::TriState  enableInstaller 
)
pure virtual

Build a command-line for makepk.

Parameters
fontNameThe Name of the font.
dpiThe requested resolution (in dots per inch).
bdpiThe base resolution (in dots per inch).
mfModeThe METAFONT mode.
[out]fileNameThe name of the PK font file.
enableInstallerIndicates whether automatic package installation is allowed.
Returns
Returns the makepk command-line arguments.

◆ MoveRootDirectoryDown()

virtual void MiKTeX::Core::Session::MoveRootDirectoryDown ( unsigned  r)
pure virtual

Moves a root directory down in the list.

Parameters
rIdentifies the root directory.

◆ MoveRootDirectoryUp()

virtual void MiKTeX::Core::Session::MoveRootDirectoryUp ( unsigned  r)
pure virtual

Moves a root directory up in the list.

Parameters
rIdentifies the root directory.

◆ OpenFile()

virtual FILE * MiKTeX::Core::Session::OpenFile ( const MiKTeX::Util::PathName path,
FileMode  mode,
FileAccess  access,
bool  isTextFile 
)
pure virtual

Opens a file.

Parameters
pathThe file system path to the file.
modeSpecifies how the file is to open.
accessSpecifies how the file will be accessed.
isTextFileSpecifies if the file should be opened in text mode.
Returns
Returns the pointer to a FILE object.

◆ PushAppName()

virtual void MiKTeX::Core::Session::PushAppName ( const std::string &  name)
pure virtual

Adds an application name.

Parameters
nameThe name to add.

◆ PushBackAppName()

virtual void MiKTeX::Core::Session::PushBackAppName ( const std::string &  name)
pure virtual

Adds an application name with a lower priority.

Parameters
nameThe name to add.

◆ RecordFileInfo()

virtual void MiKTeX::Core::Session::RecordFileInfo ( const MiKTeX::Util::PathName path,
FileAccess  access 
)
pure virtual

Adds a file name record to the log file.

Parameters
Thefile system file to the file.
Howthe file is accessed.

◆ RegisterRootDirectories()

virtual void MiKTeX::Core::Session::RegisterRootDirectories ( const StartupConfig startupConfig,
RegisterRootDirectoriesOptionSet  options 
)
pure virtual

Registers TEXMF root directories.

Parameters
startupConfigSpecifies the root directories to register.
optionsRegistration options.

◆ RegisterRootDirectory()

virtual void MiKTeX::Core::Session::RegisterRootDirectory ( const MiKTeX::Util::PathName path,
bool  other 
)
pure virtual

Registers an additional root directory.

Parameters
pathThe file system path to the root directory.
otherIndicates wheter the root directory is from another TeX system.

◆ Reset()

virtual void MiKTeX::Core::Session::Reset ( )
pure virtual

Resets this session object.

◆ RunBatch()

virtual int MiKTeX::Core::Session::RunBatch ( int  argc,
const char **  argv 
)
pure virtual

Executes a Windows batch script.

Parameters
argcNumber of command-line arguments.
argvPointers to command-line arguments. Must be terminated with nullptr.
Returns
Returns the exit code of the batch script.

◆ RunExe()

virtual int MiKTeX::Core::Session::RunExe ( int  argc,
const char **  argv 
)
pure virtual

Runs an executable.

Parameters
argcNumber of command-line arguments.
argvPointers to command-line arguments. Must be terminated with nullptr.
Returns
Returns the exit code.

◆ RunGhostscript()

virtual int MiKTeX::Core::Session::RunGhostscript ( int  argc,
const char **  argv 
)
pure virtual

Runs Ghostscript.

Parameters
argcNumber of command-line arguments.
argvPointers to command-line arguments. Must be terminated with nullptr.
Returns
Returns the exit code.

◆ RunJava()

virtual int MiKTeX::Core::Session::RunJava ( int  argc,
const char **  argv 
)
pure virtual

Executes a Java program.

Parameters
argcNumber of command-line arguments.
argvPointers to command-line arguments. Must be terminated with nullptr.
Returns
Returns the exit code of the Perl script.

◆ RunningAsAdministrator()

virtual bool MiKTeX::Core::Session::RunningAsAdministrator ( )
pure virtual

Tests whether the program runs with elevated privileges.

Returns
Returns true, if the program is running with elevated privileges.

◆ RunPerl()

virtual int MiKTeX::Core::Session::RunPerl ( int  argc,
const char **  argv 
)
pure virtual

Executes a Perl script.

Parameters
argcNumber of command-line arguments.
argvPointers to command-line arguments. Must be terminated with nullptr.
Returns
Returns the exit code of the Perl script.

◆ RunPython()

virtual int MiKTeX::Core::Session::RunPython ( int  argc,
const char **  argv 
)
pure virtual

Executes a Python script.

Parameters
argcNumber of command-line arguments.
argvPointers to command-line arguments. Must be terminated with nullptr.
Returns
Returns the exit code of the Python script.

◆ ScheduleFileRemoval()

virtual void MiKTeX::Core::Session::ScheduleFileRemoval ( const MiKTeX::Util::PathName path)
pure virtual

Schedules the removal of a file when the application terminates.

Parameters
pathThe file system path to the file.

◆ ScheduleSystemCommand()

virtual void MiKTeX::Core::Session::ScheduleSystemCommand ( const std::string &  commandLine)
pure virtual

Schedules the execution of a shell command when the application terminates.

Parameters
commandLineThe shell command to execute.

◆ SetAdminMode()

virtual void MiKTeX::Core::Session::SetAdminMode ( bool  adminMode,
bool  force = false 
)
pure virtual

Turns admin mode on or off.

Parameters
adminModeIndicates whether admin mode shall be turned on.
forceEnforces admin mode even for a private installation.

◆ SetDefaultPaperSize()

virtual void MiKTeX::Core::Session::SetDefaultPaperSize ( const std::string &  dvipsName)
pure virtual

Sets the default paper size.

Parameters
dvipsNameIdentifies the paper size.

◆ SetFindFileCallback()

virtual void MiKTeX::Core::Session::SetFindFileCallback ( IFindFileCallback callback)
pure virtual

Sets the callback interface for file search.

Parameters
callbackThe pointer to an object which implements the interface.

◆ SetFormatInfo()

virtual void MiKTeX::Core::Session::SetFormatInfo ( const FormatInfo formatInfo)
pure virtual

Updates a format.

Parameters
formatInfoThe format.

◆ SetLanguageInfo()

virtual void MiKTeX::Core::Session::SetLanguageInfo ( const LanguageInfo languageInfo)
pure virtual

Updates language data.

Parameters
languageInfoThe language data.

◆ SetRecorderPath()

virtual void MiKTeX::Core::Session::SetRecorderPath ( const MiKTeX::Util::PathName path)
pure virtual

Sets the file name recorder log file.

Parameters
pathThe file system path to the log file.

◆ SetTheNameOfTheGame()

virtual void MiKTeX::Core::Session::SetTheNameOfTheGame ( const std::string &  name)
pure virtual

Sets the descriptive name of the running program.

Parameters
nameThe descriptive name.

◆ ShowManualPageAndWait()

virtual bool MiKTeX::Core::Session::ShowManualPageAndWait ( HWND  hWnd,
unsigned long  topic 
)
pure virtual

Shows a help topic.

Parameters
hWndThe handle of a parent window.
topicIdentifies the topic.
Returns
Returns true, if the topic was shown.

◆ SplitFontPath()

virtual void MiKTeX::Core::Session::SplitFontPath ( const MiKTeX::Util::PathName fontPath,
std::string *  fontType,
std::string *  supplier,
std::string *  typeface,
std::string *  fontName,
std::string *  pointSize 
)
pure virtual

Splits the file system path of a font file.

Parameters
fontPathThe file system path to the font file.
[out]fontTypeThe font type.
[out]supplierThe font supplier.
[out]typefaceThe typeface.
[out]fontNameThe font name.
[oit]pointSize The size of the font.

◆ SplitTEXMFPath()

virtual unsigned MiKTeX::Core::Session::SplitTEXMFPath ( const MiKTeX::Util::PathName path,
MiKTeX::Util::PathName root,
MiKTeX::Util::PathName relative 
)
pure virtual

Splits a TEXMF file system path.

Parameters
pathThe path to split.
[out]rootThe path to the root directory.
[out]relativeThe relative path from the root directory.
Returns
Returns the root directory index.

◆ StartFileInfoRecorder() [1/2]

virtual bool MiKTeX::Core::Session::StartFileInfoRecorder ( )
pure virtual

Starts recording file names.

Returns
Returns true.

◆ StartFileInfoRecorder() [2/2]

virtual bool MiKTeX::Core::Session::StartFileInfoRecorder ( bool  recordPackageNames)
pure virtual

Starts recording file names.

Parameters
recordPackageNamesIndicates whether to include package names.
Returns
Returns true.

◆ TryCreateFromTemplate()

virtual bool MiKTeX::Core::Session::TryCreateFromTemplate ( const MiKTeX::Util::PathName path)
pure virtual

Tries to create a file by its template.

Parameters
Thefile system path to the file.
Returns
Returns true, if the file has been created.

◆ TryDeriveTEXMFRoot()

virtual unsigned MiKTeX::Core::Session::TryDeriveTEXMFRoot ( const MiKTeX::Util::PathName path)
pure virtual

Tries to get a root directory index from a file system path.

Parameters
pathThe file system path.
Returns
Returns a root directory index (or INVALID_ROOT_INDEX).

◆ TryGet()

static std::shared_ptr< Session > MiKTeX::Core::Session::TryGet ( )
static

Tries to get the current session object.

Returns
Returns a smart pointer to the current session object. Can be nullptr.

◆ TryGetFormatInfo()

virtual bool MiKTeX::Core::Session::TryGetFormatInfo ( const std::string &  key,
FormatInfo formatInfo 
)
pure virtual

Gets a format.

Parameters
keyIdentifies the format.
[out]formatInfoThe format.
Returns
Returns true, if the format was found.

◆ TryGetOpenFileInfo()

virtual std::pair< bool, OpenFileInfo > MiKTeX::Core::Session::TryGetOpenFileInfo ( FILE *  file)
pure virtual

Tries to get information about an open file.

Parameters
fileThe pointer to the FILE object. @Returns The first return value indicates whether the second value contains the requested information.

◆ TryOpenFile()

virtual FILE * MiKTeX::Core::Session::TryOpenFile ( const MiKTeX::Util::PathName path,
FileMode  mode,
FileAccess  access,
bool  isTextFile 
)
pure virtual

Tries to open a file.

Parameters
pathThe file system path to the file.
modeSpecifies how the file is to open.
accessSpecifies how the file will be accessed.
isTextFileSpecifies if the file should be opened in text mode.
Returns
Returns the pointer to a FILE object. Returns nullptr, if the file could not be opened.

◆ UnloadFilenameDatabase() [1/2]

virtual bool MiKTeX::Core::Session::UnloadFilenameDatabase ( )
pure virtual

Unloads the file name database.

Returns
Returns true, if the file name database could be unloaded. Returns false, if the database is still in use.

◆ UnloadFilenameDatabase() [2/2]

virtual bool MiKTeX::Core::Session::UnloadFilenameDatabase ( std::chrono::duration< double >  minIdleTime)
pure virtual

Unloads the file name database.

Parameters
minIdleTimeThe minimum time the database has not been used.
Returns
Returns true, if the file name database could be unloaded. Returns false, if the database is still in use.

◆ UnregisterRootDirectory()

virtual void MiKTeX::Core::Session::UnregisterRootDirectory ( const MiKTeX::Util::PathName path,
bool  other 
)
pure virtual

Unregisters an additional root directory.

Parameters
pathThe file system path to the root directory.
otherIndicates wheter the root directory is from another TeX system.

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