facet help

Discussion in 'C++' started by Christopher, Jan 30, 2012.

  1. Christopher

    Christopher Guest

    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.
     
    Christopher, Jan 30, 2012
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jean-Marie Condom
    Replies:
    0
    Views:
    685
    Jean-Marie Condom
    Dec 16, 2004
  2. Dj Frenzy
    Replies:
    0
    Views:
    447
    Dj Frenzy
    Dec 16, 2004
  3. FC
    Replies:
    4
    Views:
    5,855
    Keith Davies
    Oct 27, 2003
  4. Johann Sijpkes
    Replies:
    2
    Views:
    462
    Johann Sijpkes
    Jul 14, 2004
  5. David Valera
    Replies:
    0
    Views:
    475
    David Valera
    May 10, 2005
Loading...

Share This Page