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
22 %include
"std_string.i"
23 %include
"exception.i"
32 static char
*_VERSION
= VERSION
;
35 libquviVersion
= QUVI_VERSION
,
36 libquviVersionLong
= QUVI_VERSION_LONG
,
40 static char
* version
(quviVersion n
=ModuleVersion
) {
41 if
(n
== ModuleVersion
) return _VERSION
;
42 return quvi_version
(static_cast
<QUVIversion
>(n
));
46 * A manual copy of QUVIcode. If there's a better way to do this
,
47 * I'd like to know it too. This will need to be maintained manually
48 * if there are any changes to the QUVIcode enum list in quvi.h file.
50 * The reason we don't simply
"%include <quvi/quvi.h>" and
51 * get the constants is because that would clutter the wrapper.
53 * We have renamed the constants to avoid any conflicts with those
54 * defined in
<quvi
/quvi.h
> which is included by the wrapper.
69 IconvError
, /* QUVI_ICONV
*/
70 LuaError
, /* QUVI_LUA
*/
78 ProtoAll
= (ProtoHttp|ProtoMms|ProtoRtsp|ProtoRtmp
)
87 std
::string user_agent
;
88 std
::string http_proxy
;
101 std
::string thumbnail_url
;
102 std
::string content_type
;
103 std
::string file_suffix
;
104 std
::string start_time
;
105 std
::string page_title
;
106 double content_length
;
107 std
::string page_url
;
114 /* Query
::_init throws std
::runtime_error if quvi_init fails.
*/
118 catch
(const std
::runtime_error
& e)
119 { SWIG_exception
(SWIG_RuntimeError
, e.what
()); }
122 %apply std
::string
&OUTPUT { std::string &domain, std::string &formats };
129 void next_website
(std
::string
&domain, std::string &formats);
130 std
::string formats
(const std
::string
&);
131 int supported
(const std
::string
&);
132 Media parse
(const std
::string
&);
133 void set_opts
(const Options
&);