updated generator to use new Json API and command arguments

pull/7/head
Karroffel 2017-03-05 20:01:25 +01:00
parent a15e7b7189
commit e3d98fd757
1 changed files with 15 additions and 2 deletions

View File

@ -8,6 +8,8 @@ use std::fs::File;
use std::iter::Iterator; use std::iter::Iterator;
use std::io::prelude::*; use std::io::prelude::*;
use std::env;
#[derive(Deserialize)] #[derive(Deserialize)]
struct GodotClass { struct GodotClass {
name: String, name: String,
@ -23,6 +25,11 @@ struct GodotClass {
struct GodotMethod { struct GodotMethod {
name: String, name: String,
return_type: String, return_type: String,
is_editor: bool,
is_noscript: bool,
is_const: bool,
is_virtual: bool,
is_from_script: bool,
arguments: Vec<GodotArgument> arguments: Vec<GodotArgument>
} }
@ -43,9 +50,15 @@ fn strip_name(s: &String) -> &str {
} }
fn main() { fn main() {
let base_dir = "/home/karroffel/Gamedev/dlscript_cpp_example/src/include/godot_cpp/"; let base_dir = match env::args().nth(2) {
Some(x) => x,
None => return
};
let mut file = File::open("/home/karroffel/Development/api.json").unwrap(); let mut file = match env::args().nth(1) {
Some(x) => File::open(x).unwrap(),
None => return
};
let mut file_contents = String::new(); let mut file_contents = String::new();