src/PlainFilesystemCommand.h
branchv_0
changeset 57 c40a241d6e0c
parent 54 ef726975c34b
child 58 4679f67a8324
equal deleted inserted replaced
56:81a53e7cf0ab 57:c40a241d6e0c
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    16  */
    16  */
    17 #pragma once
    17 #pragma once
    18 
    18 
       
    19 #include <ext/stdio_filebuf.h>
       
    20 
    19 #include "FilesystemCommand.h"
    21 #include "FilesystemCommand.h"
    20 
    22 
    21 namespace relpipe {
    23 namespace relpipe {
    22 namespace in {
    24 namespace in {
    23 namespace filesystem {
    25 namespace filesystem {
    29 private:
    31 private:
    30 	std::map<string_t, std::shared_ptr<AttributeFinder>> attributeFinders = createAttributeFinders();
    32 	std::map<string_t, std::shared_ptr<AttributeFinder>> attributeFinders = createAttributeFinders();
    31 
    33 
    32 public:
    34 public:
    33 
    35 
    34 	void process(std::istream& input, std::ostream& output, Configuration& configuration) {
    36 	void process(int inputFD, int outputFD, Configuration& configuration) {
       
    37 		__gnu_cxx::stdio_filebuf<char> inputBuffer(inputFD, std::ios::in);
       
    38 		__gnu_cxx::stdio_filebuf<char> outputBuffer(outputFD, std::ios::out);
       
    39 		std::istream input(&inputBuffer);
       
    40 		std::ostream output(&outputBuffer);
       
    41 
    35 		std::shared_ptr<RelationalWriter> writer(Factory::create(output));
    42 		std::shared_ptr<RelationalWriter> writer(Factory::create(output));
    36 
    43 
    37 		string_t relationName = configuration.relation.empty() ? L"filesystem" : configuration.relation;
    44 		string_t relationName = configuration.relation.empty() ? L"filesystem" : configuration.relation;
    38 
    45 
    39 		std::vector<AttributeMetadata> attributesMetadata;
    46 		std::vector<AttributeMetadata> attributesMetadata;