paragraph.cpp
functional
sstream
string
utility
ftxui/dom/elements.hpp
ftxui/dom/flexbox_config.hpp
ftxui/dom/canvas.hpp
ftxui/dom/deprecated.hpp
ftxui/dom/direction.hpp
ftxui/dom/elements.hpp
ftxui/dom/flexbox_config.hpp
ftxui/dom/linear_gradient.hpp
ftxui/dom/node.hpp
ftxui/dom/requirement.hpp
ftxui/dom/selection.hpp
ftxui/screen/box.hpp
ftxui/screen/color.hpp
ftxui/screen/image.hpp
ftxui/screen/pixel.hpp
ftxui/screen/screen.hpp
ftxui/screen/string.hpp
ftxui/screen/terminal.hpp
ftxui/util/autoreset.hpp
ftxui/util/ref.hpp
src/ftxui/dom/paragraph.cpp
cstddef
cstdint
ftxui/dom/take_any_args.hpp
functional
memory
optional
sstream
string
unordered_map
utility
variant
vector
ftxui

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<functional>//forfunction
    #include<sstream>//forbasic_istream,stringstream
    #include<string>//forstring,allocator,getline
    #include<utility>//formove

    #include"ftxui/dom/elements.hpp"//forflexbox,Element,text,Elements,operator|,xflex,paragraph,paragraphAlignCenter,paragraphAlignJustify,paragraphAlignLeft,paragraphAlignRight
    #include"ftxui/dom/flexbox_config.hpp"//forFlexboxConfig,FlexboxConfig::JustifyContent,FlexboxConfig::JustifyContent::Center,FlexboxConfig::JustifyContent::FlexEnd,FlexboxConfig::JustifyContent::SpaceBetween

    namespaceftxui{

    namespace{
    ElementsSplit(conststd::string&the_text){
    Elementsoutput;
    std::stringstreamss(the_text);
    std::stringword;
    while(std::getline(ss,word,'')){
    output.push_back(text(word));
    }
    returnoutput;
    }

    ElementSplit(conststd::string&paragraph,
    conststd::function<Element(std::string)>&f){
    Elementsoutput;
    std::stringstreamss(paragraph);
    std::stringline;
    while(std::getline(ss,line,'\n')){
    output.push_back(f(line));
    }
    returnvbox(std::move(output));
    }

    }//namespace

    ///@briefReturnanelementdrawingtheparagraphonmultiplelines.
    ///@ingroupdom
    ///@seeflexbox.
    Elementparagraph(conststd::string&the_text){
    returnparagraphAlignLeft(the_text);
    }

    ///@briefReturnanelementdrawingtheparagraphonmultiplelines,alignedon
    ///theleft.
    ///@ingroupdom
    ///@seeflexbox.
    ElementparagraphAlignLeft(conststd::string&the_text){
    returnSplit(the_text,[](conststd::string&line){
    staticconstautoconfig=FlexboxConfig().SetGap(1,0);
    returnflexbox(Split(line),config);
    });
    };

    ///@briefReturnanelementdrawingtheparagraphonmultiplelines,alignedon
    ///theright.
    ///@ingroupdom
    ///@seeflexbox.
    ElementparagraphAlignRight(conststd::string&the_text){
    returnSplit(the_text,[](conststd::string&line){
    staticconstautoconfig=FlexboxConfig().SetGap(1,0).Set(
    FlexboxConfig::JustifyContent::FlexEnd);
    returnflexbox(Split(line),config);
    });
    }

    ///@briefReturnanelementdrawingtheparagraphonmultiplelines,alignedon
    ///thecenter.
    ///@ingroupdom
    ///@seeflexbox.
    ElementparagraphAlignCenter(conststd::string&the_text){
    returnSplit(the_text,[](conststd::string&line){
    staticconstautoconfig=
    FlexboxConfig().SetGap(1,0).Set(FlexboxConfig::JustifyContent::Center);
    returnflexbox(Split(line),config);
    });
    }

    ///@briefReturnanelementdrawingtheparagraphonmultiplelines,aligned
    ///usingajustifiedalignment.
    ///thecenter.
    ///@ingroupdom
    ///@seeflexbox.
    ElementparagraphAlignJustify(conststd::string&the_text){
    returnSplit(the_text,[](conststd::string&line){
    staticconstautoconfig=FlexboxConfig().SetGap(1,0).Set(
    FlexboxConfig::JustifyContent::SpaceBetween);
    Elementswords=Split(line);
    words.push_back(text("")|xflex);
    returnflexbox(std::move(words),config);
    });
    }

    }//namespaceftxui