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.traits;
17 import godot.core;
18 import godot.c;
19 import godot.d.bind;
20 import godot.d.reference;
21 import godot.globalenums;
22 import godot.object;
23 import godot.classdb;
24 import godot.streampeer;
25 import godot.reference;
26 /**
27 
28 */
29 @GodotBaseClass struct StreamPeerBuffer
30 {
31 	package(godot) enum string _GODOT_internal_name = "StreamPeerBuffer";
32 public:
33 @nogc nothrow:
34 	union { /** */ godot_object _godot_object; /** */ StreamPeer _GODOT_base; }
35 	alias _GODOT_base this;
36 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
37 	package(godot) __gshared bool _classBindingInitialized = false;
38 	package(godot) static struct GDNativeClassBinding
39 	{
40 		__gshared:
41 		@GodotName("clear") GodotMethod!(void) clear;
42 		@GodotName("duplicate") GodotMethod!(StreamPeerBuffer) duplicate;
43 		@GodotName("get_data_array") GodotMethod!(PoolByteArray) getDataArray;
44 		@GodotName("get_position") GodotMethod!(long) getPosition;
45 		@GodotName("get_size") GodotMethod!(long) getSize;
46 		@GodotName("resize") GodotMethod!(void, long) resize;
47 		@GodotName("seek") GodotMethod!(void, long) seek;
48 		@GodotName("set_data_array") GodotMethod!(void, PoolByteArray) setDataArray;
49 	}
50 	/// 
51 	pragma(inline, true) bool opEquals(in StreamPeerBuffer other) const
52 	{ return _godot_object.ptr is other._godot_object.ptr; }
53 	/// 
54 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
55 	{ _godot_object.ptr = n; return null; }
56 	/// 
57 	pragma(inline, true) bool opEquals(typeof(null) n) const
58 	{ return _godot_object.ptr is n; }
59 	/// 
60 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
61 	mixin baseCasts;
62 	/// Construct a new instance of StreamPeerBuffer.
63 	/// Note: use `memnew!StreamPeerBuffer` instead.
64 	static StreamPeerBuffer _new()
65 	{
66 		static godot_class_constructor constructor;
67 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("StreamPeerBuffer");
68 		if(constructor is null) return typeof(this).init;
69 		return cast(StreamPeerBuffer)(constructor());
70 	}
71 	@disable new(size_t s);
72 	/**
73 	
74 	*/
75 	void clear()
76 	{
77 		checkClassBinding!(typeof(this))();
78 		ptrcall!(void)(GDNativeClassBinding.clear, _godot_object);
79 	}
80 	/**
81 	
82 	*/
83 	Ref!StreamPeerBuffer duplicate() const
84 	{
85 		checkClassBinding!(typeof(this))();
86 		return ptrcall!(StreamPeerBuffer)(GDNativeClassBinding.duplicate, _godot_object);
87 	}
88 	/**
89 	
90 	*/
91 	PoolByteArray getDataArray() const
92 	{
93 		checkClassBinding!(typeof(this))();
94 		return ptrcall!(PoolByteArray)(GDNativeClassBinding.getDataArray, _godot_object);
95 	}
96 	/**
97 	
98 	*/
99 	long getPosition() const
100 	{
101 		checkClassBinding!(typeof(this))();
102 		return ptrcall!(long)(GDNativeClassBinding.getPosition, _godot_object);
103 	}
104 	/**
105 	
106 	*/
107 	long getSize() const
108 	{
109 		checkClassBinding!(typeof(this))();
110 		return ptrcall!(long)(GDNativeClassBinding.getSize, _godot_object);
111 	}
112 	/**
113 	
114 	*/
115 	void resize(in long size)
116 	{
117 		checkClassBinding!(typeof(this))();
118 		ptrcall!(void)(GDNativeClassBinding.resize, _godot_object, size);
119 	}
120 	/**
121 	
122 	*/
123 	void seek(in long position)
124 	{
125 		checkClassBinding!(typeof(this))();
126 		ptrcall!(void)(GDNativeClassBinding.seek, _godot_object, position);
127 	}
128 	/**
129 	
130 	*/
131 	void setDataArray(in PoolByteArray data)
132 	{
133 		checkClassBinding!(typeof(this))();
134 		ptrcall!(void)(GDNativeClassBinding.setDataArray, _godot_object, data);
135 	}
136 	/**
137 	
138 	*/
139 	@property PoolByteArray dataArray()
140 	{
141 		return getDataArray();
142 	}
143 	/// ditto
144 	@property void dataArray(PoolByteArray v)
145 	{
146 		setDataArray(v);
147 	}
148 }