MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / Generator

Function Generator

src/python/openvpn3/gen-python-constants.cpp:93–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92template <class T>
93void Generator(std::string name, std::vector<ConstantMapping<T>> mapping, FlagType flagtype = FlagType::NONE)
94{
95 std::stringstream c;
96
97 switch (flagtype)
98 {
99 case FlagType::INTFLAG:
100 c << "class " << name << "(IntFlag):" << std::endl;
101 break;
102 case FlagType::NONE:
103 default:
104 c << "class " << name << "(Enum):" << std::endl;
105 }
106 for (auto &m : mapping)
107 {
108 c << " " << m.name << " = " << m.GetPyValue() << std::endl;
109 }
110
111 std::cout << c.str() << std::endl;
112 std::cout << std::endl;
113}
114
115
116int main(int argc, char **argv)

Callers 1

mainFunction · 0.70

Calls 2

GetPyValueMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected