# Path: pywrap/utils.py
# def indent_block(block, level):
#     """Indent code block.
# 
#     Parameters
#     ----------
#     block : str
#         Code block that might consist of multiple lines separated by os.linesep
# 
#     level : int
#         Level of indentation. Each level corresponds to four spaces.
#     """
#     lines = block.split(os.linesep)
#     indented_lines = [_indent_line(line, level=level) for line in lines]
#     indented_block = os.linesep.join(indented_lines)
#     return indented_block
# 
# def from_camel_case(name):
#     """Convert camel case to snake case.
# 
#     Function and variable names are usually written in camel case in C++ and
#     in snake case in Python.
#     """
#     new_name = str(name)
#     i = 0
#     while i < len(new_name):
#         if new_name[i].isupper() and i > 0:
#             new_name = new_name[:i] + "_" + new_name[i:]
#             i += 1
#         i += 1
#     return new_name.lower()


import os
import warnings
from .utils import indent_block, from_camel_case
class Typedef(AstNode):
    def __init__(self, filename, namespace, tipe, underlying_type):
        super(Typedef, self).__init__()
        self.filename = filename
        self.namespace = namespace
        self.tipe = tipe
        self.underlying_type = underlying_type

    def __str__(self):
        return "Typedef (%s) %s" % (self.underlying_type, self.tipe)


class Clazz(AstNode):
    def __init__(self, filename, namespace, name, comment=""):
        super(Clazz, self).__init__()
        self.filename = filename
        self.namespace = namespace
        self.name = name
        self.comment = comment
        self.base = None

    def __str__(self):
        result = "%s '%s' ('%s')" % (
            self.__class__.__name__.replace("zz", "ss"),
            self.name, self.get_cppname())
        if self.base is not None:
            result += " extends '%s'" % self.base
        if self.namespace != "":
            result += " (namespace: '%s')" % self.namespace
        if len(self.nodes) > 0:

# Path: pywrap/utils.py
# def indent_block(block, level):
#     """Indent code block.
# 
#     Parameters
#     ----------
#     block : str
#         Code block that might consist of multiple lines separated by os.linesep
# 
#     level : int
#         Level of indentation. Each level corresponds to four spaces.
#     """
#     lines = block.split(os.linesep)
#     indented_lines = [_indent_line(line, level=level) for line in lines]
#     indented_block = os.linesep.join(indented_lines)
#     return indented_block
# 
# def from_camel_case(name):
#     """Convert camel case to snake case.
# 
#     Function and variable names are usually written in camel case in C++ and
#     in snake case in Python.
#     """
#     new_name = str(name)
#     i = 0
#     while i < len(new_name):
#         if new_name[i].isupper() and i > 0:
#             new_name = new_name[:i] + "_" + new_name[i:]
#             i += 1
#         i += 1
#     return new_name.lower()


# Path: pywrap/ast.py
import os
import warnings
from .utils import indent_block, from_camel_case

class Typedef(AstNode):
    def __init__(self, filename, namespace, tipe, underlying_type):
        super(Typedef, self).__init__()
        self.filename = filename
        self.namespace = namespace
        self.tipe = tipe
        self.underlying_type = underlying_type

    def __str__(self):
        return "Typedef (%s) %s" % (self.underlying_type, self.tipe)


class Clazz(AstNode):
    def __init__(self, filename, namespace, name, comment=""):
        super(Clazz, self).__init__()
        self.filename = filename
        self.namespace = namespace
        self.name = name
        self.comment = comment
        self.base = None

    def __str__(self):
        result = "%s '%s' ('%s')" % (
            self.__class__.__name__.replace("zz", "ss"),
            self.name, self.get_cppname())
        if self.base is not None:
            result += " extends '%s'" % self.base
        if self.namespace != "":
            result += " (namespace: '%s')" % self.namespace
        if len(self.nodes) > 0:

            result += os.linesep + indent_block(os.linesep.join(