Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string getAvailableForms()
- {
- import extensions.enumeration : staticMembers;
- import asdf; // JSON serializer
- import std.traits : getUDAs, hasUDA;
- import externalPaths : ExternalAppPath, DisplayName;
- import std.algorithm : startsWith;
- import std.conv : to;
- FormDisplayNameObj[] output;
- static foreach(string fieldName; staticMembers!ExternalAppPath)
- {{
- static if(hasUDA!(__traits(getMember, ExternalAppPath, fieldName), DisplayName))
- {
- if(fieldName.startsWith(startKey))
- {
- DisplayName dn = getUDAs!(__traits(getMember, ExternalAppPath, fieldName), DisplayName)[0];
- string id = extractDigits(fieldName[startKey.length - 1 .. $]);
- int i = to!int(id);
- auto o = new FormDisplayNameObj();
- o.value = dn.value;
- o.index = i;
- output ~= o;
- }
- }
- }}
- return output.serializeToJson;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement