Created
October 3, 2019 04:23
-
-
Save jrfondren/b40baf90689f96b51d836e0881b0a3f1 to your computer and use it in GitHub Desktop.
jsonizer this error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env dub | |
/+ dub.sdl: | |
dependency "jsonizer" version="~>0" | |
+/ | |
import std.stdio; | |
import jsonizer; | |
struct ComponentList | |
{ | |
mixin JsonizeMe; | |
enum Type | |
{ | |
None, | |
Whitelist, | |
Blacklist | |
} | |
string component; | |
string[] modules; | |
} | |
struct Settings | |
{ | |
mixin JsonizeMe; | |
string path; | |
this(in string path) | |
{ | |
this.path = path.idup; | |
} | |
@jsonize | |
{ | |
string realName; | |
string userName; | |
string nickName; | |
long saveInterval; | |
string[] commandPrefixes; | |
} | |
@jsonize(Jsonize.opt) | |
{ | |
ComponentList.Type componentListType; | |
ComponentList[] components; | |
} | |
} | |
void main() { | |
Settings x = Settings("hi"); | |
writeJSON!Settings("test.json", x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment