Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > template

Reply
Thread Tools

template

 
 
Carl Forsman
Guest
Posts: n/a
 
      11-16-2008
pug:ml_node: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_trait s<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?
 
Reply With Quote
 
 
 
 
Carl Forsman
Guest
Posts: n/a
 
      11-16-2008
On Sun, 16 Nov 2008 02:55:21 -0800, Carl Forsman
<(E-Mail Removed)> wrote:

>pug:ml_node: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_trai ts<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
 
Reply With Quote
 
 
 
 
Carl Forsman
Guest
Posts: n/a
 
      11-16-2008
On Sun, 16 Nov 2008 02:55:21 -0800, Carl Forsman
<(E-Mail Removed)> wrote:

>pug:ml_node: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_trai ts<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
 
Reply With Quote
 
Erik Wikström
Guest
Posts: n/a
 
      11-16-2008
On 2008-11-16 11:55, Carl Forsman wrote:
> pug:ml_node: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_trait s<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
 
Reply With Quote
 
Carl Forsman
Guest
Posts: n/a
 
      11-16-2008
On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
<(E-Mail Removed)> wrote:

>On 2008-11-16 11:55, Carl Forsman wrote:
>> pug:ml_node: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_trait s<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)

 
Reply With Quote
 
Carl Forsman
Guest
Posts: n/a
 
      11-16-2008
On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
<(E-Mail Removed)> wrote:

>On 2008-11-16 11:55, Carl Forsman wrote:
>> pug:ml_node: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_trait s<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
 
Reply With Quote
 
Erik Wikström
Guest
Posts: n/a
 
      11-16-2008
On 2008-11-16 13:19, Carl Forsman wrote:
> On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
> <(E-Mail Removed)> wrote:
>
>>On 2008-11-16 11:55, Carl Forsman wrote:
>>> pug:ml_node: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_trait s<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:fstream f("c:\test.xml");
pug:uter_xml(f);

--
Erik Wikström
 
Reply With Quote
 
Erik Wikström
Guest
Posts: n/a
 
      11-16-2008
On 2008-11-16 13:28, Carl Forsman wrote:
> On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
> <(E-Mail Removed)> wrote:
>
>>On 2008-11-16 11:55, Carl Forsman wrote:
>>> pug:ml_node: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_trait s<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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
r H2 deduce deduce template argument of a template class inheritingfrom a non template base? nguillot C++ 5 03-08-2009 05:56 PM
How to use the template member function of a template in the memberfunction of another template class? Peng Yu C++ 3 10-26-2008 03:51 PM
template template arguments: expected a class template, got `Component<T1, T2, T3> gary.bernstein@gmail.com C++ 1 06-08-2007 07:10 AM
Re: A Newbie Question about template template template tom_usenet C++ 0 07-24-2003 12:06 PM
Re: A Newbie Question about template template template Chris Theis C++ 2 07-24-2003 09:42 AM



Advertisments