By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,951 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,951 IT Pros & Developers. It's quick & easy.

template

P: n/a
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_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?
Nov 16 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Sun, 16 Nov 2008 02:55:21 -0800, Carl Forsman
<fa**********@yahoo.comwrote:
>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_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
Nov 16 '08 #2

P: n/a
On Sun, 16 Nov 2008 02:55:21 -0800, Carl Forsman
<fa**********@yahoo.comwrote:
>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_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
Nov 16 '08 #3

P: n/a
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_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
Nov 16 '08 #4

P: n/a
On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
<Er***********@telia.comwrote:
>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_trai ts<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)
Nov 16 '08 #5

P: n/a
On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
<Er***********@telia.comwrote:
>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_trai ts<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
Nov 16 '08 #6

P: n/a
On 2008-11-16 13:19, Carl Forsman wrote:
On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
<Er***********@telia.comwrote:
>>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_tra its<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
Nov 16 '08 #7

P: n/a
On 2008-11-16 13:28, Carl Forsman wrote:
On Sun, 16 Nov 2008 11:57:16 GMT, Erik Wikstr?m
<Er***********@telia.comwrote:
>>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_tra its<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
Nov 16 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.