The ZooLib C++ Cross-Platform
ZooLib allows you build native applications for a variety of platforms and
processors from a single code base, with little need for platform-specific source.
In the rare event non-portable code becomes necessary, it is simple and easy to include
it inline via conditional compilation, using one of the provided preprocessor symbols.
It was released as Open Source
software under the MIT License in the Fall of 2000.
ZooLib was originally developed as a proprietary library starting in 1990 by Andrew Green of
The Electric Magic Company and
Learning in Motion, with the help of the
Ontario Institute for Studies in Education
of the University of Toronto.
What is ZooLib?
You don't need to link in everything to write a ZooLib application;
only the mutex, threads, and reference counted smart pointers (ZRef template) are
required to make a minimal ZooLib application. For example, you could use only the
networking classes to make a network daemon with no UI, or maybe a database server
if you also included the database classes.
- ZooLib applications are multithreaded, with platform-independent
thread and mutex classes.
- It provides a graphical user
interface toolbox with a uniquely flexible layout method.
- The GUI widgets are drawn by platform-specific renderers, so
Mac apps look like native Mac apps, and
similarly for Windows. There is even a switchable renderer that calls through to the
real ones so you can change look and feel at runtime for testing and demonstration.
On the Macintosh, the Appearance Manager is used to render widgets if it is available.
- It provides useful classes such as thread-safe reference counted smart pointers.
- There is
a lightweight database file format, in which the databases are completely
contained in single files so they can serve as end-user documents, for
example to allow a user to email a database file to a friend who can
then double-click it to open it in an editor.
- It provides file access - file open and save dialogs that filter according to
platform style (three letter extension on Windows, file type on Mac OS X), file references
and classes for accessing open files.
- Streams which may be linked to various data sources and sinks (files, the network,
memory, etc.) and to each other to create filters.
- It provides TCP networking.
- It has extensive debugging support - debugging functions and
macros, assertions in frequently used core components, and a debugging
- The ZooLib header files define several handy preprocessor macros
that allow you to easily use the C preprocessor to break out to
OS-specific code in the rare instances it is necessary, or when you're
using an API whose functionality is not provided directly within ZooLib.
In a few cases where it makes sense, certain classes are only provided
for one platform, or
variants with different names or different signatures are provided for the
ZooLib requires only very basic support from the underlying operating system and
user interface layer. Because of this, and because the platform-specific layer in
ZooLib is so well architected, an expert programmer could bind ZooLib to a totally
new platform in a few weeks once he or she was familiar with ZooLib internals.
Getting the ZooLib Source Code
ZooLib is presently transitioning from SourceForge's CVS revision control system to
Subversion. But it is being extensively refactored at the same time so the current Subversion
code is not yet ready for production use.
You can obtain the current production source code via anonymous CVS:
ZooLib requires only very basic support from its host operating system. It's best if
threading and atomic arithmetic are available, but ZooLib provides fallbacks for the cases where