1 module cucumber.ctutils; 2 3 string modulesString(Modules...)() { 4 import std.array; 5 string[] modules; 6 foreach(mod; Modules) { 7 modules ~= mod; 8 } 9 return modules.join(","); 10 } 11 12 string importModulesString(Modules...)() { 13 return "import " ~ modulesString!Modules ~ ";"; 14 } 15 16 private template HasAttribute(alias mod, string T, alias A) { 17 mixin("import " ~ fullyQualifiedName!mod ~ ";"); //so it's visible 18 enum index = staticIndexOf!(A, __traits(getAttributes, mixin(T))); 19 static if(index >= 0) { 20 enum HasAttribute = true; 21 } else { 22 enum HasAttribute = false; 23 } 24 }