From 2447c3171ffae5d8ecf34883475907c8b20c2f9c Mon Sep 17 00:00:00 2001 From: tmt Date: Thu, 28 Jan 2016 15:58:39 +0100 Subject: File: Added delimiter to get_csv_line --- core/os/file_access.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/os/file_access.cpp') diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index d82d0b63c5..68c9dee84d 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -277,7 +277,9 @@ String FileAccess::get_line() const { return String::utf8(line.get_data()); } -Vector FileAccess::get_csv_line() const { +Vector FileAccess::get_csv_line(String delim) const { + + ERR_FAIL_COND_V(delim.length()!=1,Vector()); String l; int qc=0; @@ -303,7 +305,7 @@ Vector FileAccess::get_csv_line() const { CharType s[2]={0,0}; - if (!in_quote && c==',') { + if (!in_quote && c==delim[0]) { strings.push_back(current); current=String(); } else if (c=='"') { -- cgit v1.2.3