Difference between revisions of "Zimlib"

Jump to navigation Jump to search
169 bytes added ,  09:12, 13 November 2016
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''zimlib''' is the standard implementation of the [[ZIM file format|ZIM specification]]. It is a library which implements the read and write method for ZIM files. The zimlib is released under the [https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPLv2 license terms]. Use the zimlib in your own software - like reader applications - to make them ZIM-capable without the need having to dig too much into the ZIM file format.
The '''zimlib''' is the standard implementation of the [[ZIM file format|ZIM specification]]. It is a library which implements the read and write method for ZIM files. The zimlib is released under the [https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPLv2 license terms]. Use the zimlib in your own software - like reader applications - to make them ZIM-capable without the need having to dig too much into the ZIM file format.
Have a look to the [[Releases]] or [[git]] pages to get more information about how to download it.


== Programming ==
== Programming ==


=== Introduction ===
=== Introduction ===  
zimlib is written in C++. To use the library, you need the include files of zimlib have to link against zimlib. Both are installed when zimlib is built with the normal "./configure; make; make install".
zimlib is written in C++. To use the library, you need the include files of zimlib have to link against zimlib. Both are installed when zimlib is built (<tt>./autogen.sh; ./configure; make; make install</tt>).


Errors are handled with exceptions. When something goes wrong, zimlib throws an error, which is always derived from std::exception.
Errors are handled with exceptions. When something goes wrong, zimlib throws an error, which is always derived from std::exception.
Line 41: Line 43:


You may save that file under the name "zimlist.cpp" and compile using the command:
You may save that file under the name "zimlist.cpp" and compile using the command:
'''g++ -o zimlist -lzim zimlist.cpp'''. You get a program, which lists the urls and titles of the file named ''wikipedia.zim''. Of course it is better to pass that name as a parameter in argc/argv. But this should be an easy task for you, so I do not show that.
'''<tt>g++ -o zimlist -lzim zimlist.cpp</tt>'''. You get a program, which lists the urls and titles of the file named ''wikipedia.zim''. Of course it is better to pass that name as a parameter in argc/argv. But this should be an easy task for you, so I do not show that.


In subsequent examples I show only the code needed to use the library. The main-function with the error catcher should always be in place.
In subsequent examples I show only the code needed to use the library. The main-function with the error catcher should always be in place.
Line 125: Line 127:
* [[zimdump]]
* [[zimdump]]
* [[Git|Get the source code]]
* [[Git|Get the source code]]
* in [https://tracker.debian.org/pkg/zimlib Debian]

Navigation menu