summaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/file/file_udf.cpp
diff options
context:
space:
mode:
authoraneporada <[email protected]>2024-11-12 07:55:22 +0300
committeraneporada <[email protected]>2024-11-12 08:10:50 +0300
commit621c8c7dade57165d6d431295f7a9a9143a062fa (patch)
treecc5dee0e889655fded4d4878071a0a6a76d2e17d /yql/essentials/udfs/common/file/file_udf.cpp
parent55cec9f6b0618fb3570fc8ef66aad151f4932591 (diff)
Merge GH PR #9404
commit_hash:d780798556aedbe2be898d69185380f2ecb95f9c
Diffstat (limited to 'yql/essentials/udfs/common/file/file_udf.cpp')
-rw-r--r--yql/essentials/udfs/common/file/file_udf.cpp47
1 files changed, 1 insertions, 46 deletions
diff --git a/yql/essentials/udfs/common/file/file_udf.cpp b/yql/essentials/udfs/common/file/file_udf.cpp
index 57db826591c..fa5f84a2c57 100644
--- a/yql/essentials/udfs/common/file/file_udf.cpp
+++ b/yql/essentials/udfs/common/file/file_udf.cpp
@@ -1,4 +1,5 @@
#include <yql/essentials/public/udf/udf_helpers.h>
+#include <yql/essentials/utils/line_split.h>
#include <util/generic/yexception.h>
#include <util/stream/buffered.h>
@@ -236,52 +237,6 @@ namespace {
const TTerminateFunc TerminateFunc;
};
- class TLineSplitter {
- public:
- TLineSplitter(IInputStream& stream)
- : Stream_(stream)
- {
- }
-
- size_t Next(TString& st) {
- st.clear();
- char c;
- size_t ret = 0;
- if (HasPendingLineChar_) {
- st.push_back(PendingLineChar_);
- HasPendingLineChar_ = false;
- ++ret;
- }
-
- while (Stream_.ReadChar(c)) {
- ++ret;
- if (c == '\n') {
- break;
- } else if (c == '\r') {
- if (Stream_.ReadChar(c)) {
- ++ret;
- if (c != '\n') {
- --ret;
- PendingLineChar_ = c;
- HasPendingLineChar_ = true;
- }
- }
-
- break;
- } else {
- st.push_back(c);
- }
- }
-
- return ret;
- }
-
- private:
- IInputStream& Stream_;
- bool HasPendingLineChar_ = false;
- char PendingLineChar_ = 0;
- };
-
template <class TUserType>
class TLineByLineBoxedValueIterator: public TBoxedValue {
public: