Skip to content

Commit

Permalink
Several C attributes are final
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerbecky committed Oct 7, 2024
1 parent a7a4fd8 commit f955060
Show file tree
Hide file tree
Showing 3 changed files with 258 additions and 82 deletions.
20 changes: 20 additions & 0 deletions docs/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,26 @@ visual_studio.BuildVisualStudioFile
.. doxygenclass:: makeprojects::visual_studio::BuildVisualStudioFile
:members:

visual_studio.VS2003XML
^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenclass:: makeprojects::visual_studio::VS2003XML
:members:

visual_studio.VS2003Tool
^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenclass:: makeprojects::visual_studio::VS2003Tool
:members:

visual_studio.VCCLCompilerTool
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenclass:: makeprojects::visual_studio::VCCLCompilerTool
:members:

visual_studio.VCCLCompilerToolFile
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenclass:: makeprojects::visual_studio::VCCLCompilerToolFile
:members:

Watcom
------

Expand Down
44 changes: 41 additions & 3 deletions makeprojects/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,10 @@ def validate(key, configuration, fallback=None,

@staticmethod
def vs_validate(key, configuration, fallback=None,
options_key=None, options=None):
options_key=None, options=None, prefix=None):
"""
Check if there is an override with a vs_ prefix.
Check if the configuration has a key of \"vs_\" + key in the
Check if the configuration has a key of \"vs_\" + prefix + key in the
configuration and if not found or None, use the key as is.
Args:
Expand All @@ -451,11 +451,18 @@ def vs_validate(key, configuration, fallback=None,
fallback: Value to use in case there is no override.
options_key: Attribute to scan for commmand line options
options: Iterable with options / Value pairs
prefix: String to insert after "vs_"
Returns:
None or VSBooleanProperty instance
"""

value = configuration.get_chained_value("vs_" + key)
# Insert the optional prefix
new_key = "vs_"
if prefix:
new_key = new_key + prefix
new_key = new_key + key

value = configuration.get_chained_value(new_key)
if value is None:
return VSBooleanProperty.validate(
key, configuration, fallback, options_key, options)
Expand Down Expand Up @@ -590,6 +597,37 @@ def get_value(self):

########################################

@staticmethod
def vs_validate(key, configuration, fallback=None, prefix=None):
"""
Check if there is an override with a vs_ prefix.
@details
Check if the configuration has a key of \"vs_\" + prefix + key in the
configuration and if not found or None, use the fallback as is.
Args:
key: Name of the XML attribute key
configuration: configuration to scan for an override
fallback: Value to use in case there is no override.
prefix: String to insert after "vs_"
Returns:
VSStringProperty instance
"""

# Insert the optional prefix
new_key = "vs_"
if prefix:
new_key = new_key + prefix
new_key = new_key + key

value = configuration.get_chained_value(new_key)
if value is None:
return VSStringProperty(key, fallback)
return VSStringProperty(key, value)

########################################

def __repr__(self):
"""
Convert to string.
Expand Down
Loading

0 comments on commit f955060

Please sign in to comment.