File: http.hpp

package info (click to toggle)
polybar 3.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,108 kB
  • sloc: cpp: 30,424; python: 3,750; sh: 284; makefile: 83
file content (23 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include "common.hpp"
#include "utils/mixins.hpp"

POLYBAR_NS

class http_downloader : public non_copyable_mixin, public non_movable_mixin {
 public:
  http_downloader(int connection_timeout = 5);
  ~http_downloader();

  string get(const string& url, const string& user = "", const string& password = "");
  long response_code();

 protected:
  static size_t write(void* p, size_t size, size_t bytes, void* stream);

 private:
  void* m_curl;
};

POLYBAR_NS_END