[ion] Add a host command-line utility to filter valid events

Change-Id: Iaaa26ebf079152592a973c1f4658caa00f3f0651
This commit is contained in:
Romain Goyet
2017-05-01 16:01:35 +02:00
parent fcd01a9655
commit d0988f6f09
3 changed files with 19 additions and 2 deletions

View File

@@ -4,12 +4,12 @@ ifdef GIT
PATCH_LEVEL = `git rev-parse HEAD`
endif
SFLAGS += -Iion/include -DKD_CONFIG_H=1
ion/src/shared/software_version.o: SFLAGS += -DPATCH_LEVEL=$(PATCH_LEVEL) -DVERSION=$(VERSION)
include ion/src/$(PLATFORM)/Makefile
include ion/src/shared/tools/Makefile
objs += $(addprefix ion/src/shared/, \
events.o \
software_version.o \

View File

@@ -0,0 +1,5 @@
ion/src/shared/tools/event_%: ion/src/shared/tools/event_%.cpp ion/src/shared/events.cpp
@echo "HOSTCXX $@"
@$(HOSTCXX) -std=c++11 -Iion/include $^ -o $@
products += $(addprefix ion/src/shared/tools/, event_filter event_generator)

View File

@@ -0,0 +1,12 @@
#include <iostream>
#include <ion/events.h>
int main(int argc, char * argv[]) {
char c;
while (std::cin.get(c)) {
Ion::Events::Event e(c);
if (e.isValid()) {
std::cout.put(c);
}
}
}