File: __init__.py

package info (click to toggle)
exhale 0.3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,616 kB
  • sloc: python: 9,057; cpp: 1,260; javascript: 915; f90: 29; ansic: 18; makefile: 16
file content (110 lines) | stat: -rw-r--r-- 5,866 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
"""
The ``cpp_func_overloads`` test project.
"""

from testing.hierarchies import clike, directory, file, function, namespace, parameters


def default_class_hierarchy_dict():
    """Return the default class hierarchy dictionary."""
    return {
        namespace("overload"): {
            clike("class", "CustomType"): {},
        }
    }


def default_file_hierarchy_dict():
    """Return the default file hierarchy dictionary."""
    return {
        directory("include"): {
            directory("overload"): {
                file("overload.hpp"): {
                    function("int", "blargh"): parameters("int"),
                    namespace("overload"): {
                        # No args
                        function("void", "blargh"): parameters(),
                        # "pure" int overloads
                        function("int", "blargh"): parameters("int"),
                        function("int", "blargh"): parameters("int", "int"),
                        function("int", "blargh"): parameters("int", "int", "int"),
                        function("int", "blargh"): parameters("int", "int", "int", "int"),
                        # "pure" float overloads
                        function("float", "blargh"): parameters("float"),
                        function("float", "blargh"): parameters("float", "float"),
                        function("float", "blargh"): parameters("float", "float", "float"),
                        function("float", "blargh"): parameters("float", "float", "float", "float"),
                        # "pure" std::string overloads
                        function("std::string", "blargh"): parameters("const std::string&"),
                        function("std::string", "blargh"): parameters(
                            "const std::string&", "const std::string&"
                        ),
                        function("std::string", "blargh"): parameters(
                            "const std::string&", "const std::string&", "const std::string&"
                        ),
                        function("std::string", "blargh"): parameters(
                            "const std::string&", "const std::string&", "const std::string&",
                            "const std::string&"
                        ),
                        # absurd mixtures
                        function("std::size_t", "blargh"): parameters("std::size_t", "const std::string&"),
                        function("std::size_t", "blargh"): parameters(
                            "std::size_t", "const float&", "double", "const std::string&"
                        ),
                        # vector overloads
                        function("void", "blargh"): parameters("std::vector<std::string>&"),
                        function("void", "blargh"): parameters("std::vector<std::vector<int>>&"),
                        # pointer style (spaces matter...)
                        function("void", "blargh"): parameters(
                            "const float *", "const float *", "float *", "std::size_t"
                        ),
                        # templates
                        function("C::type", "blargh", template=["class C"]): parameters("typename C::type"),
                        # NOTE: vvv not really a thing, but its for template specialization.
                        #       AKA broken
                        function("int", "blargh", template=["overload::SuperStruct"]): parameters("int"),
                        function(
                            "int", "blargh", template=["overload::nested::SuperStruct"]): parameters("int"),
                        # SFINAE is really pretty yeah?
                        function(
                            "std::enable_if<std::is_convertible<typename C::type, T>::value, T>::type",
                            "blargh",
                            template=["class C", "typename T"]
                        ): parameters("typename C::type"),
                        function(
                            "std::enable_if<!std::is_convertible<typename C::type, T>::value, T>::type",
                            "blargh",
                            template=["class C", "typename T"]
                        ): parameters("typename C::type")
                    }
                },
                file("operators.hpp"): {
                    namespace("overload"): {
                        clike("class", "CustomType"): {},
                        function(
                            "Out&",
                            "operator<<",
                            template=["typename Out", "typename T"]
                        ): parameters("Out&", "const T&"),
                        function(
                            "std::ostream&",
                            "operator<<",
                            template=["std::ostream", "CustomType"]
                        ): parameters("std::ostream&", "const CustomType&"),
                        function("bool", "operator=="): parameters(
                            "const CustomType&", "const CustomType&"),
                        function("bool", "operator!="): parameters(
                            "const CustomType&", "const CustomType&"),
                        function("bool", "operator<"): parameters(
                            "const CustomType&", "const CustomType&"),
                        function("bool", "operator>"): parameters(
                            "const CustomType&", "const CustomType&"),
                        function("bool", "operator<="): parameters(
                            "const CustomType&", "const CustomType&"),
                        function("bool", "operator>="): parameters(
                            "const CustomType&", "const CustomType&")
                    }
                }
            }
        }
    }