template

Discussion in 'C++' started by Carl Forsman, Nov 16, 2008.

  1. Carl Forsman

    Carl Forsman Guest

    pug::xml_node::eek:uter_xml Function
    Stream output. Recursively writes the internal xml_node_struct
    structure to the given stream.

    =====================
    Public void
    outer_xml(std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &, TCHAR =
    _T('\t'), bool = true)
    =====================

    what is that means
    std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &

    what is the following means?
    TCHAR = _T('\t')

    does the above function has 3 parameteres?
    std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    TCHAR = _T('\t')
    bool = true

    the 1st parameter is of type std::basic_ostream?
    is the <TCHAR,std::char_traits<TCHAR>> some kind of template?
     
    Carl Forsman, Nov 16, 2008
    #1
    1. Advertising

  2. Carl Forsman

    Carl Forsman Guest

    On Sun, 16 Nov 2008 02:55:21 -0800, Carl Forsman
    <> wrote:

    >pug::xml_node::eek:uter_xml Function
    >Stream output. Recursively writes the internal xml_node_struct
    >structure to the given stream.
    >
    >=====================
    >Public void
    >outer_xml(std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &, TCHAR =
    >_T('\t'), bool = true)
    >=====================
    >
    >what is that means
    >std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    >
    >what is the following means?
    >TCHAR = _T('\t')
    >
    >does the above function has 3 parameteres?
    >std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    >TCHAR = _T('\t')
    > bool = true
    >
    >the 1st parameter is of type std::basic_ostream?
    >is the <TCHAR,std::char_traits<TCHAR>> some kind of template?


    the capture of manual for this function is here
    http://www.oniva.com/upload/1356/xml.jpg
     
    Carl Forsman, Nov 16, 2008
    #2
    1. Advertising

  3. Carl Forsman

    Carl Forsman Guest

    On Sun, 16 Nov 2008 02:55:21 -0800, Carl Forsman
    <> wrote:

    >pug::xml_node::eek:uter_xml Function
    >Stream output. Recursively writes the internal xml_node_struct
    >structure to the given stream.
    >
    >=====================
    >Public void
    >outer_xml(std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &, TCHAR =
    >_T('\t'), bool = true)
    >=====================
    >
    >what is that means
    >std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    >
    >what is the following means?
    >TCHAR = _T('\t')
    >
    >does the above function has 3 parameteres?
    >std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    >TCHAR = _T('\t')
    > bool = true
    >
    >the 1st parameter is of type std::basic_ostream?
    >is the <TCHAR,std::char_traits<TCHAR>> some kind of template?


    screen shot in VC++
    http://www.oniva.com/upload/1356/xml1.jpg
     
    Carl Forsman, Nov 16, 2008
    #3
  4. On 2008-11-16 11:55, Carl Forsman wrote:
    > pug::xml_node::eek:uter_xml Function
    > Stream output. Recursively writes the internal xml_node_struct
    > structure to the given stream.
    >
    > =====================
    > Public void
    > outer_xml(std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &, TCHAR =
    > _T('\t'), bool = true)
    > =====================
    >
    > what is that means
    > std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &


    A reference to normal ostream object for TCHAR (which is a Windows macro
    which expands to either char or some other type for unicode).

    > what is the following means?
    > TCHAR = _T('\t')


    The default delimiter?

    > does the above function has 3 parameteres?
    > std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    > TCHAR = _T('\t')
    > bool = true


    Yes

    > the 1st parameter is of type std::basic_ostream?


    Yes

    > is the <TCHAR,std::char_traits<TCHAR>> some kind of template?


    Not quite, basic_ostream is a templat which takes two parameters, a char
    type (TCHAR), and char-traits for the char-type (std::char_type<TCHAR>),
    notice that std::char_traits is a template itself.

    An example of how to use this function would be:

    outer_xml(std::cout);

    or

    outer_xml(std::cout, '|', false)

    --
    Erik Wikström
     
    Erik Wikström, Nov 16, 2008
    #4
  5. Carl Forsman

    Carl Forsman Guest

    On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
    <> wrote:

    >On 2008-11-16 11:55, Carl Forsman wrote:
    >> pug::xml_node::eek:uter_xml Function
    >> Stream output. Recursively writes the internal xml_node_struct
    >> structure to the given stream.
    >>
    >> =====================
    >> Public void
    >> outer_xml(std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &, TCHAR =
    >> _T('\t'), bool = true)
    >> =====================
    >>
    >> what is that means
    >> std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &

    >
    >A reference to normal ostream object for TCHAR (which is a Windows macro
    >which expands to either char or some other type for unicode).
    >
    >> what is the following means?
    >> TCHAR = _T('\t')

    >
    >The default delimiter?
    >
    >> does the above function has 3 parameteres?
    >> std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    >> TCHAR = _T('\t')
    >> bool = true

    >
    >Yes
    >
    >> the 1st parameter is of type std::basic_ostream?

    >
    >Yes
    >
    >> is the <TCHAR,std::char_traits<TCHAR>> some kind of template?

    >
    >Not quite, basic_ostream is a templat which takes two parameters, a char
    >type (TCHAR), and char-traits for the char-type (std::char_type<TCHAR>),
    >notice that std::char_traits is a template itself.
    >
    >An example of how to use this function would be:
    >
    > outer_xml(std::cout);


    how to output to a file like c:/test.xml

    do I write -
    outer_xml(std::cout("c:/test.xml"); // not sure about syntax to output
    to file


    >
    >or
    >
    > outer_xml(std::cout, '|', false)
     
    Carl Forsman, Nov 16, 2008
    #5
  6. Carl Forsman

    Carl Forsman Guest

    On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
    <> wrote:

    >On 2008-11-16 11:55, Carl Forsman wrote:
    >> pug::xml_node::eek:uter_xml Function
    >> Stream output. Recursively writes the internal xml_node_struct
    >> structure to the given stream.
    >>
    >> =====================
    >> Public void
    >> outer_xml(std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &, TCHAR =
    >> _T('\t'), bool = true)
    >> =====================
    >>
    >> what is that means
    >> std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &

    >
    >A reference to normal ostream object for TCHAR (which is a Windows macro
    >which expands to either char or some other type for unicode).
    >
    >> what is the following means?
    >> TCHAR = _T('\t')

    >
    >The default delimiter?
    >
    >> does the above function has 3 parameteres?
    >> std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    >> TCHAR = _T('\t')
    >> bool = true

    >
    >Yes
    >
    >> the 1st parameter is of type std::basic_ostream?

    >
    >Yes
    >
    >> is the <TCHAR,std::char_traits<TCHAR>> some kind of template?

    >
    >Not quite, basic_ostream is a templat which takes two parameters, a char
    >type (TCHAR), and char-traits for the char-type (std::char_type<TCHAR>),
    >notice that std::char_traits is a template itself.
    >
    >An example of how to use this function would be:
    >
    > outer_xml(std::cout);
    >
    >or
    >
    > outer_xml(std::cout, '|', false)


    I tried the one parameter but VC++ has error saying I cannot have only
    1 parameter

    then I tried the 3 parameter and I got the following error
    http://www.oniva.com/upload/1356/xml2.jpg
     
    Carl Forsman, Nov 16, 2008
    #6
  7. On 2008-11-16 13:19, Carl Forsman wrote:
    > On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
    > <> wrote:
    >
    >>On 2008-11-16 11:55, Carl Forsman wrote:
    >>> pug::xml_node::eek:uter_xml Function
    >>> Stream output. Recursively writes the internal xml_node_struct
    >>> structure to the given stream.
    >>>
    >>> =====================
    >>> Public void
    >>> outer_xml(std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &, TCHAR =
    >>> _T('\t'), bool = true)
    >>> =====================
    >>>
    >>> what is that means
    >>> std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &

    >>
    >>A reference to normal ostream object for TCHAR (which is a Windows macro
    >>which expands to either char or some other type for unicode).
    >>
    >>> what is the following means?
    >>> TCHAR = _T('\t')

    >>
    >>The default delimiter?
    >>
    >>> does the above function has 3 parameteres?
    >>> std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &
    >>> TCHAR = _T('\t')
    >>> bool = true

    >>
    >>Yes
    >>
    >>> the 1st parameter is of type std::basic_ostream?

    >>
    >>Yes
    >>
    >>> is the <TCHAR,std::char_traits<TCHAR>> some kind of template?

    >>
    >>Not quite, basic_ostream is a templat which takes two parameters, a char
    >>type (TCHAR), and char-traits for the char-type (std::char_type<TCHAR>),
    >>notice that std::char_traits is a template itself.
    >>
    >>An example of how to use this function would be:
    >>
    >> outer_xml(std::cout);

    >
    > how to output to a file like c:/test.xml
    >
    > do I write -
    > outer_xml(std::cout("c:/test.xml"); // not sure about syntax to output
    > to file


    You need to create an ofstream (if you do not know these things you
    really should take some time to learn basic C++):

    std::eek:fstream f("c:\test.xml");
    pug::eek:uter_xml(f);

    --
    Erik Wikström
     
    Erik Wikström, Nov 16, 2008
    #7
  8. On 2008-11-16 13:28, Carl Forsman wrote:
    > On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
    > <> wrote:
    >
    >>On 2008-11-16 11:55, Carl Forsman wrote:
    >>> pug::xml_node::eek:uter_xml Function
    >>> Stream output. Recursively writes the internal xml_node_struct
    >>> structure to the given stream.
    >>>
    >>> =====================
    >>> Public void
    >>> outer_xml(std::basic_ostream<TCHAR,std::char_traits<TCHAR>> &, TCHAR =
    >>> _T('\t'), bool = true)
    >>> =====================
    >>>


    >>An example of how to use this function would be:
    >>
    >> outer_xml(std::cout);
    >>
    >>or
    >>
    >> outer_xml(std::cout, '|', false)

    >
    > I tried the one parameter but VC++ has error saying I cannot have only
    > 1 parameter
    >
    > then I tried the 3 parameter and I got the following error
    > http://www.oniva.com/upload/1356/xml2.jpg


    Seems to me like the function does not take the parameters you specified
    above, or you need the _T, i.e. "outer_xml(std::cout, _T('|'), false);"

    --
    Erik Wikström
     
    Erik Wikström, Nov 16, 2008
    #8
    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. Chris Theis
    Replies:
    2
    Views:
    478
    Chris Theis
    Jul 24, 2003
  2. tom_usenet
    Replies:
    0
    Views:
    538
    tom_usenet
    Jul 24, 2003
  3. Replies:
    1
    Views:
    2,113
    Gianni Mariani
    Jun 8, 2007
  4. Peng Yu
    Replies:
    3
    Views:
    781
    Thomas J. Gritzan
    Oct 26, 2008
  5. nguillot
    Replies:
    5
    Views:
    532
Loading...

Share This Page