I am trying to do something like this using rapidxml using c++
xml_document<> doc;
ifstream myfile("map.osm");
doc.parse<0>(myfile);
and receive the following error
Multiple markers at this line – Invalid arguments ‘ Candidates are: void parse(char *) ‘ – Symbol ‘parse’ could not be resolved
file size can be up to a few mega bytes.
please help
You have to load the file into a null terminated char buffer first as specified here in the official documentation.
http://rapidxml.sourceforge.net/manual.html#classrapidxml_1_1xml__document_8338ce6042e7b04d5a42144fb446b69c_18338ce6042e7b04d5a42144fb446b69c
Just read the contents of your file into a char array and use this array to pass to the
xml_document::parse()function.If you are using
ifstream, you can use something like the following to read the entire file contents to a bufferPlease note I have not compiled the above code, just writing it from memory, but this is the rough idea. Look at the documentation for
ifstreamfor exact details. This should help you get started anyway.