On 13 Feb., 12:17, "steven acer" <dudest...@gmail.comwrote:
Quote:
hello,
i have a java app that constructs an xml from a specific file format
and vice versa.
i've been asked to convert it to c++, but im not an expert in c++,
actually im mere beginner you can say.
I am not sure that is a fair "first" job.
Quote:
i got a couple of questions though:
1- is there any equivalent to java's Stream
classes(ByteArrayInputStream,InputStreamRedare,Dat aInputStream ..)
Yes. For formatted IO you probably need an std::ofstream. For
unformatted/binary, you could use a streambuffer or the C file
iosystem. You better study that.
Quote:
2- how to open a stream on a byte ( char) array in c++ in order to
read it as text. i have a byte array i need to strip off some bytes
from and then pass it to a text stream.
You should read the documentation and be more specific in your
question here. It's not difficult, but we can't answer without more
knowledge of your problem.
Quote:
3- i know strings are ended in '\0' the null character in c++.
That is false, actually. C strings are null-terminated, C++ strings
are not.
Quote:
in the
fil i want to parse, xml-to-be-elements are separated by '\0', how can
i split the read text into strings using '\0' as my delimiter without
confusing c++.
This again depends on your requirements.
Quote:
4- the most important : how to parse and construct xml in c++, is
there any api for that and where to find it?
There are several nice xml-parsers for C++. A short google should give
you a candidate. Choosing one probably is more of a political decision
to be made by your company.
Quote:
5- last nut not least , since im targetting Windows , would it be
better to use unmanaged Visual C++ . does it have the types i am
looking for,and does it make it easy to accomplish the task ?
oh and i use g++ for windows.
There is only one C++ - namely the language we discuss in this
newsgroup. Microsoft has created a new language which they for some
reason call "managed C++", but it is not C++. "Managed C++" might
likely be a fine language for programming, but it can't be used for
porting to C++.
/Peter