0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LoadDataSourceStdin.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
22 #include "Common/Compat.h"
23 #include <fstream>
24 #include <iostream>
25 #include <cerrno>
26 #include <cctype>
27 #include <cstdlib>
28 #include <cstring>
29 
30 #include <boost/algorithm/string.hpp>
31 #include <boost/algorithm/string/predicate.hpp>
32 #include <boost/iostreams/filter/gzip.hpp>
33 #include <boost/shared_array.hpp>
34 
35 extern "C" {
36 #include <strings.h>
37 #include <sys/types.h>
38 #include <unistd.h>
39 }
40 
41 #include "Common/DynamicBuffer.h"
42 #include "Common/Error.h"
43 #include "Common/Logger.h"
44 
45 #include "Key.h"
46 
47 #include "LoadDataSourceStdin.h"
48 
49 using namespace boost::iostreams;
50 using namespace Hypertable;
51 using namespace std;
52 
56 LoadDataSourceStdin::LoadDataSourceStdin(const string &header_fname,
57  int row_uniquify_chars, int load_flags)
58  : LoadDataSource(header_fname, row_uniquify_chars, load_flags) {
59 
60  m_zipped = false;
61 }
62 
63 void
65 {
66  m_fin.push(std::cin);
67  m_source_size = 0;
68 }
69 
73 uint64_t
75 {
76  return 0;
77 }
78 
STL namespace.
A dynamic, resizable memory buffer.
boost::iostreams::filtering_istream m_fin
Logging routines and macros.
Compatibility Macros for C/C++.
Hypertable definitions
Error codes, Exception handling, error logging.