diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-02-03 11:21:52 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-02-03 11:21:52 +0100 |
commit | 7cb930dbede1b9c21cf138e4a38ebb9e3dbd099f (patch) | |
tree | 2eb28d5e94d962558c4dd01809ac45ede973f4bf /core/bind | |
parent | fc65a57ff54d40727865ba117ed9f085bc7207fb (diff) | |
parent | 2447c3171ffae5d8ecf34883475907c8b20c2f9c (diff) |
Merge pull request #3502 from trtstm/csv
Added delimiter to File.get_csv_line
Diffstat (limited to 'core/bind')
-rw-r--r-- | core/bind/core_bind.cpp | 6 | ||||
-rw-r--r-- | core/bind/core_bind.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 522c42928c..b291ee396b 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1321,9 +1321,9 @@ String _File::get_line() const{ } -Vector<String> _File::get_csv_line() const { +Vector<String> _File::get_csv_line(String delim) const { ERR_FAIL_COND_V(!f,Vector<String>()); - return f->get_csv_line(); + return f->get_csv_line(delim); } /**< use this for files WRITTEN in _big_ endian machines (ie, amiga/mac) @@ -1506,7 +1506,7 @@ void _File::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_endian_swap","enable"),&_File::set_endian_swap); ObjectTypeDB::bind_method(_MD("get_error:Error"),&_File::get_error); ObjectTypeDB::bind_method(_MD("get_var"),&_File::get_var); - ObjectTypeDB::bind_method(_MD("get_csv_line"),&_File::get_csv_line); + ObjectTypeDB::bind_method(_MD("get_csv_line","delim"),&_File::get_csv_line,DEFVAL(",")); ObjectTypeDB::bind_method(_MD("store_8","value"),&_File::store_8); ObjectTypeDB::bind_method(_MD("store_16","value"),&_File::store_16); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index cb8fba3dcd..30cc93fa11 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -392,7 +392,7 @@ public: virtual void store_pascal_string(const String& p_string); virtual String get_pascal_string(); - Vector<String> get_csv_line() const; + Vector<String> get_csv_line(String delim=",") const; void store_buffer(const DVector<uint8_t>& p_buffer); ///< store an array of bytes |