Makefile.PL:ExtUtils::PkgConfig, ExtUtils::Depends
[www-quvi.git] / Quvi.h
blob453a0f1c510c0d0bc3a3e962e7efb46276fc68ec
1 /*
2 * Copyright (C) 2010 Toni Gundogdu.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef Quvi_h
19 #define Quvi_h
21 #include <quvi/quvi.h>
23 class Options;
24 class Query;
25 class Video;
26 class Link;
28 class Options {
29 public:
30 Options ();
31 Options (const Options&);
32 Options& operator=(const Options&);
33 virtual ~Options();
34 private:
35 void _swap (const Options&);
36 public:
37 std::string user_agent;
38 std::string http_proxy;
39 bool verbose_libcurl;
40 std::string format;
41 bool verify;
44 class Link {
45 public:
46 Link ();
47 Link (quvi_video_t);
48 Link (const Link&);
49 Link& operator=(const Link&);
50 virtual ~Link();
51 private:
52 void _swap (const Link&);
53 public:
54 std::string content_type;
55 std::string file_suffix;
56 double length_bytes;
57 std::string url;
60 class Video {
61 public:
62 Video ();
63 Video (quvi_video_t);
64 Video (const Video&);
65 Video& operator=(const Video&);
66 virtual ~Video();
67 private:
68 void _swap (const Video&);
69 public:
70 std::string title;
71 std::string host;
72 std::string url;
73 std::string id;
74 Link link;
75 bool ok;
78 class Query {
79 public:
80 Query ();
81 Query (const Query&);
82 Query& operator=(const Query&);
83 virtual ~Query();
84 public:
85 Video parse (const std::string&, const Options&);
86 int next_website (std::string&, std::string&);
87 private:
88 void _init ();
89 void _close ();
90 private:
91 quvi_t _quvi;
92 void *_curl;
93 public:
94 std::string last_error;
95 long quvi_code;
96 long resp_code;
99 #endif