Difference between revisions of "Libzim"

Jump to navigation Jump to search
16 bytes added ,  19:08, 23 September 2014
m
formatting
(at least the old way does not work for me)
m (formatting)
Line 4: Line 4:


=== 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 ("./autogen.sh; ./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 41:


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.
2

edits

Navigation menu