- Notifications
You must be signed in to change notification settings - Fork3
mingsheng13/ip-input-ftxui
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
AFTXUI component to input IPv4 addresses
preview:
╭────────────────┬───────────╮│Input │Output │├────────────────┼───────────┤│192.168. 0 . 0 │192.168.0.0││255. 0 . 0 .255 │255.0.0.255│╰────────────────┴───────────╯
namespaceftxui { ComponentInputIPV4(StringRef content);}
See./example.
#include<string>#include"ftxui/component/component.hpp"#include"ftxui/component/screen_interactive.hpp"#include"ftxui/dom/elements.hpp"#include"ftxui-ip-input/ipv4.hpp"usingnamespaceftxui;intmain() { std::string ipv4 ="0.0.0.0";auto input =InputIPV4(&ipv4) | border;auto screen =ScreenInteractive::TerminalOutput(); screen.Loop(input);}
cmake_minimum_required (VERSION 3.14)project(my-app LANGUAGES CXXVERSION 1.0.0)include(FetchContent)FetchContent_Declare(ftxui GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui GIT_TAG v5.0.0)FetchContent_Declare(ftxui-ip-input GIT_REPOSITORY https://github.com/mingsheng13/ip-input-ftxui GIT_TAG main)FetchContent_MakeAvailable(ftxui)FetchContent_MakeAvailable(ftxui-ip-input)add_executable(my-app src/main.cpp)target_link_libraries(my-appPRIVATE ftxui-ip-input)