diff --git a/handler/textPacketHandler.hpp b/handler/textPacketHandler.hpp index ad6a999..dff2884 100644 --- a/handler/textPacketHandler.hpp +++ b/handler/textPacketHandler.hpp @@ -7,18 +7,7 @@ #include #include #include - -std::vector split(const std::string& s, char delimiter) -{ - std::vector tokens; - std::string token; - std::istringstream tokenStream(s); - while (std::getline(tokenStream, token, delimiter)) - { - tokens.push_back(token); - } - return tokens; -} +#include "../helper/split.hpp" uint64_t convertStringToTimestampMicros(std::string textTimestamp){ uint64_t timestamp; @@ -63,7 +52,7 @@ void textPacketHandler(std::vector textPacket){ std::string textTimestamp = headerData[0]; uint64_t timestamp = convertStringToTimestampMicros(textTimestamp); - + } #endif /* EE781A91_6D07_47AC_B3C4_F99E29F3731F */ diff --git a/helper/split.hpp b/helper/split.hpp new file mode 100644 index 0000000..e39d718 --- /dev/null +++ b/helper/split.hpp @@ -0,0 +1,16 @@ +#ifndef F7CFE6A7_34BF_4E04_94CF_DB8374980631 +#define F7CFE6A7_34BF_4E04_94CF_DB8374980631 + +std::vector split(const std::string& s, char delimiter) +{ + std::vector tokens; + std::string token; + std::istringstream tokenStream(s); + while (std::getline(tokenStream, token, delimiter)) + { + tokens.push_back(token); + } + return tokens; +} + +#endif /* F7CFE6A7_34BF_4E04_94CF_DB8374980631 */