Add QUVIOPT_NOSHORTENED support
[www-quvi.git] / Quvi.h
blob75621920e833f76262d408047c2c83cb197cbd99
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;
42 bool shortened;
45 class Link {
46 public:
47 Link ();
48 Link (quvi_video_t);
49 Link (const Link&);
50 Link& operator=(const Link&);
51 virtual ~Link();
52 private:
53 void _swap (const Link&);
54 public:
55 std::string content_type;
56 std::string file_suffix;
57 double length_bytes;
58 std::string url;
61 class Video {
62 public:
63 Video ();
64 Video (quvi_video_t);
65 Video (const Video&);
66 Video& operator=(const Video&);
67 virtual ~Video();
68 private:
69 void _swap (const Video&);
70 public:
71 std::string title;
72 std::string host;
73 std::string url;
74 std::string id;
75 Link link;
76 bool ok;
79 class Query {
80 public:
81 Query ();
82 Query (const Query&);
83 Query& operator=(const Query&);
84 virtual ~Query();
85 public:
86 Video parse (const std::string&, const Options&);
87 int next_website (std::string&, std::string&);
88 private:
89 void _init ();
90 void _close ();
91 private:
92 quvi_t _quvi;
93 void *_curl;
94 public:
95 std::string last_error;
96 long quvi_code;
97 long resp_code;
100 #endif