diff options
author | Nao Pross <naopross@thearcway.org> | 2017-11-26 23:36:26 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2017-11-26 23:36:26 +0100 |
commit | 7f7e6fe30ef4f9ba4507b89174676f57c42c0000 (patch) | |
tree | d6fc1ae62972568a1021c940f372903cda57cceb /src/main.cpp | |
parent | First commit (diff) | |
download | OrbitingYeti-7f7e6fe30ef4f9ba4507b89174676f57c42c0000.tar.gz OrbitingYeti-7f7e6fe30ef4f9ba4507b89174676f57c42c0000.zip |
Implementation for Structogram iterator and Statement type
The interator is not (yet) aware of the scope in which it is iterating.
Diffstat (limited to '')
-rw-r--r-- | src/main.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 5ea2172..7f70de6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,10 +1,28 @@ -#include "diagram/Structogram.h" +#include "diagram/Structogram.hpp" +#include "diagram/Statement.hpp" +#include "ui/AsciiRenderer.hpp" + #include <iostream> -#include "ui/AsciiRenderer.h" +#include <memory> + +using namespace samb; int main(int argc, char *argv[]) { - samb::Structogram st("Demo"); - samb::AsciiRenderer renderer(st, 60); + Structogram st("Demo"); + AsciiRenderer renderer(st, 60); + + Structogram::iterator it = st.begin(); + + auto first = Statement::makeStatement(Statement::Type::PROCESS); + first->text = "Hello World"; + + auto second = Statement::makeStatement(Statement::Type::PROCESS); + second->text = "Hello World Again!"; + + st.insert_after(it, first); + ++it; + + st.insert_after(it, second); renderer.render(); |