Skip to content

Multiple namespaces in a single file. #2

@jchlanda

Description

@jchlanda

It would appear that multiple namespaces in a single file are not handled correctly. Entries in a files dictionary are overriden.
To recreate this issue:

#ifndef __TEST_H
#define __TEST_H

/// @file           test.h
///
/// @overview       More than 1 namespace test file.
///

namespace ocl {
/// @brief Brief enum
enum MyEnum {}
}

namespace ocl_2 {
/// @brief    ..
struct MyStruct {

  const char* name;

  unsigned int num_arguments;


  /// @brief Brief Constructor
  MyStruct() : name(NULL), num_arguments(0) {}

  /// @brief Brief Copy Constructor
  MyStruct(const MyStruct& other)
      : name(other.name),
        num_arguments(other.num_arguments) {}


  int Woof() { return 42; }

  /// @brief destructor
  ~KernelInfo() {}

  void operator=(const KernelInfo& other) {}
};
}

#endif  //__TEST_H

Suggested fix:

diff --git a/doxy-coverage.py b/doxy-coverage.py
index 96b2cd3..89f1a31 100755
--- a/doxy-coverage.py
+++ b/doxy-coverage.py
@@ -112,7 +112,10 @@ def parse(path):

                file_fp = os.path.join (path, "%s.xml" %(entry.get('refid')))
                tmp = parse_file (file_fp)
-               files[tmp[0]] = tmp[1]
+                if tmp[0] in files:
+                    files[tmp[0]].update(tmp[1])
+                else:
+                    files[tmp[0]] = tmp[1]

        return files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions