What is Cgipp?

Cgipp is a small class library which eases the creation of applications for the World Wide Web, and gives you an easy but powerful interface to the CGI interface which will increase your productivity when writing CGI-applications. The Cgipp also provides a class to ease your creation of HTML-pages which can be used as any ostream.

The Cgipp Library has five classes (detailed in the documentation):

  • Cgipp(PS) - The main-class which has all the data
  • CgiEnv(PS) - Keeps track of the CGI-Environment
  • DebugTool - ofstream meant for debugging (see test.cpp and cgi/Debug.H for details)
  • htmlTool(PS) - Extends ostream with HTML methods
  • Toolbox(PS) - Very useful tools for CGI-Programming

    Advantages when using Cgipp is among other things:
  • Parses GET and POST transparently and your application will work equally well whatever method is used.
  • Gives you a multitude of flexible methods to get the form input in the class CgiData.
  • Very good HTML support in the class htmlTool which lets you do things easily:
    htmlTool doc;
    doc.printHeader(); // The proper HTTP header needed
    doc.title("Small Example");
    doc.h1("My large header");
    doc << "Some text in your document ended by a linebreak" << br;
    doc << li << "list item one" << endl;
    doc << li << "list item two" << endl;
    doc << "And now a ruler:" << hr;
  • Fully compatible with both LEDA and STL
  • It is a very portable library which can be used on a variety of platforms (several unix flavours and even pcs) with a large number of servers where it works flawlessly. This also means that your application may be used on all of these platforms, which most certainly is of commercial interest (write once, use many).
    Why use C++ in CGI applications?

    It is generally fast, efficient and one of the most powerful languages around. Some use C++ as an extended and/or easier C with better typechecking and ADT's. Others use C++ in an object-oriented fashion with all the advantages OO gives you at almost the same speed as a C program. Using C++ also gives you access to a wealth of good class libraries, and good class libraries are something which is alpha-omega in larger systems. Many cgi-programs are also just interfaces to already existing C++ systems, and having a C++ and OO CGI-interface also eases the communication with your other objects.

    Why use Cgipp?

    Cgipp provides an easy-to-use interface to the Common Gateway Interface, and has small classes which may be used easily in any C++ application. It currently is only tested with g++ and Borland C++ 4.5 , but it should be possible to use it on virtually any C++ compiler with iostreams. This class library does not require exception handling, template support, nor RTTI, which all in all makes it much more portable. When developing software for the Web, you'll often need the same program working on a multitude of platforms and web servers and Cgipp has been tested on several unix flavours and on Win95/MS-DOS (16-bit and 32-bit). I have yet to test it on NT but I presume it will work equally well.

    What do I need to use Cgipp?

    Cgipp has been tested with gcc 2.7.x and libg++ 2.7.x and should work on all platforms with this compiler. It has also been tested with Borland C++ 4.5 (both 16 bit and 32 bit). It has also been heavily tested with SGI C++ for IRIX 6.3. We all know that there are subtle differences between the different unix flavours so it MAY not work straight away on your machine even if you have gcc/libg++ but the use of autoconf reduces the probability of anything mysterious happening. The same applies to PCs with different compilers (I do not have access to other compilers on PCs so I have no way to further test PC compability). If you experience problems, let me know right away so we might fix it and include that compiler/platform in the upcoming releases. I (and my happy betatesters) have succesfully tested and used the Cgipp library on the following platforms/OSs:

  • IRIX 5.3 (gcc/g++ (yuck!))
  • IRIX 6.3 (SGI C++)
  • SunOS 4.1.x (gcc/g++)
  • Solaris 2.x (gcc/g++ and CC)
  • DEC OSF/1 and Digital Unix (gcc/g++)
  • Linux 1.2.13 (Slackware 3.0) (gcc/g++)
  • MS-DOS 16-bit (bcc)
  • MS-DOS 32-bit (bcc32)

    The Cgipp library has communicated with no apparent problems with the following servers:

  • Apache (your best bet)
  • CERN
  • NCSA
  • Netscape (sucks shite!)
  • Netscape Fasttrack (sucks shite!)
  • Website (cgi-dos and cgi-shl under Win95)

    Cgipp does unlike Cgicc not require exception-handling. To have a portable library where your programs have a chance of getting somewhere is just not possible with exception-handling in gcc so far. The macro-errorhandling system I use gives you more information than the exceptions did, and does IMVHO a better job.

    Where has Cgipp been tested?

    The library has been tested on the platforms, servers and compilers mentioned above. It has also been tested and used in many applications on many sites, among them:

  • The Legendary Dragonlands - [also uses an extra toolbox] most if not all of the site is run by approx. 20-30 programs and provides one of the most impressive sights on Web. (Version 0.1, not upgraded)
  • Nordlandsposten, a norwegian paper's interactive pages and news on web. (Version 0.1, not upgraded)
  • DALI/AHAD, Digital Art Learning Interface/A Hack of an Art Databse. (several large applications) This system is used for exhibitions, both on Web and in museums. This is a system praised by Silicon Graphics, several national newspapers in Norway and practically all of the cultural elite of Norway. It's breakthrough is the exhibition at the Kunstindustrimuseum in Oslo this fall, and is an exhibition which should be visited. (Version 0.2, will not be upgraded)
  • SDS, Software Development System, a 'pretty large' (8k++ LOC) system developed as a programming project which used Cgipp for it's Web-GUI until it's creator grew tired of GUIs.. (Version 0.1)