I noticed that the std::string versions of Attribute just call the const char* versions. And that's all nice and good. My only question is, why isn't there a double* version of Attribute() using std::string? There's an int version so... I mean, it's only
const char* Attribute( const std::string& name, double* d ) const { return Attribute( name.c_str(), d ); }
and it's done... Why isn't there one already? The int version looks exactly the same.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've checked out the latest code from the CVS and I don't see either GetDoubleAttribute() nor a Attribute( const std::string& name, double* d ). Where did they go? =/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
what I meant was the std::string version for double =) rechecked, the ones you said are there. that's why it should be easy to make a Attribute that takes a std::string and a double, as in my original post.
JP
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I noticed that the std::string versions of Attribute just call the const char* versions. And that's all nice and good. My only question is, why isn't there a double* version of Attribute() using std::string? There's an int version so... I mean, it's only
const char* Attribute( const std::string& name, double* d ) const { return Attribute( name.c_str(), d ); }
and it's done... Why isn't there one already? The int version looks exactly the same.
The development code has a "double" form. It will be available in the next release.
int/double overloading is a pain to use, so the method is:
GetDoubleAttribute()
lee
I've checked out the latest code from the CVS and I don't see either GetDoubleAttribute() nor a Attribute( const std::string& name, double* d ). Where did they go? =/
I was very worried there for a minute...but they are there. I pulled this out of CVSWEB, so it is checked in.
All members of the TiXmlElement class:
const char* Attribute( const char* name ) const;
const char* Attribute( const char* name, int* i ) const;
const char* Attribute( const char* name, double* d ) const;
int QueryIntAttribute( const char* name, int* value ) const;
int QueryDoubleAttribute( const char* name, double* value ) const;
lee
what I meant was the std::string version for double =) rechecked, the ones you said are there. that's why it should be easy to make a Attribute that takes a std::string and a double, as in my original post.
JP
Sorry! missed that point in a panic that I may have whacked some methods out of source.
Added bug.
lee