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 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
((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.
67 PcreError
= 0x40, /* QUVI_PCRE
*/
69 CurlError
, /* QUVI_CURL
*/
70 IconvError
, /* QUVI_ICONV
*/
71 LuaError
, /* QUVI_LUA
*/
79 ProtoAll
= (ProtoHttp|ProtoMms|ProtoRtsp|ProtoRtmp
)
88 std
::string user_agent
;
89 std
::string http_proxy
;
102 std
::string content_type
;
103 std
::string file_suffix
;
121 /* Query
::_init throws std
::runtime_error if quvi_init fails.
*/
125 catch
(const std
::runtime_error
& e)
126 { SWIG_exception
(SWIG_RuntimeError
, e.what
()); }
129 %apply std
::string
&OUTPUT { std::string &domain, std::string &formats };
136 Video parse
(const std
::string
&, const Options&);
137 int next_website
(std
::string
&domain, std::string &formats);
140 std
::string last_error
;