Add-Ons & Services
The POCO C++ Libraries Blog

Archive: January, 2008

1.3.2 is Coming

Filed under: News by guenter at 20:51

Release 1.3.2 is on its way. For the impatient, a release candidate is available from the SVN repository.
Following is a list of changes since 1.3.1:
- added POCO_NO_SHAREDMEMORY to Config.h
- POCO_NO_WSTRING now really disables all wide string related calls
- added template specialization for string hashfunction (performance)
- XML parser performance improvements (SAX parser is now up to 40 % faster
- added parseMemoryNP() to XMLReader and friends
- URIStreamOpener improvement: redirect logic is now in URIStreamOpener.
this enables support for redirects from http to https.
- added support for temporary redirects and useproxy return code
- added getBlocking() to Socket
- added File::isHidden()
- better WIN64 support (AMD64 and IA64 platforms are recognized)
- added support for timed lock operations to [Fast]Mutex
- SharedLibrary: dlopen() is called with RTLD_GLOBAL instead of RTLD_LOCAL
(see http://gcc.gnu.org/faq.html#dso)
- Poco::Timer threads can now run with a specified priority
- added testcase for SF# 1774351
- fixed SF# 1784772: Message::swap omits _tid mem
- fixed SF# 1790894: IPAddress(addr,family) doesn’t fail on invalid address
- fixed SF# 1804395: Constructor argument name wrong
- fixed SF# 1806807: XMLWriter::characters should ignore empty strings
- fixed SF# 1806994: property application.runAsService set too late
- fixed SF# 1828908: HTMLForm does not encode ‘+’
- fixed SF# 1831871: Windows configuration file line endings not correct.
- fixed SF# 1845545: TCP server hangs on shutdown
- fixed SF# 1846734: Option::validator() does not behave according to doc
- fixed SF# 1856567: Assertion in DateTimeParser::tryParse()
- fixed SF# 1864832: HTTP server sendFile() uses incorrect date
- HTTPServerResponseImpl now always sets the Date header automatically
in the constructor.
- fixed SF# 1787667: DateTimeFormatter and time related classes
(also SF# 1800031: The wrong behavior of time related classes)
- fixed SF# 1829700: TaskManager::_taskList contains tasks that never started
- fixed SF# 1834127: Anonymous enums in Tuple.h result in invalid C++
- fixed SF# 1834130: RunnableAdapter::operator= not returning a value
- fixed SF# 1873924: Add exception code to NetException
- fixed SF# 1873929: SMTPClientSession support for name in sender field
- logging performance improvements (PatternFormatter)

The final release should be out after some more testing by the end of this week.


Filed under: News by alex at 18:15

I have just submitted a first attempt of PocoPDF into the SVN sandbox. It is a wrapper for the Haru PDF library. Haru depends on zlib and libpng, so full source for all three is embedded in PocoPDF.

Submitted code works and it comes with two samples – one showing how to create a text document and one with embedded image.

Here’s a list of outstanding items for this effort to be released:

  • VS 71 and VS 90 solution and project files (only VS 80 and Makefiles are current now)
  • attempt to establish some cooperation with Haru maintainers to:
    • get rid of MSVC warnings (mainly narrowing and signedness implicit conversions)
    • use freetype for fonts (there are some reports that loading TTF fonts on Mac does not work well and Haru’s font handling is rudimentary)
  • write tests
  • write more samples
  • ? export zlib functions from Foundation so we do not have to duplicate code in PDF ?

As usual, it would be really nice if someone would step up and volunteer to complete this. I will also post a message on Haru forum.

Here’s a snippet of code:

Document document(pdfFile.path());

Page page = document[0];
Font helv = document.font("Helvetica");
page.setFont(helv, 24);

std::string hello = "Hello PDF World from ";
float textWidth = page.textWidth(hello);
float textBegin = (page.getWidth() - textWidth) / 2;
page.writeOnce(textBegin, page.getHeight() - 50, hello);

Image image = document.loadPNGImage(pngFile.path());
page.drawImage(image, textBegin + textWidth / 2 - image.width() / 2,
page.getHeight() - 100 - image.height(),


And voila! – here’s the resulting document:

PocoPDF Hello World


Introducing PageCompiler and ApacheConnector

Filed under: News by guenter at 20:26

As promised a few days ago, here are two new and cool addition to POCO.

PageCompiler is a simple compiler that translates HTML pages containing embedded C++ code (using syntax familiar from JSP and PHP) into HTTPRequestHandler classes.

ApacheConnector is a module for Apache 2.x that allows you to use POCO HTTPRequestHandler subclasses in Apache. The simplest way to write Apache modules.

The sources are in the Subversion trunk and will make it into coming POCO releases.
Documentation (in PocoDoc format, but human-readable) is in the doc directory of each project.

Feedback and contributions wanted!

It Just Works

Filed under: News by alex at 21:24

I love things that “just work”. Ubuntu distro is supposed to be one of those things. Some time ago, I tried to install it on an old laptop and ended up with LCD panel split in three screens (I’m not kidding) and mouse popping up all over the place. Then I tried Mepis and I ended up with a crystal clear 1280×1024 resolution – something I was never able to achieve myself (who the heck has time and patience for xorg.conf), not even with Gentoo.

Ah, yes, Poco::Data:

I had one main thing in mind when I pushed for Poco::Data – I wanted to throw in a SQL and automagically get out whatever the heck I need – a HTML table, an XML document or whatever else an end user may need. After almost a year (bear in mind, this is still a hobby of mine) of development and tweaking, I finally got where I wanted to be, so we can do this now:

std::cout << RecordSet(session, "SELECT * FROM Simpsons", new HTMLTableFormatter);

and get this out:

Name Address Age
Homer Simpson Springfield 42
Marge Simpson Springfield 38
Bart Simpson Springfield 12
Lisa Simpson Springfield 10

Now, ages may be inaccurate since I made them up, but the code works. For details, see RowFormatter sample.

Unicode (shudder) support code is in, for both Windows and *NIX. It has been fully tested on Windows only, since things are quite murky on *NIX with wchar_t being (mostly) 32-bit, unixODBC Unicode being 16-bit by default (with 32-bit option), iODBC being 32-bit (only) and drivers being all over the place. I’m still trying to make sense of that mess and come up with a coherent strategy.

Comments, bug reports, opinions, flames, peanuts, … all welcome.