Hello !
I have problems with Reading and Writing of .minf
When writing a header using a PythonHeader and filling a vector< Object > , I get the following error message:
terminate called after throwing an instance of 'std::invalid_argument'
what(): wrong type
I used to include #include <cartobase/attributed/pythonreader.h> to use the class PythonHeader and a vector< Object > which seems to be deprecated.
What is the new way to read and write .minf files ?
Thanks
JD
New way of reading and writing .minf files
- riviere
- Site Admin
- Posts: 1361
- Joined: Tue Jan 06, 2004 12:21 pm
- Location: CEA NeuroSpin, Saint Aubin, France
- Contact:
Hi,
I don't understand exactly where the problem occurs. PythonHeader has changed internally and may be replaced by something else in the future, but right now it should work the way it did. How do you use it ? Which function or method does produce the exception ?
To put a vector<Object> in a header, just do:You can use the header readMinf() and writeMinf() methods to read or save it.
Doesn't it work ?
Denis
I don't understand exactly where the problem occurs. PythonHeader has changed internally and may be replaced by something else in the future, but right now it should work the way it did. How do you use it ? Which function or method does produce the exception ?
To put a vector<Object> in a header, just do:
Code: Select all
PythonHeader header;
vector<Object> vec;
vec.push_back( Object::value( 15.F ) ); // for instance
header.setProperty( "toto", vec );
Doesn't it work ?
Denis
I think the problem occured because, instead of
I was using the following instruction:
which was working fine before I changed my version of aims library
Actually, I am using this instruction:
What is th edifference ?
thanks
jd
Code: Select all
header.setProperty( "toto", vec );
Code: Select all
header[ "toto" ] = vec
Actually, I am using this instruction:
Code: Select all
header.setAttribute( "toto", vec );
thanks
jd