[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

template

Carl Forsman

11/16/2008 10:55:00 AM

pug::xml_node::outer_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?
7 Answers

Carl Forsman

11/16/2008 11:03:00 AM

0

On Sun, 16 Nov 2008 02:55:21 -0800, Carl Forsman
<fatwallet951@yahoo.com> wrote:

>pug::xml_node::outer_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/13...

Carl Forsman

11/16/2008 11:43:00 AM

0

On Sun, 16 Nov 2008 02:55:21 -0800, Carl Forsman
<fatwallet951@yahoo.com> wrote:

>pug::xml_node::outer_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/135...

Erik Wikström

11/16/2008 11:57:00 AM

0

On 2008-11-16 11:55, Carl Forsman wrote:
> pug::xml_node::outer_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

Carl Forsman

11/16/2008 12:19:00 PM

0

On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
<Erik-wikstrom@telia.com> wrote:

>On 2008-11-16 11:55, Carl Forsman wrote:
>> pug::xml_node::outer_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

11/16/2008 12:29:00 PM

0

On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
<Erik-wikstrom@telia.com> wrote:

>On 2008-11-16 11:55, Carl Forsman wrote:
>> pug::xml_node::outer_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/135...

Erik Wikström

11/16/2008 2:24:00 PM

0

On 2008-11-16 13:19, Carl Forsman wrote:
> On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
> <Erik-wikstrom@telia.com> wrote:
>
>>On 2008-11-16 11:55, Carl Forsman wrote:
>>> pug::xml_node::outer_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::ofstream f("c:\test.xml");
pug::outer_xml(f);

--
Erik Wikström

Erik Wikström

11/16/2008 2:55:00 PM

0

On 2008-11-16 13:28, Carl Forsman wrote:
> On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
> <Erik-wikstrom@telia.com> wrote:
>
>>On 2008-11-16 11:55, Carl Forsman wrote:
>>> pug::xml_node::outer_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/135...

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