MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk_wrap.config.Settings Class Reference

Public Member Functions

None __init__ (self, str|Path|None path=None)
 A small INI-style MXVK settings file.
str get (self, str section, str key, str default="")
None load (self, str|Path path)
None save (self, str|Path path)
None set (self, str section, str key, str value)

Public Attributes

 native = mxvk.Config() if path is None else mxvk.Config(str(path))
 Create empty settings or load them from path.

Detailed Description

Definition at line 9 of file config.py.

Constructor & Destructor Documentation

◆ __init__()

None mxvk_wrap.config.Settings.__init__ ( self,
str | Path | None path = None )

A small INI-style MXVK settings file.

Definition at line 12 of file config.py.

12 def __init__(self, path: str | Path | None = None) -> None:
13 ## @brief Create empty settings or load them from @p path.
14 self.native = mxvk.Config() if path is None else mxvk.Config(str(path))
15

Member Function Documentation

◆ get()

str mxvk_wrap.config.Settings.get ( self,
str section,
str key,
str default = "" )

Definition at line 16 of file config.py.

16 def get(self, section: str, key: str, default: str = "") -> str:
17 ## @brief Return a setting, falling back to @p default when missing.
18 return self.native.item_at_key(section, key, default).value
19

◆ load()

None mxvk_wrap.config.Settings.load ( self,
str | Path path )

Definition at line 24 of file config.py.

24 def load(self, path: str | Path) -> None:
25 ## @brief Replace settings with the contents of @p path.
26 self.native.load_file(str(path))
27

◆ save()

None mxvk_wrap.config.Settings.save ( self,
str | Path path )

Definition at line 28 of file config.py.

28 def save(self, path: str | Path) -> None:
29 ## @brief Write settings to @p path.
30 self.native.save_file(str(path))

◆ set()

None mxvk_wrap.config.Settings.set ( self,
str section,
str key,
str value )

Definition at line 20 of file config.py.

20 def set(self, section: str, key: str, value: str) -> None:
21 ## @brief Store a string setting.
22 self.native.set_item(section, key, value)
23

Member Data Documentation

◆ native

mxvk_wrap.config.Settings.native = mxvk.Config() if path is None else mxvk.Config(str(path))

Create empty settings or load them from path.

Definition at line 14 of file config.py.


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