diff options
| author | Marcelo Fernandez | 2018-03-09 11:45:21 -0300 |
|---|---|---|
| committer | Marcelo Fernandez | 2018-03-13 12:07:37 -0300 |
| commit | a4e64c545406be00c00fe93818994977ae378fb9 (patch) | |
| tree | 3c348b2d9184db62e2e4e89b5c9269568e8cf7a8 /core/bind/core_bind.cpp | |
| parent | b84236944215445be191047ab628e570ffd69e99 (diff) | |
| download | godot-a4e64c545406be00c00fe93818994977ae378fb9.tar.gz godot-a4e64c545406be00c00fe93818994977ae378fb9.tar.zst godot-a4e64c545406be00c00fe93818994977ae378fb9.zip | |
Diffstat (limited to 'core/bind/core_bind.cpp')
| -rw-r--r-- | core/bind/core_bind.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index a81301e8e..20adf7ff0 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1535,6 +1535,17 @@ bool _File::is_open() const { return f != NULL; } +String _File::get_path() const { + + ERR_FAIL_COND_V(!f, ""); + return f->get_path(); +} + +String _File::get_path_absolute() const { + + ERR_FAIL_COND_V(!f, ""); + return f->get_path_absolute(); +} void _File::seek(int64_t p_position) { @@ -1824,6 +1835,8 @@ void _File::_bind_methods() { ClassDB::bind_method(D_METHOD("open", "path", "flags"), &_File::open); ClassDB::bind_method(D_METHOD("close"), &_File::close); + ClassDB::bind_method(D_METHOD("get_path"), &_File::get_path); + ClassDB::bind_method(D_METHOD("get_path_absolute"), &_File::get_path_absolute); ClassDB::bind_method(D_METHOD("is_open"), &_File::is_open); ClassDB::bind_method(D_METHOD("seek", "position"), &_File::seek); ClassDB::bind_method(D_METHOD("seek_end", "position"), &_File::seek_end, DEFVAL(0)); |
