1 /**
2 
3 
4 Copyright:
5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.  
6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)  
7 Copyright (c) 2017-2018 Godot-D contributors  
8 
9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License)
10 
11 
12 */
13 module godot.streampeerbuffer;
14 import std.meta : AliasSeq, staticIndexOf;
15 import std.traits : Unqual;
16 import godot.d.meta;
17 import godot.core;
18 import godot.c;
19 import godot.d.bind;
20 import godot.d.reference;
21 import godot.object;
22 import godot.classdb;
23 import godot.streampeer;
24 import godot.reference;
25 /**
26 
27 */
28 @GodotBaseClass struct StreamPeerBuffer
29 {
30 	enum string _GODOT_internal_name = "StreamPeerBuffer";
31 public:
32 @nogc nothrow:
33 	union { godot_object _godot_object; StreamPeer _GODOT_base; }
34 	alias _GODOT_base this;
35 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
36 	package(godot) __gshared bool _classBindingInitialized = false;
37 	package(godot) static struct _classBinding
38 	{
39 		__gshared:
40 		@GodotName("seek") GodotMethod!(void, long) seek;
41 		@GodotName("get_size") GodotMethod!(long) getSize;
42 		@GodotName("get_position") GodotMethod!(long) getPosition;
43 		@GodotName("resize") GodotMethod!(void, long) resize;
44 		@GodotName("set_data_array") GodotMethod!(void, PoolByteArray) setDataArray;
45 		@GodotName("get_data_array") GodotMethod!(PoolByteArray) getDataArray;
46 		@GodotName("clear") GodotMethod!(void) clear;
47 		@GodotName("duplicate") GodotMethod!(StreamPeerBuffer) duplicate;
48 	}
49 	bool opEquals(in StreamPeerBuffer other) const { return _godot_object.ptr is other._godot_object.ptr; }
50 	StreamPeerBuffer opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
51 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
52 	mixin baseCasts;
53 	static StreamPeerBuffer _new()
54 	{
55 		static godot_class_constructor constructor;
56 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("StreamPeerBuffer");
57 		if(constructor is null) return typeof(this).init;
58 		return cast(StreamPeerBuffer)(constructor());
59 	}
60 	@disable new(size_t s);
61 	/**
62 	
63 	*/
64 	void seek(in long position)
65 	{
66 		checkClassBinding!(typeof(this))();
67 		ptrcall!(void)(_classBinding.seek, _godot_object, position);
68 	}
69 	/**
70 	
71 	*/
72 	long getSize() const
73 	{
74 		checkClassBinding!(typeof(this))();
75 		return ptrcall!(long)(_classBinding.getSize, _godot_object);
76 	}
77 	/**
78 	
79 	*/
80 	long getPosition() const
81 	{
82 		checkClassBinding!(typeof(this))();
83 		return ptrcall!(long)(_classBinding.getPosition, _godot_object);
84 	}
85 	/**
86 	
87 	*/
88 	void resize(in long size)
89 	{
90 		checkClassBinding!(typeof(this))();
91 		ptrcall!(void)(_classBinding.resize, _godot_object, size);
92 	}
93 	/**
94 	
95 	*/
96 	void setDataArray(in PoolByteArray data)
97 	{
98 		checkClassBinding!(typeof(this))();
99 		ptrcall!(void)(_classBinding.setDataArray, _godot_object, data);
100 	}
101 	/**
102 	
103 	*/
104 	PoolByteArray getDataArray() const
105 	{
106 		checkClassBinding!(typeof(this))();
107 		return ptrcall!(PoolByteArray)(_classBinding.getDataArray, _godot_object);
108 	}
109 	/**
110 	
111 	*/
112 	void clear()
113 	{
114 		checkClassBinding!(typeof(this))();
115 		ptrcall!(void)(_classBinding.clear, _godot_object);
116 	}
117 	/**
118 	
119 	*/
120 	Ref!StreamPeerBuffer duplicate() const
121 	{
122 		checkClassBinding!(typeof(this))();
123 		return ptrcall!(StreamPeerBuffer)(_classBinding.duplicate, _godot_object);
124 	}
125 	/**
126 	
127 	*/
128 	@property PoolByteArray dataArray()
129 	{
130 		return getDataArray();
131 	}
132 	/// ditto
133 	@property void dataArray(PoolByteArray v)
134 	{
135 		setDataArray(v);
136 	}
137 }