Update gitignore
[www-quvi.git] / Quvi.h
blobaa992fbe6a336cabb7917836fd917c4d9b29d07c
1 /* WWW::Quvi
2 * Copyright (C) 2010,2011 Toni Gundogdu <legatvs@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA
20 #ifndef Quvi_h
21 #define Quvi_h
23 #include <quvi/quvi.h>
25 class Options;
26 class Query;
27 class Video;
28 class Link;
30 class Options
32 public:
33 Options ();
34 Options (const Options&);
35 Options& operator=(const Options&);
36 virtual ~Options();
37 private:
38 void _swap (const Options&);
39 public:
40 std::string user_agent;
41 std::string http_proxy;
42 bool verbose_libcurl;
43 std::string format;
44 bool verify;
45 bool shortened;
46 long category;
49 class Link
51 public:
52 Link ();
53 Link (quvi_video_t);
54 Link (const Link&);
55 Link& operator=(const Link&);
56 virtual ~Link();
57 private:
58 void _swap (const Link&);
59 public:
60 std::string content_type;
61 std::string file_suffix;
62 double length_bytes;
63 std::string url;
66 class Video
68 public:
69 Video ();
70 Video (quvi_video_t);
71 Video (const Video&);
72 Video& operator=(const Video&);
73 virtual ~Video();
74 private:
75 void _swap (const Video&);
76 public:
77 std::string title;
78 std::string host;
79 std::string url;
80 std::string id;
81 Link link;
82 bool ok;
85 class Query
87 public:
88 Query ();
89 Query (const Query&);
90 Query& operator=(const Query&);
91 virtual ~Query();
92 public:
93 Video parse (const std::string&, const Options&);
94 int next_website (std::string&, std::string&);
95 private:
96 void _init ();
97 void _close ();
98 private:
99 quvi_t _quvi;
100 void *_curl;
101 public:
102 std::string last_error;
103 long quvi_code;
104 long resp_code;
107 #endif
109 // vim: set ts=2 sw=2 tw=72 expandtab: