mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Revert "Add support for skipping whitespaces"
This reverts commit 704a79ee6c
.
This commit is contained in:
parent
49e8473456
commit
10f5543a49
@ -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>
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user