diff --git a/CMakeLists.txt b/CMakeLists.txt index d27ad5b..a8da514 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,12 +5,10 @@ set (HEADERS include/Telegram/PhotoSize.h include/Telegram/User.h include/Telegram/Chat.h - include/Telegram/exec.h include/Telegram/Location.h include/Telegram/std.h include/Telegram/Venue.h include/Telegram/Contact.h - include/Telegram/explode.h include/Telegram/MessageEntity.h include/Telegram/Sticker.h include/Telegram/Video.h @@ -27,12 +25,10 @@ set (SOURCES src/PhotoSize.cc src/User.cc src/Chat.cc - src/exec.cc src/Location.cc src/std.cc src/Venue.cc src/Contact.cc - src/explode.cc src/MessageEntity.cc src/Sticker.cc src/Video.cc @@ -66,4 +62,3 @@ target_link_libraries(tgbotpp ${LIBS}) install(TARGETS tgbotpp DESTINATION lib) install(FILES ${HEADERS} DESTINATION include/Telegram) install(FILES tgbotpp.pc DESTINATION "${INSTALL_PKGCONFIG_DIR}") - diff --git a/include/Telegram/exec.h b/include/Telegram/exec.h deleted file mode 100644 index 509a5a1..0000000 --- a/include/Telegram/exec.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __EXEC_H__ -#define __EXEC_H__ - -#include - -std::string exec(const char*); - -#endif diff --git a/include/Telegram/explode.h b/include/Telegram/explode.h deleted file mode 100644 index 2be65b3..0000000 --- a/include/Telegram/explode.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __explode_h__ -#define __explode_h__ - -#include -#include - -std::vector explode( const std::string&, const std::string &); - -#endif diff --git a/src/exec.cc b/src/exec.cc deleted file mode 100644 index 3b94c47..0000000 --- a/src/exec.cc +++ /dev/null @@ -1,21 +0,0 @@ -#include "Telegram/exec.h" - -#include -#include - -std::string exec(const char* cmd) { - - FILE* pipe = popen(cmd, "r"); - if (!pipe) - return "ERROR"; - - char buffer[128]; - std::string result = ""; - while (!feof(pipe)) { - if (fgets(buffer, 128, pipe) != NULL) - result += buffer; - } - pclose(pipe); - - return result; -} diff --git a/src/explode.cc b/src/explode.cc deleted file mode 100644 index 7477e5d..0000000 --- a/src/explode.cc +++ /dev/null @@ -1,28 +0,0 @@ -#include "Telegram/explode.h" - -std::vector explode( const std::string &delimiter, const std::string &str) { - - std::vector arr; - - int strleng = str.length(); - int delleng = delimiter.length(); - if (delleng == 0) - return arr;//no change - - int i = 0; - int k = 0; - while(i < strleng) { - int j = 0; - while ((i+j < strleng) && (j < delleng) && (str[i+j] == delimiter[j])) - j++; - if (j == delleng) { - arr.push_back(str.substr(k, i-k)); - i += delleng; - k = i; - } else { - i++; - } - } - arr.push_back(str.substr(k, i-k)); - return arr; -}