Working commit

This commit is contained in:
millb 2019-11-08 19:12:19 +03:00
parent cabe917d7e
commit 001e113ca6

View File

@ -253,12 +253,14 @@ inline void readBoolTextWord(bool & x, ReadBuffer & buf)
template <typename T, typename ReturnType = void> template <typename T, typename ReturnType = void>
ReturnType readIntTextImpl(T & x, ReadBuffer & buf) ReturnType readIntTextImpl(T & x, ReadBuffer & buf)
{ {
std::cerr << "\n\nEnter in readIntTextImpl function\n\n";
static constexpr bool throw_exception = std::is_same_v<ReturnType, void>; static constexpr bool throw_exception = std::is_same_v<ReturnType, void>;
bool negative = false; bool negative = false;
std::make_unsigned_t<T> res = 0; std::make_unsigned_t<T> res = 0;
if (buf.eof()) if (buf.eof())
{ {
std::cerr << "\n\nbuf.eof\n\n";
if constexpr (throw_exception) if constexpr (throw_exception)
throwReadAfterEOF(); throwReadAfterEOF();
else else
@ -267,6 +269,7 @@ ReturnType readIntTextImpl(T & x, ReadBuffer & buf)
while (!buf.eof()) while (!buf.eof())
{ {
std::cerr << "\n\nDo\n\n";
switch (*buf.position()) switch (*buf.position())
{ {
case '+': case '+':
@ -309,6 +312,7 @@ ReturnType readIntTextImpl(T & x, ReadBuffer & buf)
template <typename T> template <typename T>
void readIntText(T & x, ReadBuffer & buf) void readIntText(T & x, ReadBuffer & buf)
{ {
std::cerr << "\n\nEnter in readIntText function\n\n";
readIntTextImpl<T, void>(x, buf); readIntTextImpl<T, void>(x, buf);
} }
@ -669,11 +673,11 @@ inline void readBinary(LocalDate & x, ReadBuffer & buf) { readPODBinary(x, buf);
/// Generic methods to read value in text tab-separated format. /// Generic methods to read value in text tab-separated format.
template <typename T> template <typename T>
inline std::enable_if_t<is_integral_v<T>, void> inline std::enable_if_t<is_integral_v<T>, void>
readText(T & x, ReadBuffer & buf) { readIntText(x, buf); } readText(T & x, ReadBuffer & buf) { readIntText(x, buf); std::cerr << "\n\nEnter in readText for integral\n\n";}
template <typename T> template <typename T>
inline std::enable_if_t<std::is_floating_point_v<T>, void> inline std::enable_if_t<std::is_floating_point_v<T>, void>
readText(T & x, ReadBuffer & buf) { readFloatText(x, buf); } readText(T & x, ReadBuffer & buf) { readFloatText(x, buf); std::cerr << "\n\nEnter in readText for float\n\n";}
inline void readText(bool & x, ReadBuffer & buf) { readBoolText(x, buf); } inline void readText(bool & x, ReadBuffer & buf) { readBoolText(x, buf); }
inline void readText(String & x, ReadBuffer & buf) { readEscapedString(x, buf); } inline void readText(String & x, ReadBuffer & buf) { readEscapedString(x, buf); }