26 Sep, 2008, Caius wrote in the 1st comment:
Votes: 0
I've just uploaded TableGenerator to the code repository. It is a library written in C++ that makes it fast and easy to generate fancy looking tables that resizes itself to the data it holds on the fly. I've used it in my mud project for a while, but I decided to package it up and upload it. Perhaps someone else will find it useful.

It comes with four table layouts, all configurable. These are SimpleTable (a plain, no nonse table), FramedTable (with frames, obviuosly, with configurable colours and ascii graphics), the Space3Table (designed for a very specific purpose, it's not not very configurable), and finally the glorious ShadowTable, which has solid background colour and a drop shadow, much like ncurses console programs and similar.

It does not interpret colour tokens, it merely inserts them, so you can use whatever colour scheme your mud has. It compiles as a shared library (optionally as static link library, check the README). You need a C++ mud to use this, or at least a mud that can be compiled as C++. SmaugFUSS 1.9 has been tested successfully.

So again, I hope someone will find it useful.
02 Oct, 2008, ghasatta wrote in the 2nd comment:
Votes: 0
Neat! This looks cool, thanks for sharing your work.

Two things:
1. make test fails because of a typo
ifdef LINK_SHARED_LIBRARY
$(CXX) -otest test.cpp -L. -ltablegenerator -O2 -Wl,-rpath,.
else
$(CXX) -otest test.cpp -L. -ltablegenerator -O2
endif


Should be a space between '-o' and 'test', like so:
$(CXX) -o test test.cpp -L. -ltablegenerator -O2 -Wl,-rpath,.


2. I would suggest putting your classes into a namespace. This will help prevent any conflicting class names and also make it easier (for people like me 8) ) to write code that is easy to follow. I prefer to use namespaces to refer to library classes so that it's immediately clear where a given class is defined when browsing code.
02 Oct, 2008, Caius wrote in the 3rd comment:
Votes: 0
Thanks for your feedback! I wasn't aware that the space was needed, because it seems to work on my compiler. At any rate it's better to be portable of course. In addition to that Makefile typo there was also a bug that had slipped by in the code. In the ShadowTable strategy an exception would be thrown if the header was wider than the total table width at the same time as the table width was an odd number (that sentence was probably not very clear). I uploaded a fixed version yesterday that I recommend using instead.

As for namespaces I think that's a good suggestion. I'll keep that in mind if I release any new versions.
0.0/3