Cross-Platform Library

From WinMerge Development Wiki

Jump to: navigation, search

We need to choose a library we use as our base for future cross-platform work.

There are two strong libraries available:

STLSoft is lesser known portable library.

Note that wxWidgets or Qt are not listed. And won't be listed. They are frameworks that try to do it all, especially the GUI. One important thing for WinMerge is to divide GUI and backend. So that backend code can be used with other than those two libraries. So using more general library is what WinMerge needs.

Most important things we look for cross-platform library are:

  • filesystem interaction (fast search/enumeration is important for us)
  • threads
  • thread synchronization
  • sockets (not currently but we can't avoid in future)
  • XML (expat + SCEW is far from optimal, real DOM support would be nice..)
  • smart pointers

Contents

[edit] Boost

Boost is easiest to install with installer available from http://www.boostpro.com/products/free.

Boost is a set of C++ libraries. Some libraries are header-only (no .lib or .dll to link to. And some are dll files. Being C++ many libraries also have STL -like approach and provide iterators etc.

Some of the Boost libraries are implementation of the TR1 or proposed additions for next C++ standard.

[edit] APR

APR needs to be compiled from sources. Compiling instructions for Win32.

APR is one library (having several subcomponents) programmed with C. It was developed for Apache HTTP server but is nowadays used by other projects too (namely subversion). Due to the Apache Org lisence, it can be used with GPL program only as a library.

[edit] STLSoft

STLSoft is header-only library for C++. It mainly extends STL.

Main concern with STLSoft is its poor documentation. Another is its varying support for cross-platform - some parts are some are not.

"Good parts" (documented, cross-platform) of STLSoft look great however.

[edit] Comparison

Wanted Feature APR Boost STLSoft
filesystem interaction doc doc
threads and synchronization doc doc doc doc doc
sockets doc doc
XML doc in apr util No support
smart pointers No support doc?
APR Boost STLSoft
Pros
  • Widely used and tested in OSS
  • Can be used easily from C code (diffutils)
  • Lot of libraries in Boost are forward-compatible with the next versions of the STL (TR1 and next C++ standard)
Cons
  • Need to pass pool structures everywhere
  • Compilation and installation can be a pain because of different compilers/linkers
Personal tools
Ads: