== Programming ==
=== Introduction ===zimlib is written in C++. To use the library, you need the include files of zimlib have to link against
libzim. Both are installed when zimlib is built with the normal "./configure; make; make install ".
Errors are handled with exceptions. When something goes wrong, zimlib throws an error, which is always derived from std::exception.
int main(int argc, char* argv)
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.
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.
The method zim::Search::search implements a full text search. For that it needs the full text index file. The full text index file is also a zim file, so you pass the index file as second paramter of type zim::File. The search-method is then called with the SearchResults-reference and a string, containing a space delimited list of words. The full text search then returns a list of articles where at least one of the words is found. Each article is weighted and the result is sorted by weight starting with the highest weighted article.
== Methods ==
returns an URL-decoded string for use in findx()
If you compile the software from source you need the following libraries installed: