Merge branch 'master' of https://git.efi.th-nuernberg.de/gitea/yasarba71520/Line-Following-Robot
This commit is contained in:
commit
0b90a6b5ae
17
Socket/CMakeLists.txt
Normal file
17
Socket/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
project(lfr_socket VERSION 0.1.0)
|
||||
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
add_executable(lfr_socket lfr_socket.cpp)
|
||||
|
||||
target_link_libraries( lfr_socket Threads::Threads)
|
||||
|
||||
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
||||
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
||||
include(CPack)
|
18
Socket/lfr_socket.cpp
Normal file
18
Socket/lfr_socket.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "lfr_socket.h"
|
||||
#include <boost/regex.hpp>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string line;
|
||||
boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
|
||||
|
||||
while (std::cin)
|
||||
{
|
||||
std::getline(std::cin, line);
|
||||
boost::smatch matches;
|
||||
if (boost::regex_match(line, matches, pat))
|
||||
std::cout << matches[2] << std::endl;
|
||||
}
|
||||
}
|
3
Socket/lfr_socket.h
Normal file
3
Socket/lfr_socket.h
Normal file
@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
Loading…
x
Reference in New Issue
Block a user