From: Vladimír Vondruš Date: Fri, 2 Feb 2018 23:01:09 +0000 (+0100) Subject: doxygen: extract deprecation info and show it everywhere. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=b83624c7aa8945e64705691285af5bc64ac455a1;p=blog.git doxygen: extract deprecation info and show it everywhere. * In symbol/filesystem tree listing * In member listing * In the search --- diff --git a/doc/doxygen.rst b/doc/doxygen.rst index 5f7dbff1..5d7fc4aa 100644 --- a/doc/doxygen.rst +++ b/doc/doxygen.rst @@ -916,6 +916,8 @@ Property Description :py:`compound.footer_navigation` Footer navigation of a page. See `Navigation properties`_ for details. :py:`compound.brief` Brief description. Can be empty. [1]_ +:py:`compound.is_deprecated` Whether the compound is deprecated. Not + set for pages. [7]_ :py:`compound.description` Detailed description. Can be empty. [2]_ :py:`compound.modules` List of submodules in this compound. Set only for modules. See @@ -1046,6 +1048,7 @@ Property Description :py:`module.url` URL of the file containing detailed module docs :py:`module.name` Module name (just the leaf) :py:`module.brief` Brief description. Can be empty. [1]_ +:py:`module.is_deprecated` Whether the module is deprecated. [7]_ =========================== =================================================== `Directory properties`_ @@ -1062,6 +1065,7 @@ Property Description :py:`dir.url` URL of the file containing detailed directory docs :py:`dir.name` Directory name (just the leaf) :py:`dir.brief` Brief description. Can be empty. [1]_ +:py:`dir.is_deprecated` Whether the directory is deprecated. [7]_ =========================== =================================================== `File properties`_ @@ -1078,6 +1082,7 @@ Property Description :py:`file.url` URL of the file containing detailed file docs :py:`file.name` File name (just the leaf) :py:`file.brief` Brief description. Can be empty. [1]_ +:py:`file.is_deprecated` Whether the file is deprecated. [7]_ =========================== =================================================== `Namespace properties`_ @@ -1088,15 +1093,17 @@ every item has the following properties: .. class:: m-table m-fullwidth -=========================== =================================================== -Property Description -=========================== =================================================== -:py:`namespace.url` URL of the file containing detailed namespace docs -:py:`namespace.name` Namespace name. Fully qualified in case it's in a - file documentation, just the leaf name if in a - namespace documentation. -:py:`namespace.brief` Brief description. Can be empty. [1]_ -=========================== =================================================== +=============================== =============================================== +Property Description +=============================== =============================================== +:py:`namespace.url` URL of the file containing detailed namespace + docs +:py:`namespace.name` Namespace name. Fully qualified in case it's in + a file documentation, just the leaf name if in + a namespace documentation. +:py:`namespace.brief` Brief description. Can be empty. [1]_ +:py:`namespace.is_deprecated` Whether the namespace is deprecated. [7]_ +=============================== =============================================== `Class properties`_ ``````````````````` @@ -1117,6 +1124,7 @@ Property Description :py:`class.templates` Template specification. See `Template properties`_ for details. :py:`class.brief` Brief description. Can be empty. [1]_ +:py:`class.is_deprecated` Whether the class is deprecated. [7]_ :py:`class.is_protected` Whether this is a protected base class. Set only for base classes. :py:`class.is_virtual` Whether this is a virtual base class. Set only for @@ -1142,6 +1150,7 @@ Property Description :py:`enum.description` Detailed description. Can be empty. [2]_ :py:`enum.has_details` If there is enough content for the full description block [5]_ +:py:`enum.is_deprecated` Whether the enum is deprecated. [7]_ :py:`enum.is_protected` If the enum is :cpp:`protected`. Set only for member types. :py:`enum.values` List of enum values @@ -1158,6 +1167,7 @@ Property Description :py:`value.id` Identifier hash [3]_ :py:`value.name` Value name [4]_ :py:`value.initializer` Value initializer. Can be empty. [1]_ +:py:`value.is_deprecated` Whether the value is deprecated. [7]_ :py:`value.description` Detailed description. Can be empty. [2]_ =========================== =================================================== @@ -1183,6 +1193,7 @@ Property Description :cpp:`using`. . See `Template properties`_ for details. :py:`typedef.brief` Brief description. Can be empty. [1]_ +:py:`typedef.is_deprecated` Whether the typedef is deprecated. [7]_ :py:`typedef.description` Detailed description. Can be empty. [2]_ :py:`typedef.has_details` If there is enough content for the full description block [4]_ @@ -1229,6 +1240,7 @@ Property Description :cpp:`virtual`\ ity and :cpp:`delete`\ d / :cpp:`default`\ ed functions is removed from the suffix and available via other properties. +:py:`func.is_deprecated` Whether the function is deprecated. [7]_ :py:`func.is_protected` If the function is :cpp:`protected`. Set only for member functions. :py:`func.is_private` If the function is :cpp:`private`. Set only for @@ -1284,6 +1296,7 @@ Property Description :py:`var.description` Detailed description. Can be empty. [2]_ :py:`var.has_details` If there is enough content for the full description block [5]_ +:py:`var.is_deprecated` Whether the variable is deprecated. [7]_ :py:`var.is_static` If the variable is :cpp:`static`. Set only for member variables. :py:`var.is_protected` If the variable is :cpp:`protected`. Set only for @@ -1310,6 +1323,7 @@ Property Description :py:`define.return_value` Return value description. Can be empty. :py:`define.brief` Brief description. Can be empty. [1]_ :py:`define.description` Detailed description. Can be empty. [2]_ +:py:`define.is_deprecated` Whether the define is deprecated. [7]_ :py:`define.has_details` If there is enough content for the full description block [5]_ =============================== =============================================== @@ -1397,6 +1411,8 @@ Property Description the brief listing on top of the page to avoid unnecessary repetition. .. [6] :py:`i.type` and :py:`param.default` is rendered as HTML and usually contains links to related documentation +.. [7] :py:`i.is_deprecated` is set to :py:`True` if detailed docs of given + symbol contain the ``@deprecated`` command and to :py:`False` otherwise `Navigation page templates`_ ---------------------------- @@ -1450,6 +1466,7 @@ Property Description :py:`i.name` Name :py:`i.url` URL of the file with detailed documentation :py:`i.brief` Brief documentation +:py:`i.is_deprecated` Whether the entry is deprecated. [7]_ :py:`i.has_nestable_children` If the list has nestable children (i.e., dirs or namespaces) :py:`i.children` Recursive list of child entries diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index d86ae66f..34dafc5e 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -131,6 +131,7 @@ class Trie: class ResultFlag(Flag): HAS_SUFFIX = 1 << 0 + IS_DEPRECATED = 1 << 1 _TYPE = 0xf << 4 NAMESPACE = 1 << 4 @@ -328,6 +329,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. out.add_css_class = None out.footer_navigation = False out.example_navigation = None + out.is_deprecated = False # DOXYGEN PATCHING 1/4 # @@ -598,9 +600,10 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # resetting here explicitly. add_css_class = parsed.add_css_class - # Bubble up also footer / example navigation + # Bubble up also footer / example navigation, deprecation flag if parsed.footer_navigation: out.footer_navigation = True if parsed.example_navigation: out.example_navigation = parsed.example_navigation + if parsed.is_deprecated: out.is_deprecated = True # Assert we didn't miss anything important assert not parsed.section @@ -718,6 +721,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. file = match.group(1) if file.startswith(('deprecated', 'bug')): color = 'm-danger' + out.is_deprecated = True elif file.startswith('todo'): color = 'm-dim' else: @@ -1069,13 +1073,28 @@ def parse_desc(state: State, element: ET.Element) -> str: assert not parsed.section # might be problematic return parsed.parsed +def parse_enum_desc(state: State, element: ET.Element) -> str: + # Verify that we didn't ignore any important info by accident + parsed = parse_desc_internal(state, element.find('detaileddescription')) + parsed.parsed += parse_desc(state, element.find('inbodydescription')) + assert not parsed.templates and not parsed.params and not parsed.return_value + assert not parsed.section # might be problematic + return (parsed.parsed, parsed.is_deprecated) + +def parse_enum_value_desc(state: State, element: ET.Element) -> str: + # Verify that we didn't ignore any important info by accident + parsed = parse_desc_internal(state, element.find('detaileddescription')) + assert not parsed.templates and not parsed.params and not parsed.return_value + assert not parsed.section # might be problematic + return (parsed.parsed, parsed.is_deprecated) + def parse_var_desc(state: State, element: ET.Element) -> str: # Verify that we didn't ignore any important info by accident parsed = parse_desc_internal(state, element.find('detaileddescription')) parsed.parsed += parse_desc(state, element.find('inbodydescription')) assert not parsed.templates and not parsed.params and not parsed.return_value assert not parsed.section # might be problematic - return parsed.parsed + return (parsed.parsed, parsed.is_deprecated) def parse_toplevel_desc(state: State, element: ET.Element): # Verify that we didn't ignore any important info by accident @@ -1083,7 +1102,7 @@ def parse_toplevel_desc(state: State, element: ET.Element): assert not parsed.return_value if parsed.params: logging.warning("{}: use @tparam instead of @param for documenting class templates, @param is ignored".format(state.current)) - return (parsed.parsed, parsed.templates, parsed.section[2] if parsed.section else '', parsed.footer_navigation, parsed.example_navigation) + return (parsed.parsed, parsed.templates, parsed.section[2] if parsed.section else '', parsed.footer_navigation, parsed.example_navigation, parsed.is_deprecated) def parse_typedef_desc(state: State, element: ET.Element): # Verify that we didn't ignore any important info by accident @@ -1091,14 +1110,14 @@ def parse_typedef_desc(state: State, element: ET.Element): parsed.parsed += parse_desc(state, element.find('inbodydescription')) assert not parsed.params and not parsed.return_value assert not parsed.section # might be problematic - return (parsed.parsed, parsed.templates) + return (parsed.parsed, parsed.templates, parsed.is_deprecated) def parse_func_desc(state: State, element: ET.Element): # Verify that we didn't ignore any important info by accident parsed = parse_desc_internal(state, element.find('detaileddescription')) parsed.parsed += parse_desc(state, element.find('inbodydescription')) assert not parsed.section # might be problematic - return (parsed.parsed, parsed.templates, parsed.params, parsed.return_value) + return (parsed.parsed, parsed.templates, parsed.params, parsed.return_value, parsed.is_deprecated) def parse_define_desc(state: State, element: ET.Element): # Verify that we didn't ignore any important info by accident @@ -1106,7 +1125,7 @@ def parse_define_desc(state: State, element: ET.Element): parsed.parsed += parse_desc(state, element.find('inbodydescription')) assert not parsed.templates assert not parsed.section # might be problematic - return (parsed.parsed, parsed.params, parsed.return_value) + return (parsed.parsed, parsed.params, parsed.return_value, parsed.is_deprecated) def parse_inline_desc(state: State, element: ET.Element) -> str: if element is None: return '' @@ -1126,7 +1145,7 @@ def parse_enum(state: State, element: ET.Element): enum.name = element.find('name').text if enum.name.startswith('@'): enum.name = '(anonymous)' enum.brief = parse_desc(state, element.find('briefdescription')) - enum.description = parse_desc(state, element.find('detaileddescription')) + parse_desc(state, element.find('inbodydescription')) + enum.description, enum.is_deprecated = parse_enum_desc(state, element) enum.is_protected = element.attrib['prot'] == 'protected' enum.is_strong = False if 'strong' in element.attrib: @@ -1143,12 +1162,12 @@ def parse_enum(state: State, element: ET.Element): value.initializer = html.escape(enumvalue.findtext('initializer', '')) if ''.join(enumvalue.find('briefdescription').itertext()).strip(): logging.warning("{}: ignoring brief description of enum value {}::{}".format(state.current, enum.name, value.name)) - value.description = parse_desc(state, enumvalue.find('detaileddescription')) + value.description, value.is_deprecated = parse_enum_value_desc(state, enumvalue) if value.description: enum.has_value_details = True if not state.doxyfile['M_SEARCH_DISABLED']: result = Empty() - result.flags = ResultFlag.ENUM_VALUE + result.flags = ResultFlag.ENUM_VALUE|(ResultFlag.IS_DEPRECATED if value.is_deprecated else ResultFlag(0)) result.url = state.current_url + '#' + value.id result.prefix = state.current_prefix + [enum.name] result.name = value.name @@ -1159,7 +1178,7 @@ def parse_enum(state: State, element: ET.Element): if enum.brief or enum.has_details or enum.has_value_details: if not state.doxyfile['M_SEARCH_DISABLED']: result = Empty() - result.flags = ResultFlag.ENUM + result.flags = ResultFlag.ENUM|(ResultFlag.IS_DEPRECATED if enum.is_deprecated else ResultFlag(0)) result.url = state.current_url + '#' + enum.id result.prefix = state.current_prefix result.name = enum.name @@ -1214,14 +1233,14 @@ def parse_typedef(state: State, element: ET.Element): typedef.args = parse_type(state, element.find('argsstring')) typedef.name = element.find('name').text typedef.brief = parse_desc(state, element.find('briefdescription')) - typedef.description, templates = parse_typedef_desc(state, element) + typedef.description, templates, typedef.is_deprecated = parse_typedef_desc(state, element) typedef.is_protected = element.attrib['prot'] == 'protected' typedef.has_template_details, typedef.templates = parse_template_params(state, element.find('templateparamlist'), templates) typedef.has_details = typedef.description or typedef.has_template_details if typedef.brief or typedef.has_details: result = Empty() - result.flags = ResultFlag.TYPEDEF + result.flags = ResultFlag.TYPEDEF|(ResultFlag.IS_DEPRECATED if typedef.is_deprecated else ResultFlag(0)) result.url = state.current_url + '#' + typedef.id result.prefix = state.current_prefix result.name = typedef.name @@ -1237,7 +1256,7 @@ def parse_func(state: State, element: ET.Element): func.type = parse_type(state, element.find('type')) func.name = fix_type_spacing(html.escape(element.find('name').text)) func.brief = parse_desc(state, element.find('briefdescription')) - func.description, templates, params, func.return_value = parse_func_desc(state, element) + func.description, templates, params, func.return_value, func.is_deprecated = parse_func_desc(state, element) # Extract function signature to prefix, suffix and various flags. Important # things affecting caller such as static or const (and rvalue overloads) @@ -1324,7 +1343,7 @@ def parse_func(state: State, element: ET.Element): if func.brief or func.has_details: if not state.doxyfile['M_SEARCH_DISABLED']: result = Empty() - result.flags = ResultFlag.FUNC + result.flags = ResultFlag.FUNC|(ResultFlag.IS_DEPRECATED if func.is_deprecated else ResultFlag(0)) result.url = state.current_url + '#' + func.id result.prefix = state.current_prefix result.name = func.name @@ -1350,13 +1369,13 @@ def parse_var(state: State, element: ET.Element): var.is_private = element.attrib['prot'] == 'private' var.name = element.find('name').text var.brief = parse_desc(state, element.find('briefdescription')) - var.description = parse_var_desc(state, element) + var.description, var.is_deprecated = parse_var_desc(state, element) var.has_details = not not var.description if var.brief or var.has_details: if not state.doxyfile['M_SEARCH_DISABLED']: result = Empty() - result.flags = ResultFlag.VAR + result.flags = ResultFlag.VAR|(ResultFlag.IS_DEPRECATED if var.is_deprecated else ResultFlag(0)) result.url = state.current_url + '#' + var.id result.prefix = state.current_prefix result.name = var.name @@ -1371,7 +1390,7 @@ def parse_define(state: State, element: ET.Element): define.id = extract_id(element) define.name = element.find('name').text define.brief = parse_desc(state, element.find('briefdescription')) - define.description, params, define.return_value = parse_define_desc(state, element) + define.description, params, define.return_value, define.is_deprecated = parse_define_desc(state, element) define.has_param_details = False define.params = None @@ -1394,7 +1413,7 @@ def parse_define(state: State, element: ET.Element): if define.brief or define.has_details: if not state.doxyfile['M_SEARCH_DISABLED']: result = Empty() - result.flags = ResultFlag.DEFINE + result.flags = ResultFlag.DEFINE|(ResultFlag.IS_DEPRECATED if define.is_deprecated else ResultFlag(0)) result.url = state.current_url + '#' + define.id result.prefix = [] result.name = define.name @@ -1446,6 +1465,15 @@ def extract_metadata(state: State, xml): compound.children = [] compound.parent = None # is filled in by postprocess_state() + compound.is_deprecated = False + for i in compounddef.find('detaileddescription').findall('.//xrefsect'): + id = i.attrib['id'] + match = xref_id_rx.match(id) + file = match.group(1) + if file.startswith('deprecated'): + compound.is_deprecated = True + break + if compound.kind in ['class', 'struct', 'union']: # Fix type spacing compound.name = fix_type_spacing(compound.name) @@ -1587,7 +1615,7 @@ def _build_search_data(state: State, prefix, id: str, trie: Trie, map: ResultMap # Otherwise add it multiple times with all possible prefixes else: # TODO: escape elsewhere so i don't have to unescape here - index = map.add(html.unescape(result_joiner.join(prefixed_name)), compound.url, flags=kind) + index = map.add(html.unescape(result_joiner.join(prefixed_name)), compound.url, flags=kind|(ResultFlag.IS_DEPRECATED if compound.is_deprecated else ResultFlag(0))) for i in range(len(prefixed_name)): lookahead_barriers = [] name = '' @@ -1693,7 +1721,7 @@ def parse_xml(state: State, xml: str): compound.has_template_details = False compound.templates = None compound.brief = parse_desc(state, compounddef.find('briefdescription')) - compound.description, templates, compound.sections, footer_navigation, example_navigation = parse_toplevel_desc(state, compounddef.find('detaileddescription')) + compound.description, templates, compound.sections, footer_navigation, example_navigation, compound.is_deprecated = parse_toplevel_desc(state, compounddef.find('detaileddescription')) compound.example_navigation = None compound.footer_navigation = None compound.modules = [] @@ -1804,6 +1832,7 @@ def parse_xml(state: State, xml: str): f.url = file.url f.name = file.leaf_name f.brief = file.brief + f.is_deprecated = file.is_deprecated if compounddef_child.tag == 'innerdir': compound.dirs += [f] @@ -1824,6 +1853,7 @@ def parse_xml(state: State, xml: str): namespace.url = symbol.url namespace.name = symbol.leaf_name if compound.kind == 'namespace' else symbol.name namespace.brief = symbol.brief + namespace.is_deprecated = symbol.is_deprecated compound.namespaces += [namespace] else: @@ -1834,6 +1864,7 @@ def parse_xml(state: State, xml: str): class_.url = symbol.url class_.name = symbol.leaf_name if compound.kind in ['namespace', 'class', 'struct', 'union'] else symbol.name class_.brief = symbol.brief + class_.is_deprecated = symbol.is_deprecated class_.templates = symbol.templates # Put classes into the public/protected section for @@ -1865,6 +1896,7 @@ def parse_xml(state: State, xml: str): class_.name = symbol.leaf_name class_.brief = symbol.brief class_.templates = symbol.templates + class_.is_deprecated = symbol.is_deprecated class_.is_protected = compounddef_child.attrib['prot'] == 'protected' class_.is_virtual = compounddef_child.attrib['virt'] == 'virtual' @@ -1887,6 +1919,7 @@ def parse_xml(state: State, xml: str): class_.name = symbol.leaf_name class_.brief = symbol.brief class_.templates = symbol.templates + class_.is_deprecated = symbol.is_deprecated compound.derived_classes += [class_] @@ -1899,6 +1932,7 @@ def parse_xml(state: State, xml: str): g.url = group.url g.name = group.leaf_name g.brief = group.brief + g.is_deprecated = group.is_deprecated compound.modules += [g] # Other, grouped in sections @@ -2250,6 +2284,7 @@ def parse_index_xml(state: State, xml): entry.url = compound.url entry.brief = compound.brief entry.children = [] + entry.is_deprecated = compound.is_deprecated entry.has_nestable_children = False # If a top-level thing, put it directly into the list diff --git a/doxygen/search.js b/doxygen/search.js index e0b6dac1..69aa469c 100644 --- a/doxygen/search.js +++ b/doxygen/search.js @@ -391,7 +391,7 @@ var Search = { break; } - list += this.fromUtf8('
' + type + '
' + this.escapeForRtl(results[i].name.substr(0, results[i].name.length - value.length - results[i].suffixLength)) + '' + this.escapeForRtl(results[i].name.substr(results[i].name.length - value.length - results[i].suffixLength, value.length)) + '' + this.escapeForRtl(results[i].name.substr(results[i].name.length - results[i].suffixLength)) + '
'); + list += this.fromUtf8('
' + type + '
' + (results[i].flags & 2 ? '
deprecated
' : '') + '
' + this.escapeForRtl(results[i].name.substr(0, results[i].name.length - value.length - results[i].suffixLength)) + '' + this.escapeForRtl(results[i].name.substr(results[i].name.length - value.length - results[i].suffixLength, value.length)) + '' + this.escapeForRtl(results[i].name.substr(results[i].name.length - results[i].suffixLength)) + '
'); } document.getElementById('search-results').innerHTML = list; document.getElementById('search-current').scrollIntoView(true); diff --git a/doxygen/templates/annotated.html b/doxygen/templates/annotated.html index f6b23278..f2b83fe5 100644 --- a/doxygen/templates/annotated.html +++ b/doxygen/templates/annotated.html @@ -7,13 +7,15 @@ {% for i in index.symbols recursive %} {% if i.children %}
  • - {{ i.kind }} {{ i.name }} {{ i.brief }} + {{ i.kind }} {{ i.name }} {{ i.brief }}{% if i.is_deprecated %} deprecated{% endif %} + + {# the above is here to preserve the newline #}
      {{ loop(i.children)|indent(4, true) }}
  • {% else %} -
  • {{ i.kind }} {{ i.name }} {{ i.brief }}
  • +
  • {{ i.kind }} {{ i.name }} {{ i.brief }}{% if i.is_deprecated %} deprecated{% endif %}
  • {% endif %} {% endfor %} diff --git a/doxygen/templates/entry-class.html b/doxygen/templates/entry-class.html index bd7d1c99..0cb8dee0 100644 --- a/doxygen/templates/entry-class.html +++ b/doxygen/templates/entry-class.html @@ -3,7 +3,7 @@ {% set j = joiner(', ') %}
    template<{% for t in class.templates %}{{ j() }}{{ t.type }}{% if t.name %} {{ t.name }}{% endif %}{% if t.default %} = {{ t.default }}{% endif %}{% endfor %}>
    {% endif %} - {{ class.kind }} {{ class.name }}{% if class.is_protected %} protected{% endif %}{% if class.is_virtual %} virtual{% endif %} + {{ class.kind }} {{ class.name }}{% if class.is_deprecated %} deprecated{% endif %}{% if class.is_protected %} protected{% endif %}{% if class.is_virtual %} virtual{% endif %} {# the empty line is above to fix spacing #} diff --git a/doxygen/templates/entry-define.html b/doxygen/templates/entry-define.html index 6c3775e2..91e43186 100644 --- a/doxygen/templates/entry-define.html +++ b/doxygen/templates/entry-define.html @@ -1,5 +1,5 @@
    {% set j = joiner(',\n ') %} - #define {{ define.name }}{% if define.params != None %}({% for param in define.params %}{{ j() }}{{ param[0] }}{% endfor %}){% endif %} + #define {{ define.name }}{% if define.params != None %}({% for param in define.params %}{{ j() }}{{ param[0] }}{% endfor %}){% endif %}{% if define.is_deprecated %} deprecated{% endif %}
    {{ define.brief }}
    diff --git a/doxygen/templates/entry-dir.html b/doxygen/templates/entry-dir.html index 32322321..e86271f6 100644 --- a/doxygen/templates/entry-dir.html +++ b/doxygen/templates/entry-dir.html @@ -1,2 +1,2 @@ -
    directory {{ dir.name }}/
    +
    directory {{ dir.name }}/{% if dir.is_deprecated %} deprecated{% endif %}
    {{ dir.brief }}
    diff --git a/doxygen/templates/entry-enum.html b/doxygen/templates/entry-enum.html index 60fa44bf..61a078eb 100644 --- a/doxygen/templates/entry-enum.html +++ b/doxygen/templates/entry-enum.html @@ -1,5 +1,5 @@
    {% set j = joiner(',\n ') %} - enum {% if enum.is_strong %}class {% endif %}{{ enum.name }}{% if enum.type %}: {{ enum.type }}{% endif %} { {% for value in enum.values %}{{ j() }}{{ value.name }}{% if value.initializer %} {{ value.initializer }}{% endif %}{% endfor %} }{% if mark_nonpublic and enum.is_protected %} protected{% endif %} + enum {% if enum.is_strong %}class {% endif %}{{ enum.name }}{% if enum.type %}: {{ enum.type }}{% endif %} { {% for value in enum.values %}{{ j() }}{{ value.name }}{% if value.initializer %} {{ value.initializer }}{% endif %}{% if value.is_deprecated %} deprecated{% endif %}{% endfor %} }{% if enum.is_deprecated %} deprecated{% endif %}{% if mark_nonpublic and enum.is_protected %} protected{% endif %}
    {{ enum.brief }}
    diff --git a/doxygen/templates/entry-file.html b/doxygen/templates/entry-file.html index 4dfdb918..6f91fe6e 100644 --- a/doxygen/templates/entry-file.html +++ b/doxygen/templates/entry-file.html @@ -1,2 +1,2 @@ -
    file {{ file.name }}
    +
    file {{ file.name }}{% if file.is_deprecated %} deprecated{% endif %}
    {{ file.brief }}
    diff --git a/doxygen/templates/entry-func.html b/doxygen/templates/entry-func.html index 39c6b351..a5fc72d9 100644 --- a/doxygen/templates/entry-func.html +++ b/doxygen/templates/entry-func.html @@ -4,6 +4,6 @@
    template<{% for t in func.templates %}{{ j() }}{{ t.type }}{% if t.name %} {{ t.name }}{% endif %}{% if t.default %} = {{ t.default }}{% endif%}{% endfor %}>
    {% endif %} {% set j = joiner(',\n ') %} - {{ func.prefix }}{% if func.type == 'void' %}void {% elif func.type %}auto {% endif %}{{ func.name }}({% for param in func.params %}{{ j() }}{{ param.type_name }}{% if param.default %} = {{ param.default }}{% endif %}{% endfor %}){{ func.suffix }}{% if func.type and func.type != 'void' %} -> {{ func.type }}{% endif %}{% if not func.type or mark_nonpublic %}{% if func.is_protected %} protected{% elif func.is_private %} private{% endif %}{% endif %}{% if func.is_defaulted %} defaulted{% endif %}{% if func.is_deleted %} deleted{% endif %}{% if func.is_explicit %} explicit {% endif %}{% if func.is_pure_virtual %} pure virtual{% elif func.is_virtual %} virtual{% endif %}{% if func.is_constexpr %} constexpr{% endif %}{% if func.is_noexcept %} noexcept{% endif %} + {{ func.prefix }}{% if func.type == 'void' %}void {% elif func.type %}auto {% endif %}{{ func.name }}({% for param in func.params %}{{ j() }}{{ param.type_name }}{% if param.default %} = {{ param.default }}{% endif %}{% endfor %}){{ func.suffix }}{% if func.type and func.type != 'void' %} -> {{ func.type }}{% endif %}{% if func.is_deprecated %} deprecated{% endif %}{% if not func.type or mark_nonpublic %}{% if func.is_protected %} protected{% elif func.is_private %} private{% endif %}{% endif %}{% if func.is_defaulted %} defaulted{% endif %}{% if func.is_deleted %} deleted{% endif %}{% if func.is_explicit %} explicit {% endif %}{% if func.is_pure_virtual %} pure virtual{% elif func.is_virtual %} virtual{% endif %}{% if func.is_constexpr %} constexpr{% endif %}{% if func.is_noexcept %} noexcept{% endif %}
    {{ func.brief }}
    diff --git a/doxygen/templates/entry-module.html b/doxygen/templates/entry-module.html index aac45ea8..489918a1 100644 --- a/doxygen/templates/entry-module.html +++ b/doxygen/templates/entry-module.html @@ -1,2 +1,2 @@ -
    module {{ module.name }}
    +
    module {{ module.name }}{% if module.is_deprecated %} deprecated{% endif %}
    {{ module.brief }}
    diff --git a/doxygen/templates/entry-namespace.html b/doxygen/templates/entry-namespace.html index eaae64ae..f0a10359 100644 --- a/doxygen/templates/entry-namespace.html +++ b/doxygen/templates/entry-namespace.html @@ -1,2 +1,2 @@ -
    namespace {{ namespace.name }}
    +
    namespace {{ namespace.name }}{% if namespace.is_deprecated %} deprecated{% endif %}
    {{ namespace.brief }}
    diff --git a/doxygen/templates/entry-typedef.html b/doxygen/templates/entry-typedef.html index 03b99db8..f370c1ab 100644 --- a/doxygen/templates/entry-typedef.html +++ b/doxygen/templates/entry-typedef.html @@ -3,7 +3,7 @@ {% set j = joiner(', ') %}
    template<{% for t in typedef.templates %}{{ j() }}{{ t.type }}{% if t.name %} {{ t.name }}{% endif %}{% if t.default %} = {{ t.default }}{% endif%}{% endfor %}>
    {% endif %} - using {{ typedef.name }} = {{ typedef.type }}{{ typedef.args }}{% if mark_nonpublic and typedef.is_protected %} protected{% endif %} + using {{ typedef.name }} = {{ typedef.type }}{{ typedef.args }}{% if typedef.is_deprecated %} deprecated{% endif %}{% if mark_nonpublic and typedef.is_protected %} protected{% endif %} {# This empty line needs to be there otherwise it's eaten #} diff --git a/doxygen/templates/entry-var.html b/doxygen/templates/entry-var.html index 0cb59505..50fb95ef 100644 --- a/doxygen/templates/entry-var.html +++ b/doxygen/templates/entry-var.html @@ -1,2 +1,2 @@ -
    {% if var.is_static %}static {% endif %}{{ var.type }} {{ var.name }}{% if mark_nonpublic and var.is_protected %} protected{% endif %}{% if var.is_constexpr %} constexpr{% endif %}
    +
    {% if var.is_static %}static {% endif %}{{ var.type }} {{ var.name }}{% if var.is_deprecated %} deprecated{% endif %}{% if mark_nonpublic and var.is_protected %} protected{% endif %}{% if var.is_constexpr %} constexpr{% endif %}
    {{ var.brief }}
    diff --git a/doxygen/templates/files.html b/doxygen/templates/files.html index 0f1b98b1..602cc8c6 100644 --- a/doxygen/templates/files.html +++ b/doxygen/templates/files.html @@ -7,13 +7,15 @@ {% for i in index.files recursive %} {% if i.children %}
  • - {{ i.kind }} {{ i.name }} {{ i.brief }} + {{ i.kind }} {{ i.name }} {{ i.brief }}{% if i.is_deprecated %} deprecated{% endif %} + + {# the above is here to preserve the newline #}
      {{ loop(i.children)|indent(4, true) }}
  • {% else %} -
  • {{ i.kind }} {{ i.name }} {{ i.brief }}
  • +
  • {{ i.kind }} {{ i.name }} {{ i.brief }}{% if i.is_deprecated %} deprecated{% endif %}
  • {% endif %} {% endfor %} diff --git a/doxygen/templates/modules.html b/doxygen/templates/modules.html index 5cb48e95..c43d0a56 100644 --- a/doxygen/templates/modules.html +++ b/doxygen/templates/modules.html @@ -7,13 +7,15 @@ {% for i in index.modules recursive %} {% if i.has_nestable_children %}
  • - module {{ i.name }} {{ i.brief }} + module {{ i.name }} {{ i.brief }}{% if i.is_deprecated %} deprecated{% endif %} + + {# the above is here to preserve the newline #}
      {{ loop(i.children)|indent(4, true) }}
  • {% else %} -
  • module {{ i.name }} {{ i.brief }}
  • +
  • module {{ i.name }} {{ i.brief }}{% if i.is_deprecated %} deprecated{% endif %}
  • {% endif %} {% endfor %} diff --git a/doxygen/templates/namespaces.html b/doxygen/templates/namespaces.html index 2f1af35d..70b2bc8f 100644 --- a/doxygen/templates/namespaces.html +++ b/doxygen/templates/namespaces.html @@ -7,13 +7,15 @@ {% for i in index.symbols|selectattr('kind', 'equalto', 'namespace') recursive %} {% if i.has_nestable_children %}
  • - {{ i.kind }} {{ i.name }} {{ i.brief }} + {{ i.kind }} {{ i.name }} {{ i.brief }}{% if i.is_deprecated %} deprecated{% endif %} + + {# the above is here to preserve the newline #}
      {{ loop(i.children|selectattr('kind', 'equalto', 'namespace'))|indent(4, true) }}
  • {% else %} -
  • {{ i.kind }} {{ i.name }} {{ i.brief }}
  • +
  • {{ i.kind }} {{ i.name }} {{ i.brief }}{% if i.is_deprecated %} deprecated{% endif %}
  • {% endif %} {% endfor %} diff --git a/doxygen/test/compound_deprecated/DeprecatedFile_8h.html b/doxygen/test/compound_deprecated/DeprecatedFile_8h.html new file mode 100644 index 00000000..3bb767bc --- /dev/null +++ b/doxygen/test/compound_deprecated/DeprecatedFile_8h.html @@ -0,0 +1,96 @@ + + + + + Dir/DeprecatedFile.h file | My Project + + + + + +
    +
    +
    +
    +
    +

    + Dir/DeprecatedFile.h file +

    +

    A file.

    +
    +

    Contents

    + +
    + +
    +

    Namespaces

    +
    +
    namespace DeprecatedNamespace deprecated
    +
    A namespace.
    +
    +
    +
    +

    Classes

    +
    +
    + struct DeprecatedNamespace::BaseDeprecatedClass deprecated +
    +
    A base class.
    +
    + struct DeprecatedNamespace::DeprecatedClass deprecated +
    +
    A class.
    +
    + union DeprecatedNamespace::DeprecatedUnion deprecated +
    +
    An union.
    +
    + struct DeprecatedNamespace::DeprecatedStruct deprecated +
    +
    A struct.
    +
    +
    +
    +

    Defines

    +
    +
    + #define DEPRECATED_MACRO(a, + b, + c) deprecated +
    +
    A macro.
    +
    +
    +
    +

    Define documentation

    +
    +

    + #define DEPRECATED_MACRO(a, + b, + c) +

    +

    A macro.

    + +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/doxygen/test/compound_deprecated/Dir/DeprecatedFile.h b/doxygen/test/compound_deprecated/Dir/DeprecatedFile.h new file mode 100644 index 00000000..a95626f4 --- /dev/null +++ b/doxygen/test/compound_deprecated/Dir/DeprecatedFile.h @@ -0,0 +1,98 @@ +/** @dir Dir + * @brief A directory + */ + +/** @dir DeprecatedSubdir + * @brief A directory + * @deprecated This dir is deprecated. + */ + +/** @file + * @brief A file + * @deprecated This file is deprecated. + */ + +/** +@brief A namespace +@deprecated This namespace is deprecated. +*/ +namespace DeprecatedNamespace { + +/** +@brief A base class +@deprecated This class is deprecated. +*/ +struct BaseDeprecatedClass {}; + +/** +@brief A class +@deprecated This class is deprecated. +*/ +struct DeprecatedClass: BaseDeprecatedClass {}; + +/** +@brief A function +@deprecated This function is deprecated. +*/ +void deprecatedFoo(int a, bool b, double c); + +/** +@brief A variable +@deprecated This variable is deprecated. +*/ +constexpr int DeprecatedVariable = 5; + +/** +@brief A typedef +@deprecated This typedef is deprecated. +*/ +typedef int DeprecatedTypedef; + +/** +@brief An enum +@deprecated This enum is deprecated. +*/ +enum DeprecatedEnum { + /** Enum value */ + Value = 15 +}; + +/** @brief An enum */ +enum Enum { + /** + * Enum value + * @deprecated This enum is deprecated. + */ + DeprecatedValue = 15 +}; + +/** @defgroup group A group + * @{ + */ + +/** +@brief An union +@deprecated This union is deprecated. +*/ +union DeprecatedUnion {}; + +/** +@brief A struct +@deprecated This struct is deprecated. +*/ +struct DeprecatedStruct {}; + +/*@}*/ + +/** @defgroup deprecated-group A group + * @ingroup group + * @deprecated This group is deprecated. + */ + +} + +/** +@brief A macro +@deprecated This macro is deprecated +*/ +#define DEPRECATED_MACRO(a, b, c) diff --git a/doxygen/test/compound_deprecated/Dir/DeprecatedSubdir/File.h b/doxygen/test/compound_deprecated/Dir/DeprecatedSubdir/File.h new file mode 100644 index 00000000..84b6920b --- /dev/null +++ b/doxygen/test/compound_deprecated/Dir/DeprecatedSubdir/File.h @@ -0,0 +1,3 @@ +/** @file + * @brief A file + */ diff --git a/doxygen/test/compound_deprecated/Doxyfile b/doxygen/test/compound_deprecated/Doxyfile new file mode 100644 index 00000000..64cd8d02 --- /dev/null +++ b/doxygen/test/compound_deprecated/Doxyfile @@ -0,0 +1,14 @@ +INPUT = Dir +RECURSIVE = YES +AUTOLINK_SUPPORT = NO +QUIET = YES +GENERATE_HTML = NO +GENERATE_LATEX = NO +GENERATE_XML = YES +XML_PROGRAMLISTING = NO + +M_PAGE_FINE_PRINT = +M_THEME_COLOR = +M_LINKS_NAVBAR1 = +M_LINKS_NAVBAR2 = +M_SEARCH_DISABLED = YES diff --git a/doxygen/test/compound_deprecated/annotated.html b/doxygen/test/compound_deprecated/annotated.html new file mode 100644 index 00000000..d4a13d7f --- /dev/null +++ b/doxygen/test/compound_deprecated/annotated.html @@ -0,0 +1,54 @@ + + + + + My Project + + + + + +
    +
    +
    +
    +
    +

    Classes

    + + +
    +
    +
    +
    + + diff --git a/doxygen/test/compound_deprecated/dir_da5033def2d0db76e9883b31b76b3d0c.html b/doxygen/test/compound_deprecated/dir_da5033def2d0db76e9883b31b76b3d0c.html new file mode 100644 index 00000000..a4ba4ed0 --- /dev/null +++ b/doxygen/test/compound_deprecated/dir_da5033def2d0db76e9883b31b76b3d0c.html @@ -0,0 +1,57 @@ + + + + + Dir/ directory | My Project + + + + + +
    +
    + + \ No newline at end of file diff --git a/doxygen/test/compound_deprecated/files.html b/doxygen/test/compound_deprecated/files.html new file mode 100644 index 00000000..4bbbc429 --- /dev/null +++ b/doxygen/test/compound_deprecated/files.html @@ -0,0 +1,57 @@ + + + + + My Project + + + + + +
    +
    +
    +
    +
    +

    Files

    + + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/doxygen/test/compound_deprecated/group__group.html b/doxygen/test/compound_deprecated/group__group.html new file mode 100644 index 00000000..8280484b --- /dev/null +++ b/doxygen/test/compound_deprecated/group__group.html @@ -0,0 +1,61 @@ + + + + + A group module | My Project + + + + + +
    +
    + + \ No newline at end of file diff --git a/doxygen/test/compound_deprecated/modules.html b/doxygen/test/compound_deprecated/modules.html new file mode 100644 index 00000000..261cffc6 --- /dev/null +++ b/doxygen/test/compound_deprecated/modules.html @@ -0,0 +1,51 @@ + + + + + My Project + + + + + +
    +
    +
    +
    +
    +

    Modules

    + + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/doxygen/test/compound_deprecated/namespaceDeprecatedNamespace.html b/doxygen/test/compound_deprecated/namespaceDeprecatedNamespace.html new file mode 100644 index 00000000..6d39cee8 --- /dev/null +++ b/doxygen/test/compound_deprecated/namespaceDeprecatedNamespace.html @@ -0,0 +1,176 @@ + + + + + DeprecatedNamespace namespace | My Project + + + + + +
    +
    +
    +
    +
    +

    DeprecatedNamespace namespace

    +

    A namespace.

    +
    +

    Contents

    + +
    + +
    +

    Classes

    +
    +
    + struct BaseDeprecatedClass deprecated +
    +
    A base class.
    +
    + struct DeprecatedClass deprecated +
    +
    A class.
    +
    + struct DeprecatedStruct deprecated +
    +
    A struct.
    +
    + union DeprecatedUnion deprecated +
    +
    An union.
    +
    +
    +
    +

    Enums

    +
    +
    + enum DeprecatedEnum { Value = 15 } deprecated +
    +
    An enum.
    +
    + enum Enum { DeprecatedValue = 15 deprecated } +
    +
    An enum.
    +
    +
    +
    +

    Typedefs

    +
    +
    + using DeprecatedTypedef = int deprecated +
    +
    A typedef.
    +
    +
    +
    +

    Functions

    +
    +
    + void deprecatedFoo(int a, + bool b, + double c) deprecated +
    +
    A function.
    +
    +
    +
    +

    Variables

    +
    +
    int DeprecatedVariable deprecated constexpr
    +
    A variable.
    +
    +
    +
    +

    Enum documentation

    +
    +

    + enum DeprecatedNamespace::DeprecatedEnum +

    +

    An enum.

    + + + + + + + + + +
    Enumerators
    Value +

    Enum value

    +
    +
    +
    +

    + enum DeprecatedNamespace::Enum +

    +

    An enum.

    + + + + + + + + +
    Enumerators
    DeprecatedValue +

    Enum value

    +
    +
    +
    +
    +

    Typedef documentation

    +
    +

    + typedef int DeprecatedNamespace::DeprecatedTypedef +

    +

    A typedef.

    + +
    +
    +
    +

    Function documentation

    +
    +

    + void DeprecatedNamespace::deprecatedFoo(int a, + bool b, + double c) +

    +

    A function.

    + +
    +
    +
    +

    Variable documentation

    +
    +

    + int DeprecatedNamespace::DeprecatedVariable constexpr +

    +

    A variable.

    + +
    +
    +
    +
    +
    +
    + + diff --git a/doxygen/test/compound_deprecated/namespaces.html b/doxygen/test/compound_deprecated/namespaces.html new file mode 100644 index 00000000..891726dd --- /dev/null +++ b/doxygen/test/compound_deprecated/namespaces.html @@ -0,0 +1,46 @@ + + + + + My Project + + + + + +
    +
    +
    +
    +
    +

    Namespaces

    + + +
    +
    +
    +
    + + diff --git a/doxygen/test/compound_deprecated/structDeprecatedNamespace_1_1BaseDeprecatedClass.html b/doxygen/test/compound_deprecated/structDeprecatedNamespace_1_1BaseDeprecatedClass.html new file mode 100644 index 00000000..9deacf9a --- /dev/null +++ b/doxygen/test/compound_deprecated/structDeprecatedNamespace_1_1BaseDeprecatedClass.html @@ -0,0 +1,41 @@ + + + + + DeprecatedNamespace::BaseDeprecatedClass struct | My Project + + + + + +
    +
    + + diff --git a/doxygen/test/compound_deprecated/structDeprecatedNamespace_1_1DeprecatedClass.html b/doxygen/test/compound_deprecated/structDeprecatedNamespace_1_1DeprecatedClass.html new file mode 100644 index 00000000..36be53da --- /dev/null +++ b/doxygen/test/compound_deprecated/structDeprecatedNamespace_1_1DeprecatedClass.html @@ -0,0 +1,41 @@ + + + + + DeprecatedNamespace::DeprecatedClass struct | My Project + + + + + +
    +
    + + diff --git a/doxygen/test/js-test-data/searchdata.b85 b/doxygen/test/js-test-data/searchdata.b85 index d218b391..02983f9d 100644 --- a/doxygen/test/js-test-data/searchdata.b85 +++ b/doxygen/test/js-test-data/searchdata.b85 @@ -1 +1 @@ -O+!-vL;(N*Dggih0s#R40{{d704W0i2mk;m0{{*H0B!>S6aWBe0s#X60{|cZ04W0iBme*?0{|)j0B!>SFaQ8)0{}Jv0Br*RJOBVX1OWm7LI8j|0{}<>0CEEWPyhgL0{~V40CWQYTmS%L0{~(G0A&IJ1pos8ZU6u&0|0UW04M_hcmM!y0|0&i0BHjNga80-0|1Hu06GK#1OSi#fI0&JmH+@{0|1@?0A~XLqyPYJ0|2T30AU9J8UO%oXaE3qumAvZ0|2%F06GK#006`QfI0&J$^Zap0|3$h0CWTc0RRI41pos8-T(k80|4d#04M_h>;M361pwFp0Aca~0BHgN1^@#90s#PJ0{{jA0A~XL3;_UP0{{{M0B{2U7y$rc0{|WY0Cfof_y7QHXaE3qumAvZBmn?(AOHXmHvj-(VgLXjhX4R!z5oCq;Q#<(76AajG64VpO<{Cs0B&JzWpi+0V`WWYbZ9PUbZu-1O<{CsIy!A>ZYXJPbSxlgZgeRCZeeX@b8ul}WldppXf9}UZEPcLX>LtnbZ9y{R%K&!Z*l-*Y+-YAO<{CsUol@XR%K&!Z*neZbZu+~O<{CsIyzQmV{~tFIy!A>ZYU`rV{dMAbO2*)VRLg$VRUF;F<&uOWn*-2axQ3eZEPcLX>LtnbZ9y{QekdqWdLJrVRLg$VRUF;F<&uKVQyz-E@*UZYz9qXbZ9y{QekdqWjZ=-X>KSfAY*TCb94Y>Y+-YAO<{CsUol@XQekdqWiDuRZEPcLX>L$qXJsJ5yC73_VsK$+WdL(^VsK$+WiDuRZEOGl \ No newline at end of file +O+!-vL;(N*Dggih0s#R40{{d704W0i2mk;m0{{*H0B!>S6aWBe0s#X60{|cZ04W0iBme*?0{|)j0B!>SFaQ8)0{}Jv0Br*RJOBVX1OWm7LI8j|0{}<>0CEEWPyhgL0{~V40CWQYTmS%L0{~(G0A&IJ1pos8ZU6u&0|0UW04M_hcmM!y0|0&i0BHjNga80-0|1Hu06GK#1OSi#fI0&JmH+@{0|1@?0A~XLqyPYJ0|2T30AU9J8UO%oXaE3qumAvZ0|2%F06GK#006`QfI0&J$^Zap0|3$h0CWTc0RRI41pos8-T(k80|4d#04M_h>;M361pwFp0Aca~0BHgN1^@#90s#PJ0{{jA0A~XL3;_UP0{{{M0B{2U7y$rc0{|WY0Cfof_y7QHXaE3qumAvZBmn?(AOHXmHvj-(VgLXlhX4R!z5oCq;Q#<(76AajG64VpO<{Cs0B&JzWpi+0V`WWYbZ9PUbZu-1O<{CsIy!A>ZYXJPbSxlgZgeRCZeeX@b8ul}WldppXf9}UZEPcLX>LtnbZ9y{R%K&!Z*l-*Y+-YAO<{CsUol@XR%K&!Z*neZbZu+~O<{CsIyzQmV{~tFIy!A>ZYU`rV{dMAbO2*)VRLg$VRUF;F<&uOWn*-2axQ3eZEPcLX>LtnbZ9y{QekdqWdLJrVRLg$VRUF;F<&uKVQyz-E@*UZYz9qXbZ9y{QekdqWjZ=-X>KSfAY*TCb94Y>Y+-YAO<{CsUol@XQekdqWiDuRZEPcLX>L$qXJsJ5yC73_VsK$+WdL(^VsK$+WiDuRZEOGl \ No newline at end of file diff --git a/doxygen/test/js-test-data/searchdata.bin b/doxygen/test/js-test-data/searchdata.bin index 01734670..ff1d1879 100644 Binary files a/doxygen/test/js-test-data/searchdata.bin and b/doxygen/test/js-test-data/searchdata.bin differ diff --git a/doxygen/test/populate-js-test-data.py b/doxygen/test/populate-js-test-data.py index 35e182c1..32bcfbaf 100755 --- a/doxygen/test/populate-js-test-data.py +++ b/doxygen/test/populate-js-test-data.py @@ -50,7 +50,7 @@ trie.insert("math", map.add("Math", "namespaceMath.html", flags=ResultFlag.NAMES index = map.add("Math::min(int, int)", "namespaceMath.html#min", suffix_length=8, flags=ResultFlag.FUNC) trie.insert("math::min()", index, lookahead_barriers=[4]) trie.insert("min()", index) -index = map.add("Math::Vector", "classMath_1_1Vector.html", flags=ResultFlag.CLASS) +index = map.add("Math::Vector", "classMath_1_1Vector.html", flags=ResultFlag.CLASS|ResultFlag.IS_DEPRECATED) trie.insert("math::vector", index) trie.insert("vector", index) index = map.add("Math::Vector::min() const", "classMath_1_1Vector.html#min", suffix_length=6, flags=ResultFlag.FUNC) diff --git a/doxygen/test/search/DeprecatedDir/DeprecatedFile.h b/doxygen/test/search/DeprecatedDir/DeprecatedFile.h new file mode 100644 index 00000000..a38bd734 --- /dev/null +++ b/doxygen/test/search/DeprecatedDir/DeprecatedFile.h @@ -0,0 +1,83 @@ +/** @dir DeprecatedDir + * @brief A directory + * @deprecated This dir is deprecated. + */ + +/** @file + * @brief A file + * @deprecated This file is deprecated. + */ + +/** +@brief A namespace +@deprecated This namespace is deprecated. +*/ +namespace DeprecatedNamespace { + +/** +@brief A class +@deprecated This class is deprecated. +*/ +struct DeprecatedClass {}; + +/** +@brief A function +@deprecated This function is deprecated. +*/ +void deprecatedFoo(int a, bool b, double c); + +/** +@brief A variable +@deprecated This variable is deprecated. +*/ +constexpr int DeprecatedVariable = 5; + +/** +@brief A typedef +@deprecated This typedef is deprecated. +*/ +typedef int DeprecatedTypedef; + +/** +@brief An enum +@deprecated This enum is deprecated. +*/ +enum class DeprecatedEnum { + /** Enum value */ + Value = 15 +}; + +/** @brief An enum */ +enum class Enum { + /** + * Enum value + * @deprecated This enum is deprecated. + */ + DeprecatedValue = 15 +}; + +/** @defgroup deprecated-group A group + * @deprecated This group is deprecated. + */ + +/** +@brief An union +@deprecated This union is deprecated. +*/ +union DeprecatedUnion {}; + +/** +@brief A struct +@deprecated This struct is deprecated. +*/ +struct DeprecatedStruct {}; + +/*@}*/ + +} + +/** +@brief A macro +@deprecated This macro is deprecated +*/ +#define DEPRECATED_MACRO(a, b, c) diff --git a/doxygen/test/search/Doxyfile b/doxygen/test/search/Doxyfile index 69240dd9..f25fc022 100644 --- a/doxygen/test/search/Doxyfile +++ b/doxygen/test/search/Doxyfile @@ -1,4 +1,4 @@ -INPUT = Dir UndocumentedDir input.dox +INPUT = Dir DeprecatedDir UndocumentedDir input.dox QUIET = YES GENERATE_HTML = NO GENERATE_LATEX = NO diff --git a/doxygen/test/test-search.js b/doxygen/test/test-search.js index d1af900c..87d1434f 100644 --- a/doxygen/test/test-search.js +++ b/doxygen/test/test-search.js @@ -151,7 +151,7 @@ const { StringDecoder } = require('string_decoder'); let resultsForVec = [ { name: 'Math::Vector', url: 'classMath_1_1Vector.html', - flags: 32, + flags: 32|2, /* Deprecated */ suffixLength: 3 }]; assert.deepEqual(Search.search('vec'), resultsForVec); diff --git a/doxygen/test/test_compound.py b/doxygen/test/test_compound.py index 6e22791b..b390cf91 100644 --- a/doxygen/test/test_compound.py +++ b/doxygen/test/test_compound.py @@ -149,3 +149,39 @@ class Modules(IntegrationTestCase): self.assertEqual(*self.actual_expected_contents('group__group2.html')) self.assertEqual(*self.actual_expected_contents('group__subgroup.html')) self.assertEqual(*self.actual_expected_contents('modules.html')) + +class Deprecated(IntegrationTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'deprecated', *args, **kwargs) + + def test(self): + self.run_dox2html5(wildcard='*.xml') + # Test that the [deprecated] label is in all places where it should ne + + # Class tree + self.assertEqual(*self.actual_expected_contents('annotated.html')) + + # Member namespace and define listing + self.assertEqual(*self.actual_expected_contents('DeprecatedFile_8h.html')) + + # Member file and directory listing + self.assertEqual(*self.actual_expected_contents('dir_da5033def2d0db76e9883b31b76b3d0c.html')) + + # File and directory tree + self.assertEqual(*self.actual_expected_contents('files.html')) + + # Member module listing + self.assertEqual(*self.actual_expected_contents('group__group.html')) + + # Module tree + self.assertEqual(*self.actual_expected_contents('modules.html')) + + # Member namespace, class, function, variable, typedef and enum listing + self.assertEqual(*self.actual_expected_contents('namespaceDeprecatedNamespace.html')) + + # Namespace tree + self.assertEqual(*self.actual_expected_contents('namespaces.html')) + + # Base and derived class listing + self.assertEqual(*self.actual_expected_contents('structDeprecatedNamespace_1_1BaseDeprecatedClass.html')) + self.assertEqual(*self.actual_expected_contents('structDeprecatedNamespace_1_1DeprecatedClass.html')) diff --git a/doxygen/test/test_search.py b/doxygen/test/test_search.py index 2441ab23..304516e9 100755 --- a/doxygen/test/test_search.py +++ b/doxygen/test/test_search.py @@ -138,6 +138,8 @@ def pretty_print_map(serialized: bytes, colors=False): if i: out += '\n' flags = ResultFlag(ResultMap.flags_struct.unpack_from(serialized, i*4 + 3)[0]) extra = [] + if flags & ResultFlag.IS_DEPRECATED: + extra += ['deprecated'] if flags & ResultFlag.HAS_SUFFIX: extra += ['suffix_length={}'.format(ResultMap.suffix_length_struct.unpack_from(serialized, offset)[0])] offset += 1 @@ -366,60 +368,101 @@ class Search(IntegrationTestCase): search_data_pretty = pretty_print(f.read())[0] #print(search_data_pretty) self.assertEqual(search_data_pretty, """ -a group [0] -| page [5] -namespace [1] +deprecatednamespace [0] +| | :$ +| | :deprecatedclass [1] +| | | struct [2] +| | | union [3] +| | | enum [20] +| | | | :$ +| | | | :value [19] +| | | typedef [23] +| | | variable [24] +| | | foo() [25] +| | enum [22] +| | | :$ +| | | :deprecatedvalue [21] +| class [1] +| struct [2] +| union [3] +| list [5] +| dir [13] +| | /$ +| | deprecatedfile.h [14] +| file.h [14] +| |oo() [25] +| enum [20] +| | :$ +| | :value [19] +| value [21] +| | riable [24] +| typedef [23] +| _macro() [30] +a group [4, 10] +| page [11] +namespace [6] | :$ -| :class [2] +| :class [7] | | :$ -| | :foo() [9, 10, 11, 12] -| struct [3] -| union [4] -| enum [14] +| | :foo() [15, 16, 17, 18] +| struct [8] +| union [9] +| enum [27] | | :$ -| | :value [13] -| typedef [15] -| variable [16] -class [2] +| | :value [26] +| typedef [28] +| variable [29] +class [7] | :$ -| :foo() [9, 10, 11, 12] -struct [3] -|ubpage [6] -union [4] -dir [7] -| /$ -| file.h [8] -file.h [8] -|oo() [9, 10, 11, 12] -enum [14] +| :foo() [15, 16, 17, 18] +struct [8] +|ubpage [12] +union [9] +foo() [15, 16, 17, 18] +value [19, 26] +| riable [29] +enum [22, 27] | :$ -| :value [13] -value [13] -| riable [16] -typedef [15] -macro [17] -| _function() [18] -| _with_params() [19] -0: A group [type=GROUP] -> group__group.html -1: Namespace [type=NAMESPACE] -> namespaceNamespace.html -2: Namespace::Class [type=CLASS] -> classNamespace_1_1Class.html -3: Namespace::Struct [type=STRUCT] -> structNamespace_1_1Struct.html -4: Namespace::Union [type=UNION] -> unionNamespace_1_1Union.html -5: A page [type=PAGE] -> page.html -6: A page » Subpage [type=PAGE] -> subpage.html -7: Dir [type=DIR] -> dir_da5033def2d0db76e9883b31b76b3d0c.html -8: Dir/File.h [type=FILE] -> File_8h.html -9: Namespace::Class::foo() [type=FUNC] -> classNamespace_1_1Class.html#aaeba4096356215868370d6ea476bf5d9 -10: Namespace::Class::foo() const [suffix_length=6, type=FUNC] -> classNamespace_1_1Class.html#ac03c5b93907dda16763eabd26b25500a -11: Namespace::Class::foo() && [suffix_length=3, type=FUNC] -> classNamespace_1_1Class.html#ac9e7e80d06281e30cfcc13171d117ade -12: Namespace::Class::foo(const Enum&, Typedef) [suffix_length=20, type=FUNC] -> classNamespace_1_1Class.html#aba8d57a830d4d79f86d58d92298677fa -13: Namespace::Enum::Value [type=ENUM_VALUE] -> namespaceNamespace.html#add172b93283b1ab7612c3ca6cc5dcfeaa689202409e48743b914713f96d93947c -14: Namespace::Enum [type=ENUM] -> namespaceNamespace.html#add172b93283b1ab7612c3ca6cc5dcfea -15: Namespace::Typedef [type=TYPEDEF] -> namespaceNamespace.html#abe2a245304bc2234927ef33175646e08 -16: Namespace::Variable [type=VAR] -> namespaceNamespace.html#ad3121960d8665ab045ca1bfa1480a86d -17: MACRO [type=DEFINE] -> File_8h.html#a824c99cb152a3c2e9111a2cb9c34891e -18: MACRO_FUNCTION() [type=DEFINE] -> File_8h.html#a025158d6007b306645a8eb7c7a9237c1 -19: MACRO_FUNCTION_WITH_PARAMS(params) [suffix_length=6, type=DEFINE] -> File_8h.html#a88602bba5a72becb4f2dc544ce12c420 +| :deprecatedvalue [21] +| value [26] +typedef [28] +macro [31] +| _function() [32] +| _with_params() [33] +0: DeprecatedNamespace [deprecated, type=NAMESPACE] -> namespaceDeprecatedNamespace.html +1: DeprecatedNamespace::DeprecatedClass [deprecated, type=STRUCT] -> structDeprecatedNamespace_1_1DeprecatedClass.html +2: DeprecatedNamespace::DeprecatedStruct [deprecated, type=STRUCT] -> structDeprecatedNamespace_1_1DeprecatedStruct.html +3: DeprecatedNamespace::DeprecatedUnion [deprecated, type=UNION] -> unionDeprecatedNamespace_1_1DeprecatedUnion.html +4: A group [type=GROUP] -> group__group.html +5: Deprecated List [type=PAGE] -> deprecated.html +6: Namespace [type=NAMESPACE] -> namespaceNamespace.html +7: Namespace::Class [type=CLASS] -> classNamespace_1_1Class.html +8: Namespace::Struct [type=STRUCT] -> structNamespace_1_1Struct.html +9: Namespace::Union [type=UNION] -> unionNamespace_1_1Union.html +10: A group [type=GROUP] -> group__deprecated-group.html +11: A page [type=PAGE] -> page.html +12: A page » Subpage [type=PAGE] -> subpage.html +13: DeprecatedDir [deprecated, type=DIR] -> dir_c6c97faf5a6cbd0f62c27843ce3af4d0.html +14: DeprecatedDir/DeprecatedFile.h [deprecated, type=FILE] -> DeprecatedFile_8h.html +15: Namespace::Class::foo() [type=FUNC] -> classNamespace_1_1Class.html#aaeba4096356215868370d6ea476bf5d9 +16: Namespace::Class::foo() const [suffix_length=6, type=FUNC] -> classNamespace_1_1Class.html#ac03c5b93907dda16763eabd26b25500a +17: Namespace::Class::foo() && [suffix_length=3, type=FUNC] -> classNamespace_1_1Class.html#ac9e7e80d06281e30cfcc13171d117ade +18: Namespace::Class::foo(const Enum&, Typedef) [suffix_length=20, type=FUNC] -> classNamespace_1_1Class.html#aba8d57a830d4d79f86d58d92298677fa +19: DeprecatedNamespace::DeprecatedEnum::Value [type=ENUM_VALUE] -> namespaceDeprecatedNamespace.html#ab1e37ddc1d65765f2a48485df4af7b47a689202409e48743b914713f96d93947c +20: DeprecatedNamespace::DeprecatedEnum [deprecated, type=ENUM] -> namespaceDeprecatedNamespace.html#ab1e37ddc1d65765f2a48485df4af7b47 +21: DeprecatedNamespace::Enum::DeprecatedValue [deprecated, type=ENUM_VALUE] -> namespaceDeprecatedNamespace.html#ac59010e983270c330b8625b5433961b9a4b5b0e9709902228c33df7e5e377e596 +22: DeprecatedNamespace::Enum [type=ENUM] -> namespaceDeprecatedNamespace.html#ac59010e983270c330b8625b5433961b9 +23: DeprecatedNamespace::DeprecatedTypedef [deprecated, type=TYPEDEF] -> namespaceDeprecatedNamespace.html#af503ad3ff194a4c2512aff16df771164 +24: DeprecatedNamespace::DeprecatedVariable [deprecated, type=VAR] -> namespaceDeprecatedNamespace.html#ae934297fc39624409333eefbfeabf5e5 +25: DeprecatedNamespace::deprecatedFoo(int, bool, double) [deprecated, suffix_length=17, type=FUNC] -> namespaceDeprecatedNamespace.html#a9a1b3fc71d294b548095985acc0d5092 +26: Namespace::Enum::Value [type=ENUM_VALUE] -> namespaceNamespace.html#add172b93283b1ab7612c3ca6cc5dcfeaa689202409e48743b914713f96d93947c +27: Namespace::Enum [type=ENUM] -> namespaceNamespace.html#add172b93283b1ab7612c3ca6cc5dcfea +28: Namespace::Typedef [type=TYPEDEF] -> namespaceNamespace.html#abe2a245304bc2234927ef33175646e08 +29: Namespace::Variable [type=VAR] -> namespaceNamespace.html#ad3121960d8665ab045ca1bfa1480a86d +30: DEPRECATED_MACRO(a, b, c) [deprecated, suffix_length=7, type=DEFINE] -> DeprecatedFile_8h.html#a7f8376730349fef9ff7d103b0245a13e +31: MACRO [type=DEFINE] -> File_8h.html#a824c99cb152a3c2e9111a2cb9c34891e +32: MACRO_FUNCTION() [type=DEFINE] -> File_8h.html#a025158d6007b306645a8eb7c7a9237c1 +33: MACRO_FUNCTION_WITH_PARAMS(params) [suffix_length=6, type=DEFINE] -> File_8h.html#a88602bba5a72becb4f2dc544ce12c420 """.strip()) if __name__ == '__main__': # pragma: no cover