Skip to content
Snippets Groups Projects
Commit 04609c33 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

add string output file specification

parent 4acfd235
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -3,6 +3,8 @@
#include <exception/CommonException.h>
 
#include <registry/XmlRegistry.h>
#include <registry/StringWriterRegistry.hpp>
#include <abstraction/ImmediateValueAbstraction.hpp>
#include <abstraction/XmlTokensComposerAbstraction.hpp>
#include <abstraction/PackingAbstraction.hpp>
......@@ -33,7 +35,27 @@ namespace {
return abstraction::Registry::getAlgorithmAbstraction ( "cli::builtin::WriteFile", templateParams, paramTypes, category );
}
 
std::shared_ptr < abstraction::OperationAbstraction > dummy3 ( const std::string & typehint ) {
ext::vector < std::shared_ptr < abstraction::OperationAbstraction > > abstractions;
abstractions.push_back ( abstraction::StringWriterRegistry::getAbstraction ( typehint ) );
ext::vector < std::string > templateParams;
ext::vector < std::string > paramTypes { ext::to_string < std::string > ( ), ext::to_string < std::string > ( ) };
abstraction::AlgorithmCategories::AlgorithmCategory category = abstraction::AlgorithmCategories::AlgorithmCategory::NONE;
abstractions.push_back ( abstraction::Registry::getAlgorithmAbstraction ( "cli::builtin::WriteFile", templateParams, paramTypes, category ) );
std::shared_ptr < abstraction::PackingAbstraction < 2 > > res = std::make_shared < abstraction::PackingAbstraction < 2 > > ( std::move ( abstractions ), 1 );
res->setInnerConnection ( 0, 1, 1, true );
res->setOuterConnection ( 0, 1, 0 ); // filename
res->setOuterConnection ( 1, 0, 0 ); // data
return res;
}
auto xmlOutputFileHandler = registration::OutputFileRegister ( "xml", dummy );
auto fileInputFileHandler = registration::OutputFileRegister ( "file", dummy2 );
auto fileOutputFileHandler = registration::OutputFileRegister ( "file", dummy2 );
auto stringOutputFileHandler = registration::OutputFileRegister ( "string", dummy3 );
 
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment