Skip to content

Commit

Permalink
Merge pull request #40 from RameshRavone/patch-6
Browse files Browse the repository at this point in the history
 updated bindings
  • Loading branch information
karroffel committed Oct 3, 2017
2 parents def39f4 + 4adf3db commit 83cc9b8
Show file tree
Hide file tree
Showing 19 changed files with 456 additions and 123 deletions.
6 changes: 3 additions & 3 deletions binding_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def generate_class_header(used_classes, c):
source.append("")
source.append("")

source.append("#include <godot/gdnative.h>")
source.append("#include <gdnative/gdnative.h>")
source.append("#include <stdint.h>")
source.append("")

Expand Down Expand Up @@ -460,7 +460,7 @@ def generate_icall_header(icalls):

source.append("")

source.append("#include <godot/gdnative.h>")
source.append("#include <gdnative/gdnative.h>")
source.append("#include <stdint.h>")
source.append("")

Expand Down Expand Up @@ -510,7 +510,7 @@ def generate_icall_implementation(icalls):

source.append("")

source.append("#include <godot/gdnative.h>")
source.append("#include <gdnative/gdnative.h>")
source.append("#include <stdint.h>")
source.append("")

Expand Down
2 changes: 1 addition & 1 deletion include/core/Array.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ARRAY_H
#define ARRAY_H

#include <godot/array.h>
#include <gdnative/array.h>

#include "String.hpp"

Expand Down
2 changes: 1 addition & 1 deletion include/core/Color.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef COLOR_H
#define COLOR_H

#include <godot/color.h>
#include <gdnative/color.h>

#include <cmath>

Expand Down
2 changes: 1 addition & 1 deletion include/core/Dictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "Array.hpp"

#include <godot/dictionary.h>
#include <gdnative/dictionary.h>

namespace godot {

Expand Down
4 changes: 2 additions & 2 deletions include/core/Godot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <cstdlib>
#include <cstring>

#include <godot/gdnative.h>
#include <godot_nativescript.h>
#include <gdnative/gdnative.h>
#include <nativescript/godot_nativescript.h>


#include <CoreTypes.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/core/NodePath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "String.hpp"

#include <godot/node_path.h>
#include <gdnative/node_path.h>

namespace godot {

Expand Down
2 changes: 1 addition & 1 deletion include/core/PoolArrays.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "Vector2.hpp"
#include "Vector3.hpp"

#include <godot/pool_arrays.h>
#include <gdnative/pool_arrays.h>

namespace godot {

Expand Down
2 changes: 1 addition & 1 deletion include/core/RID.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef RID_H
#define RID_H

#include <godot/rid.h>
#include <gdnative/rid.h>

namespace godot {

Expand Down
124 changes: 83 additions & 41 deletions include/core/String.hpp
Original file line number Diff line number Diff line change
@@ -1,69 +1,111 @@
#ifndef STRING_H
#define STRING_H

#include <godot/string.h>
#include <gdnative/string.h>

namespace godot {

class NodePath;
class Variant;
class PoolByteArray;
class PoolRealArray;
class PoolStringArray;

class String
{
class String {
godot_string _godot_string;

public:
String();

String(const char *contents);

String(const wchar_t *contents);

String(const wchar_t c);

String(const String& other);
String(const String &other);

~String();

wchar_t &operator[](const int idx);
wchar_t operator[](const int idx) const;

String substr(int p_from,int p_chars) const;


wchar_t &operator [](const int idx);

wchar_t operator [](const int idx) const;

int length() const;

void operator =(const String &s);

bool operator ==(const String &s);

bool operator !=(const String &s);

String operator +(const String &s);

void operator +=(const String &s);

void operator +=(const wchar_t c);

bool operator <(const String &s);

bool operator <=(const String &s);

bool operator >(const String &s);

bool operator >=(const String &s);
void operator=(const String &s);
bool operator==(const String &s);
bool operator!=(const String &s);
String operator+(const String &s);
void operator+=(const String &s);
void operator+=(const wchar_t c);
bool operator<(const String &s);
bool operator<=(const String &s);
bool operator>(const String &s);
bool operator>=(const String &s);

operator NodePath() const;

int length() const;
const char *c_string() const;

int64_t find(String p_what) const;
int64_t find_from(String p_what, int64_t p_from) const;
bool begins_with(String &s) const;
bool begins_with_char_array(const char *p_char_array) const;
PoolStringArray bigrams() const;
String c_escape() const;
String c_unescape() const;
String capitalize() const;
bool empty() const;
bool ends_with(String &text) const;
void erase(int position, int chars) const;
int find(String what, int from = 0) const;
int find_last(String what) const;
int findn(String what, int from = 0) const;
String format(Variant values, String placeholder) const;
String get_base_dir() const;
String get_basename() const;
String get_extension() const;
String get_file() const;
int hash() const;
int hex_to_int() const;
String insert(int position, String what) const;
bool is_abs_path() const;
bool is_rel_path() const;
bool is_subsequence_of(String text) const;
bool is_subsequence_ofi(String text) const;
bool is_valid_float() const;
bool is_valid_html_color() const;
bool is_valid_identifier() const;
bool is_valid_integer() const;
bool is_valid_ip_address() const;
String json_escape() const;
String left(int position) const;
bool match(String expr) const;
bool matchn(String expr) const;
PoolByteArray md5_buffer() const;
String md5_text() const;
int ord_at(int at) const;
String pad_decimals(int digits) const;
String pad_zeros(int digits) const;
String percent_decode() const;
String percent_encode() const;
String plus_file(String file) const;
String replace(String what, String forwhat) const;
String replacen(String what, String forwhat) const;
int rfind(String what, int from = -1) const;
int rfindn(String what, int from = -1) const;
String right(int position) const;
PoolByteArray sha256_buffer() const;
String sha256_text() const;
float similarity(String text) const;
PoolStringArray split(String divisor, bool allow_empty = true) const;
PoolRealArray split_floats(String divisor, bool allow_empty = true) const;
String strip_edges(bool left = true, bool right = true) const;
String substr(int from, int len) const;
float to_float() const;
int64_t to_int() const;
String to_lower() const;
String to_upper() const;
String xml_escape() const;
String xml_unescape() const;
};

String operator +(const char *a, const String& b);


String operator+(const char *a, const String &b);
}



#endif // STRING_H
4 changes: 2 additions & 2 deletions include/core/Variant.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef VARIANT_H
#define VARIANT_H

#include <godot/variant.h>
#include <gdnative/variant.h>

#include "Defs.hpp"

Expand Down Expand Up @@ -259,7 +259,7 @@ class Variant {

bool hash_compare(const Variant& b) const;

bool booleanize(bool &valid) const;
bool booleanize() const;

~Variant();

Expand Down
2 changes: 1 addition & 1 deletion include/core/Vector2.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef VECTOR2_H
#define VECTOR2_H

#include <godot/vector2.h>
#include <gdnative/vector2.h>

#include "Defs.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/core/Color.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Color.hpp"

#include <godot/color.h>
#include <gdnative/color.h>

#include <cmath>

Expand Down
2 changes: 1 addition & 1 deletion src/core/GodotGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "String.hpp"

#include <godot/gdnative.h>
#include <gdnative/gdnative.h>

namespace godot {

Expand Down
2 changes: 1 addition & 1 deletion src/core/NodePath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "String.hpp"

#include <godot/node_path.h>
#include <gdnative/node_path.h>

namespace godot {

Expand Down
2 changes: 1 addition & 1 deletion src/core/PoolArrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "Vector2.hpp"
#include "Vector3.hpp"

#include <godot/pool_arrays.h>
#include <gdnative/pool_arrays.h>

namespace godot {

Expand Down
2 changes: 1 addition & 1 deletion src/core/RID.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "RID.hpp"

#include <godot/rid.h>
#include <gdnative/rid.h>

namespace godot {

Expand Down
Loading

0 comments on commit 83cc9b8

Please sign in to comment.