facet help

C

Christopher

I am thinking about converting some really nasty code that exposes a
sprintf type function for taking arguments of various types using
va_list and reinterpret casts, then a bunch of global functions to
formatting strings, to a stream operator.

My stream operator will need to know how to convert various types to
suitable strings for insertion to a database.

So, I thought I probably need to imbue a stream with a custom
"Informix DB" facet.

Can someone help me out with an example that will simply replace '\'
with "\\" on given wstrings?
---
A second question is, can I use a facet to perform different
formatting on typedefs?
typedef std::wstring objectName
typedef std::wstring objectShortName
typedef std::wstring SystemName

Whomever designed our database loved making columns that were string
types, but formatted them differently.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top