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::Cfg Class Referenceabstract

INI container. More...

#include <miktex/Core/Cfg.h>

Classes

class  Key
 An instance of this class provides the interface to an INI section. More...
 
class  KeyIterator
 Implements an interator for INI sections. More...
 
class  Value
 An instance of this class provides the interface to an INI value. More...
 
class  ValueIterator
 Implements an interator for INI values. More...
 

Public Types

enum class  Option { NoOverwriteKeys , NoOverwriteValues }
 INI options. More...
 
typedef MiKTeX::Util::OptionSet< OptionOptions
 

Public Member Functions

virtual Options GetOptions () const =0
 
virtual void SetOptions (Options options)=0
 
virtual bool Empty () const =0
 Tests whether this INI container is empty. More...
 
virtual MD5 GetDigest () const =0
 
virtual std::shared_ptr< ValueGetValue (const std::string &keyName, const std::string &valueName) const =0
 
virtual bool TryGetValueAsString (const std::string &keyName, const std::string &valueName, std::string &value) const =0
 
virtual bool TryGetValueAsStringVector (const std::string &keyName, const std::string &valueName, std::vector< std::string > &value) const =0
 
virtual void SetModified (bool b)=0
 
virtual bool IsModified () const =0
 Tests whether this INI container has been modified. More...
 
virtual void PutValue (const std::string &keyName, const std::string &valueName, const std::string &value)=0
 
virtual void PutValue (const std::string &keyName, const std::string &valueName, const std::string &value, const std::string &documentation, bool commentedOut)=0
 
virtual void Read (const MiKTeX::Util::PathName &path)=0
 
virtual void Read (std::istream &reader)=0
 
virtual void Read (const MiKTeX::Util::PathName &path, bool mustBeSigned)=0
 
virtual void Read (std::istream &reader, bool mustBeSigned)=0
 
virtual void Read (const MiKTeX::Util::PathName &path, const MiKTeX::Util::PathName &publicKeyFile)=0
 
virtual void Read (std::istream &reader, const MiKTeX::Util::PathName &publicKeyFile)=0
 
virtual void Write (const MiKTeX::Util::PathName &path)=0
 
virtual void Write (const MiKTeX::Util::PathName &path, const std::string &header)=0
 
virtual void Write (const MiKTeX::Util::PathName &path, const std::string &header, IPrivateKeyProvider *privateKeyProvider)=0
 
virtual std::shared_ptr< KeyGetKey (const std::string &keyName) const =0
 
virtual void DeleteKey (const std::string &keyName)=0
 
virtual void DeleteValue (const std::string &keyName, const std::string &valueName)=0
 
virtual bool ClearValue (const std::string &keyName, const std::string &valueName)=0
 
virtual bool IsSigned () const =0
 
virtual KeyIterator begin ()=0
 Gets an iterator to the first container section. More...
 
virtual KeyIterator end ()=0
 Gets an iterator referring to the past-the-end section. More...
 
virtual std::size_t GetSize () const =0
 

Static Public Member Functions

static std::unique_ptr< CfgCreate ()
 

Detailed Description

INI container.

Member Enumeration Documentation

◆ Option

enum class MiKTeX::Core::Cfg::Option
strong

INI options.

Member Function Documentation

◆ begin()

virtual KeyIterator MiKTeX::Core::Cfg::begin ( )
pure virtual

Gets an iterator to the first container section.

◆ ClearValue()

virtual bool MiKTeX::Core::Cfg::ClearValue ( const std::string &  keyName,
const std::string &  valueName 
)
pure virtual

Clears an INI value.

Parameters
keyNameIdentifies the section.
keyNameIdentifies the value within the section.

◆ Create()

static std::unique_ptr< Cfg > MiKTeX::Core::Cfg::Create ( )
static

Creates a new INI container.

Returns
Returns a smart pointer to the new INI container.

◆ DeleteKey()

virtual void MiKTeX::Core::Cfg::DeleteKey ( const std::string &  keyName)
pure virtual

Deletes an INI section.

Parameters
keyNameIdentifies the section.

◆ DeleteValue()

virtual void MiKTeX::Core::Cfg::DeleteValue ( const std::string &  keyName,
const std::string &  valueName 
)
pure virtual

Deletes an INI value.

Parameters
keyNameIdentifies the section.
keyNameIdentifies the value within the section.

◆ Empty()

virtual bool MiKTeX::Core::Cfg::Empty ( ) const
pure virtual

Tests whether this INI container is empty.

◆ end()

virtual KeyIterator MiKTeX::Core::Cfg::end ( )
pure virtual

Gets an iterator referring to the past-the-end section.

◆ GetDigest()

virtual MD5 MiKTeX::Core::Cfg::GetDigest ( ) const
pure virtual

Calculates the digest (MD5) of this INI container.

Returns
Returns the digest.

◆ GetKey()

virtual std::shared_ptr< Key > MiKTeX::Core::Cfg::GetKey ( const std::string &  keyName) const
pure virtual

Gets an INI section.

Parameters
keyNameIdentifies the section.
Returns
Returns a smart pointer to the section.

◆ GetOptions()

virtual Options MiKTeX::Core::Cfg::GetOptions ( ) const
pure virtual

Gets current INI options.

Returns
Returns the current INI options.
See also
SetOptions

◆ GetSize()

virtual std::size_t MiKTeX::Core::Cfg::GetSize ( ) const
pure virtual

Gets the numeber of sections. @eturn Returns the number of sections.

◆ GetValue()

virtual std::shared_ptr< Value > MiKTeX::Core::Cfg::GetValue ( const std::string &  keyName,
const std::string &  valueName 
) const
pure virtual

Gets an INI value.

Parameters
keyNameThe name of the section.
valueNameThe name of the value.
Returns
Returns a smart pointer to the INI value.
See also
PutValue

◆ IsModified()

virtual bool MiKTeX::Core::Cfg::IsModified ( ) const
pure virtual

Tests whether this INI container has been modified.

◆ IsSigned()

virtual bool MiKTeX::Core::Cfg::IsSigned ( ) const
pure virtual

Checks whether this INI container is signed.

Returns
Returns true, if the container is signed.

◆ PutValue() [1/2]

virtual void MiKTeX::Core::Cfg::PutValue ( const std::string &  keyName,
const std::string &  valueName,
const std::string &  value 
)
pure virtual

Sets an INI value.

Parameters
keyNameThe name of the section.
valueNameThe name of the value.
valueThe value as a string.
See also
GetValue
GetValueAsString

◆ PutValue() [2/2]

virtual void MiKTeX::Core::Cfg::PutValue ( const std::string &  keyName,
const std::string &  valueName,
const std::string &  value,
const std::string &  documentation,
bool  commentedOut 
)
pure virtual

Sets an INI value.

Parameters
keyNameThe name of the section.
valueNameThe name of the value.
valueThe value as a string.
documentationThe value docstring.
commentedOutIndicates whether te value is disabled.
See also
GetValue
GetValueAsString

◆ Read() [1/6]

virtual void MiKTeX::Core::Cfg::Read ( const MiKTeX::Util::PathName path)
pure virtual

Reads from an INI text file.

Parameters
pathThe path to the INI file.

◆ Read() [2/6]

virtual void MiKTeX::Core::Cfg::Read ( const MiKTeX::Util::PathName path,
bool  mustBeSigned 
)
pure virtual

Reads from an INI text file and optionally verifies the signature.

Parameters
pathThe path to the INI file.
mustBeSignedIndicates whether the text file must be signed.

◆ Read() [3/6]

virtual void MiKTeX::Core::Cfg::Read ( const MiKTeX::Util::PathName path,
const MiKTeX::Util::PathName publicKeyFile 
)
pure virtual

Reads from an INI text file and verifies the signature.

Parameters
pathThe path to the INI file.
publicKeyFileThe path to the public key file

◆ Read() [4/6]

virtual void MiKTeX::Core::Cfg::Read ( std::istream &  reader)
pure virtual

Reads from an INI text stream.

Parameters
readerThe text stream.

◆ Read() [5/6]

virtual void MiKTeX::Core::Cfg::Read ( std::istream &  reader,
bool  mustBeSigned 
)
pure virtual

Reads from an INI text stream and optionally verifies the signature.

Parameters
readerThe text stream.
mustBeSignedIndicates whether the text file must be signed.

◆ Read() [6/6]

virtual void MiKTeX::Core::Cfg::Read ( std::istream &  reader,
const MiKTeX::Util::PathName publicKeyFile 
)
pure virtual

Reads from an INI text stream and verifies the signature.

Parameters
readerThe text stream.
publicKeyFileThe path to the public key file

◆ SetModified()

virtual void MiKTeX::Core::Cfg::SetModified ( bool  b)
pure virtual

Marks this INI container as modified/unmodified.

Parameters
bIndicates wheter the container should be marked as modified.

◆ SetOptions()

virtual void MiKTeX::Core::Cfg::SetOptions ( Options  options)
pure virtual

Sets current INI options.

Parameters
Theoptions to set.
See also
GetOptions

◆ TryGetValueAsString()

virtual bool MiKTeX::Core::Cfg::TryGetValueAsString ( const std::string &  keyName,
const std::string &  valueName,
std::string &  value 
) const
pure virtual

Gets an INI value.

Parameters
keyNameThe name of the section.
valueNameThe name of the value.
[out]valueThe value as a string.
Returns
Returns true, if the value was found.
See also
PutValue

◆ TryGetValueAsStringVector()

virtual bool MiKTeX::Core::Cfg::TryGetValueAsStringVector ( const std::string &  keyName,
const std::string &  valueName,
std::vector< std::string > &  value 
) const
pure virtual

Gets an INI value.

Parameters
keyNameThe name of the section.
valueNameThe name of the value.
[out]valueThe value as a string vector.
Returns
Returns true, if the value was found.
See also
PutValue

◆ Write() [1/3]

virtual void MiKTeX::Core::Cfg::Write ( const MiKTeX::Util::PathName path)
pure virtual

Writes this INI container into a file.

Parameters
pathThe path to the INIF file.

◆ Write() [2/3]

virtual void MiKTeX::Core::Cfg::Write ( const MiKTeX::Util::PathName path,
const std::string &  header 
)
pure virtual

Writes this INI container into a file.

Parameters
pathThe path to the INIF file.
headerThe header to be written as a comment.

◆ Write() [3/3]

virtual void MiKTeX::Core::Cfg::Write ( const MiKTeX::Util::PathName path,
const std::string &  header,
IPrivateKeyProvider privateKeyProvider 
)
pure virtual

Writes this INI container into a file and signs it.

Parameters
pathThe path to the INIF file.
headerThe header to be written as a comment.
privateKeyProviderThe private key which is used to sign the container.

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