added operator overload for string
parent
80e3e74934
commit
7fa7f7b9c5
|
@ -504,7 +504,8 @@ fn generate_icall_header(icalls: &HashSet<(String, Vec<String>)>) -> String {
|
||||||
contents = contents + return_type(ret) + " " + get_icall_name_ref((ret, args)).as_str() + "(godot_method_bind *mb, godot_object *inst";
|
contents = contents + return_type(ret) + " " + get_icall_name_ref((ret, args)).as_str() + "(godot_method_bind *mb, godot_object *inst";
|
||||||
for arg in args {
|
for arg in args {
|
||||||
contents = contents + ", ";
|
contents = contents + ", ";
|
||||||
if !is_primitive(&arg) && is_core_type(&arg) {
|
// if !is_primitive(&arg) && is_core_type(&arg) {
|
||||||
|
if !is_primitive(&arg) {
|
||||||
contents = contents + "const " + arg.as_str() + "&";
|
contents = contents + "const " + arg.as_str() + "&";
|
||||||
} else {
|
} else {
|
||||||
contents = contents + "const " + arg.as_str() + "";
|
contents = contents + "const " + arg.as_str() + "";
|
||||||
|
@ -544,7 +545,8 @@ fn generate_icall_implementation(icalls: &HashSet<(String, Vec<String>)>) -> Str
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
for arg in args {
|
for arg in args {
|
||||||
contents = contents + ", ";
|
contents = contents + ", ";
|
||||||
if !is_primitive(&arg) && is_core_type(&arg) {
|
// if !is_primitive(&arg) && is_core_type(&arg) {
|
||||||
|
if !is_primitive(&arg) {
|
||||||
contents = contents + "const " + arg.as_str() + "&";
|
contents = contents + "const " + arg.as_str() + "&";
|
||||||
} else {
|
} else {
|
||||||
contents = contents + "const " + arg.as_str() + "";
|
contents = contents + "const " + arg.as_str() + "";
|
||||||
|
@ -570,7 +572,7 @@ fn generate_icall_implementation(icalls: &HashSet<(String, Vec<String>)>) -> Str
|
||||||
} else if is_core_type(arg) {
|
} else if is_core_type(arg) {
|
||||||
contents = contents + "(void *) &arg" + j.to_string().as_str();
|
contents = contents + "(void *) &arg" + j.to_string().as_str();
|
||||||
} else {
|
} else {
|
||||||
contents = contents + "(void *) *(godot_object**) &arg" + j.to_string().as_str();
|
contents = contents + "(void *) arg" + j.to_string().as_str() + ".__core_object";
|
||||||
}
|
}
|
||||||
contents = contents + ",\n";
|
contents = contents + ",\n";
|
||||||
j = j + 1;
|
j = j + 1;
|
||||||
|
|
|
@ -57,7 +57,9 @@ elif target == "bindings":
|
||||||
env.Append(LINKFLAGS = ['-Wl,-R,\'$$ORIGIN/\''])
|
env.Append(LINKFLAGS = ['-Wl,-R,\'$$ORIGIN/\''])
|
||||||
env.Append(CPPPATH=['.', './godot', './godot_cpp'])
|
env.Append(CPPPATH=['.', './godot', './godot_cpp'])
|
||||||
|
|
||||||
env.Append(LIBS=['godot_cpp_core', 'godot.windows.tools.64'])
|
if platform == "windows":
|
||||||
|
env.Append(LIBS=['godot.windows.tools.64'])
|
||||||
|
env.Append(LIBS=['godot_cpp_core'])
|
||||||
env.Append(LIBPATH=["."])
|
env.Append(LIBPATH=["."])
|
||||||
|
|
||||||
env.Append(CPPFLAGS=['-D_GD_CPP_BINDING_IMPL'])
|
env.Append(CPPFLAGS=['-D_GD_CPP_BINDING_IMPL'])
|
||||||
|
|
|
@ -173,7 +173,7 @@ struct _WrappedMethod1<T, void, A0> {
|
||||||
(obj->*(method->f))(*arg[0]);
|
(obj->*(method->f))(*arg[0]);
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,11 @@ int String::length() const
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void String::operator =(const String &s)
|
||||||
|
{
|
||||||
|
godot_string_copy_string(&_godot_string, &s._godot_string);
|
||||||
|
}
|
||||||
|
|
||||||
bool String::operator ==(const String &s)
|
bool String::operator ==(const String &s)
|
||||||
{
|
{
|
||||||
return godot_string_operator_equal(&_godot_string, &s._godot_string);
|
return godot_string_operator_equal(&_godot_string, &s._godot_string);
|
||||||
|
|
|
@ -41,6 +41,8 @@ public:
|
||||||
|
|
||||||
int length() const;
|
int length() const;
|
||||||
|
|
||||||
|
void operator =(const String &s);
|
||||||
|
|
||||||
bool operator ==(const String &s);
|
bool operator ==(const String &s);
|
||||||
|
|
||||||
bool operator !=(const String &s);
|
bool operator !=(const String &s);
|
||||||
|
|
Loading…
Reference in New Issue