Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
10f5543a
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
10f5543a
编写于
6月 13, 2017
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Add support for skipping whitespaces"
This reverts commit
704a79ee
.
上级
49e84734
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
22 deletion
+14
-22
dbms/src/IO/ReadHelpers.cpp
dbms/src/IO/ReadHelpers.cpp
+10
-18
dbms/src/IO/ReadHelpers.h
dbms/src/IO/ReadHelpers.h
+4
-4
未找到文件。
dbms/src/IO/ReadHelpers.cpp
浏览文件 @
10f5543a
...
...
@@ -133,22 +133,16 @@ inline void appendToStringOrVector(PaddedPODArray<UInt8> & s, const char * begin
template
<
typename
Vector
>
void
readStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
)
void
readStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
)
{
while
(
!
buf
.
eof
())
{
size_t
bytes
=
0
;
bool
whitespace
=
false
;
for
(;
buf
.
position
()
+
bytes
!=
buf
.
buffer
().
end
();
++
bytes
)
if
(
buf
.
position
()[
bytes
]
==
'\t'
||
buf
.
position
()[
bytes
]
==
'\n'
)
{
whitespace
=
true
;
break
;
}
appendToStringOrVector
(
s
,
buf
.
position
(),
buf
.
position
()
+
bytes
);
if
(
skip_whitespace
&&
whitespace
)
bytes
+=
1
;
buf
.
position
()
+=
bytes
;
if
(
buf
.
hasPendingData
())
...
...
@@ -156,13 +150,13 @@ void readStringInto(Vector & s, ReadBuffer & buf, bool skip_whitespace)
}
}
void
readString
(
String
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
)
void
readString
(
String
&
s
,
ReadBuffer
&
buf
)
{
s
.
clear
();
readStringInto
(
s
,
buf
,
skip_whitespace
);
readStringInto
(
s
,
buf
);
}
template
void
readStringInto
<
PaddedPODArray
<
UInt8
>
>
(
PaddedPODArray
<
UInt8
>
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
);
template
void
readStringInto
<
PaddedPODArray
<
UInt8
>
>
(
PaddedPODArray
<
UInt8
>
&
s
,
ReadBuffer
&
buf
);
template
<
typename
Vector
>
...
...
@@ -333,7 +327,7 @@ static void parseJSONEscapeSequence(Vector & s, ReadBuffer & buf)
template
<
typename
Vector
>
void
readEscapedStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
)
void
readEscapedStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
)
{
while
(
!
buf
.
eof
())
{
...
...
@@ -345,24 +339,22 @@ void readEscapedStringInto(Vector & s, ReadBuffer & buf, bool skip_whitespace)
if
(
!
buf
.
hasPendingData
())
continue
;
if
(
*
buf
.
position
()
==
'\t'
||
*
buf
.
position
()
==
'\n'
)
{
buf
.
position
()
+=
1
;
if
(
*
buf
.
position
()
==
'\t'
||
*
buf
.
position
()
==
'\n'
)
return
;
}
if
(
*
buf
.
position
()
==
'\\'
)
parseComplexEscapeSequence
(
s
,
buf
);
}
}
void
readEscapedString
(
String
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
)
void
readEscapedString
(
String
&
s
,
ReadBuffer
&
buf
)
{
s
.
clear
();
readEscapedStringInto
(
s
,
buf
,
skip_whitespace
);
readEscapedStringInto
(
s
,
buf
);
}
template
void
readEscapedStringInto
<
PaddedPODArray
<
UInt8
>
>
(
PaddedPODArray
<
UInt8
>
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
);
template
void
readEscapedStringInto
<
NullSink
>(
NullSink
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
);
template
void
readEscapedStringInto
<
PaddedPODArray
<
UInt8
>
>
(
PaddedPODArray
<
UInt8
>
&
s
,
ReadBuffer
&
buf
);
template
void
readEscapedStringInto
<
NullSink
>(
NullSink
&
s
,
ReadBuffer
&
buf
);
template
<
char
quote
,
typename
Vector
>
...
...
dbms/src/IO/ReadHelpers.h
浏览文件 @
10f5543a
...
...
@@ -491,9 +491,9 @@ inline void readFloatText(T & x, ReadBuffer & buf)
}
/// rough; all until '\n' or '\t'
void
readString
(
String
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
=
false
);
void
readString
(
String
&
s
,
ReadBuffer
&
buf
);
void
readEscapedString
(
String
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
=
false
);
void
readEscapedString
(
String
&
s
,
ReadBuffer
&
buf
);
void
readQuotedString
(
String
&
s
,
ReadBuffer
&
buf
);
...
...
@@ -522,10 +522,10 @@ void readCSVString(String & s, ReadBuffer & buf, const char delimiter = ',');
/// Read and append result to array of characters.
template
<
typename
Vector
>
void
readStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
=
false
);
void
readStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
);
template
<
typename
Vector
>
void
readEscapedStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
,
bool
skip_whitespace
=
false
);
void
readEscapedStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
);
template
<
typename
Vector
>
void
readQuotedStringInto
(
Vector
&
s
,
ReadBuffer
&
buf
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录