Removed Poco::NumberParser (almost) [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2018-08-20 22:48:15 +03:00
parent 328c1387c0
commit f6e4ec970a
4 changed files with 38 additions and 38 deletions

View File

@ -6,7 +6,7 @@
#endif
#include <common/Types.h>
#include <Poco/NumberParser.h>
#include <IO/ReadHelpers.h>
#include <IO/ReadBufferFromFileDescriptor.h>
/** Counts number of 0 in a file.
@ -20,10 +20,10 @@ int main(int argc, char ** argv)
{
DB::ReadBufferFromFileDescriptor in(STDIN_FILENO);
size_t zeros = 0;
size_t limit = 0;
UInt64 limit = 0;
if (argc == 2)
limit = Poco::NumberParser::parseUnsigned64(argv[1]);
limit = DB::parse<UInt64>(argv[1]);
while (!in.eof())
{

View File

@ -7,7 +7,7 @@
#include <vector>
#include <random>
#include <pcg_random.hpp>
#include <Poco/NumberParser.h>
#include <IO/ReadHelpers.h>
#include <Poco/Exception.h>
#include <Common/Exception.h>
#include <Common/randomSeed.h>
@ -75,11 +75,11 @@ int mainImpl(int argc, char ** argv)
{
const char * file_name = 0;
int mode = MODE_NONE;
size_t min_offset = 0;
size_t max_offset = 0;
size_t block_size = 0;
size_t threads = 0;
size_t count = 0;
UInt64 min_offset = 0;
UInt64 max_offset = 0;
UInt64 block_size = 0;
UInt64 threads = 0;
UInt64 count = 0;
if (argc != 8)
{
@ -89,11 +89,11 @@ int mainImpl(int argc, char ** argv)
}
file_name = argv[1];
min_offset = Poco::NumberParser::parseUnsigned64(argv[3]);
max_offset = Poco::NumberParser::parseUnsigned64(argv[4]);
block_size = Poco::NumberParser::parseUnsigned64(argv[5]);
threads = Poco::NumberParser::parseUnsigned(argv[6]);
count = Poco::NumberParser::parseUnsigned(argv[7]);
min_offset = DB::parse<UInt64>(argv[3]);
max_offset = DB::parse<UInt64>(argv[4]);
block_size = DB::parse<UInt64>(argv[5]);
threads = DB::parse<UInt64>(argv[6]);
count = DB::parse<UInt64>(argv[7]);
for (int i = 0; argv[2][i]; ++i)
{

View File

@ -9,12 +9,12 @@ int main(int argc, char ** argv) { return 0; }
#include <iostream>
#include <iomanip>
#include <vector>
#include <Poco/NumberParser.h>
#include <Poco/Exception.h>
#include <Common/Exception.h>
#include <common/ThreadPool.h>
#include <Common/Stopwatch.h>
#include <IO/BufferWithOwnMemory.h>
#include <IO/ReadHelpers.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdlib.h>
@ -133,12 +133,12 @@ int mainImpl(int argc, char ** argv)
{
const char * file_name = 0;
int mode = MODE_READ;
size_t min_offset = 0;
size_t max_offset = 0;
size_t block_size = 0;
size_t buffers_count = 0;
size_t threads_count = 0;
size_t count = 0;
UInt64 min_offset = 0;
UInt64 max_offset = 0;
UInt64 block_size = 0;
UInt64 buffers_count = 0;
UInt64 threads_count = 0;
UInt64 count = 0;
if (argc != 9)
{
@ -149,12 +149,12 @@ int mainImpl(int argc, char ** argv)
file_name = argv[1];
if (argv[2][0] == 'w')
mode = MODE_WRITE;
min_offset = Poco::NumberParser::parseUnsigned64(argv[3]);
max_offset = Poco::NumberParser::parseUnsigned64(argv[4]);
block_size = Poco::NumberParser::parseUnsigned64(argv[5]);
threads_count = Poco::NumberParser::parseUnsigned(argv[6]);
buffers_count = Poco::NumberParser::parseUnsigned(argv[7]);
count = Poco::NumberParser::parseUnsigned(argv[8]);
min_offset = DB::parse<UInt64>(argv[3]);
max_offset = DB::parse<UInt64>(argv[4]);
block_size = DB::parse<UInt64>(argv[5]);
threads_count = DB::parse<UInt64>(argv[6]);
buffers_count = DB::parse<UInt64>(argv[7]);
count = DB::parse<UInt64>(argv[8]);
int fd = open(file_name, ((mode == MODE_READ) ? O_RDONLY : O_WRONLY) | O_DIRECT);
if (-1 == fd)

View File

@ -12,7 +12,7 @@
#include <vector>
#include <random>
#include <pcg_random.hpp>
#include <Poco/NumberParser.h>
#include <IO/ReadHelpers.h>
#include <Poco/Exception.h>
#include <Common/Exception.h>
#include <Common/randomSeed.h>
@ -34,11 +34,11 @@ int mainImpl(int argc, char ** argv)
{
const char * file_name = 0;
Mode mode = MODE_READ;
size_t min_offset = 0;
size_t max_offset = 0;
size_t block_size = 0;
size_t descriptors = 0;
size_t count = 0;
UInt64 min_offset = 0;
UInt64 max_offset = 0;
UInt64 block_size = 0;
UInt64 descriptors = 0;
UInt64 count = 0;
if (argc != 8)
{
@ -47,11 +47,11 @@ int mainImpl(int argc, char ** argv)
}
file_name = argv[1];
min_offset = Poco::NumberParser::parseUnsigned64(argv[3]);
max_offset = Poco::NumberParser::parseUnsigned64(argv[4]);
block_size = Poco::NumberParser::parseUnsigned64(argv[5]);
descriptors = Poco::NumberParser::parseUnsigned(argv[6]);
count = Poco::NumberParser::parseUnsigned(argv[7]);
min_offset = DB::parse<UInt64>(argv[3]);
max_offset = DB::parse<UInt64>(argv[4]);
block_size = DB::parse<UInt64>(argv[5]);
descriptors = DB::parse<UInt64>(argv[6]);
count = DB::parse<UInt64>(argv[7]);
if (!strcmp(argv[2], "r"))
mode = MODE_READ;