Apply astyle
[www-quvi.git] / Quvi.h
blob30c4194ffc27282de3645c5f21990181e0250ef4
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
30 public:
31 Options ();
32 Options (const Options&);
33 Options& operator=(const Options&);
34 virtual ~Options();
35 private:
36 void _swap (const Options&);
37 public:
38 std::string user_agent;
39 std::string http_proxy;
40 bool verbose_libcurl;
41 std::string format;
42 bool verify;
43 bool shortened;
44 long category;
47 class Link
49 public:
50 Link ();
51 Link (quvi_video_t);
52 Link (const Link&);
53 Link& operator=(const Link&);
54 virtual ~Link();
55 private:
56 void _swap (const Link&);
57 public:
58 std::string content_type;
59 std::string file_suffix;
60 double length_bytes;
61 std::string url;
64 class Video
66 public:
67 Video ();
68 Video (quvi_video_t);
69 Video (const Video&);
70 Video& operator=(const Video&);
71 virtual ~Video();
72 private:
73 void _swap (const Video&);
74 public:
75 std::string title;
76 std::string host;
77 std::string url;
78 std::string id;
79 Link link;
80 bool ok;
83 class Query
85 public:
86 Query ();
87 Query (const Query&);
88 Query& operator=(const Query&);
89 virtual ~Query();
90 public:
91 Video parse (const std::string&, const Options&);
92 int next_website (std::string&, std::string&);
93 private:
94 void _init ();
95 void _close ();
96 private:
97 quvi_t _quvi;
98 void *_curl;
99 public:
100 std::string last_error;
101 long quvi_code;
102 long resp_code;
105 #endif