def METHOD_NAME(fname, group):
    # sys.stderr.write("Processing "+ fname +"\n")
    f = open(fname, "r", encoding="utf-8")
    out = io.StringIO()
    # load everything in memory
    fcontent = f.read()
    f.close()
    # now parse all the doxygen fields
    last = 0
    for m in re.finditer(r"/\*\*(.*?)\*/", fcontent, re.DOTALL):
        # write what is before the doxygen field to the output
        out.write(fcontent[last : m.start(1)])
        last = m.end(1)
        dcontent = m.group(1)
        # we don't care about doxygen fields not about a class
        if r"\class" in dcontent and dcontent != r" \class classname ":
            # do we have a line with the expected content?
            if re.search(r"\ingroup .*" + group + r"(\s|$)", dcontent, re.MULTILINE):
                # yes - just keep the content unchanged
                out.write(dcontent)
            else:
                # add the expected group
                if "\n" in dcontent:
                    # this is a multiline content. Find the indent
                    indent = re.search(r"( *)(\*|$)", dcontent).group(1)
                    lastLine = dcontent.splitlines()[-1]
                    if re.match(r"^ *$", lastLine):
                        out.write(dcontent + "* \\ingroup " + group + "\n" + indent)
                    else:
                        out.write(
                            dcontent.rstrip()
                            + "\n"
                            + indent
                            + "* \\ingroup "
                            + group
                            + "\n"
                            + indent
                        )
                else:
                    out.write(dcontent + " \\ingroup " + group + " ")
        else:
            out.write(dcontent)
    out.write(fcontent[last:])
    # we can save the content to the original file
    f = open(fname, "w", encoding="utf-8")
    f.write(out.getvalue())
    f.close()