1
0
Fork 0
mirror of https://gitlab.com/niansa/qcommsy.git synced 2025-03-06 20:53:33 +01:00

Added libCommsyLowlevel namespace

This commit is contained in:
niansa 2020-11-11 17:42:35 +01:00
parent 9b200f79c1
commit f9b56f2f36
4 changed files with 9 additions and 1 deletions

View file

@ -22,7 +22,8 @@ SOURCES += \
HEADERS += \ HEADERS += \
libcommsy.hpp \ libcommsy.hpp \
libcommsyauth.hpp libcommsyauth.hpp \
libcommsylowlevel.hpp
FORMS += \ FORMS += \
failure.ui \ failure.ui \

View file

@ -188,6 +188,7 @@ std::string gumbo_find_text_by_tag(GumboNode *node, const GumboTag& searchtag) {
} }
namespace libCommsyLowlevel {
auto get_posts(GumboNode *node) { auto get_posts(GumboNode *node) {
std::vector<GumboNode *> posts; std::vector<GumboNode *> posts;
gumbo_search_by_class(&posts, node, "uk-comment", GUMBO_TAG_ARTICLE); gumbo_search_by_class(&posts, node, "uk-comment", GUMBO_TAG_ARTICLE);
@ -314,8 +315,10 @@ std::string get_post_desc(const std::string& post_url, const std::string& server
// Return first occurence // Return first occurence
return result_string; return result_string;
} }
};
using namespace libCommsyLowlevel;
// Class functions // Class functions
bool libCommsy::postExists(unsigned long postID) { bool libCommsy::postExists(unsigned long postID) {
return postID < numposts; return postID < numposts;

View file

@ -68,3 +68,7 @@ public:
class descDownloadError {}; class descDownloadError {};
class scrapError {}; class scrapError {};
}; };
namespace libCommsyLowlevel {
std::string get_post_desc(const std::string& post_url, const std::string& server_sid);
}

0
libcommsylowlevel.hpp Normal file
View file