template

C

Carl Forsman

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?
 
C

Carl Forsman

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
 
C

Carl Forsman

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
 
E

Erik Wikström

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)
 
C

Carl Forsman

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


The default delimiter?


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
 
C

Carl Forsman

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


The default delimiter?


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
 
E

Erik Wikström

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);
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top