From Mikhail Izmestev, "This patch fixes operator >> used with std::istream without std::ios::skipws flag. This allow using boost::lexical_cast with osg vectors types, because boost's lexical_cast disable std::ios::skipws flag of std::istream before using operator >>.
"
This commit is contained in:
parent
1224836664
commit
eb3d76f291
@ -30,8 +30,8 @@ PROJECT(OpenSceneGraph)
|
|||||||
|
|
||||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
|
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
|
||||||
SET(OPENSCENEGRAPH_MINOR_VERSION 9)
|
SET(OPENSCENEGRAPH_MINOR_VERSION 9)
|
||||||
SET(OPENSCENEGRAPH_PATCH_VERSION 9)
|
SET(OPENSCENEGRAPH_PATCH_VERSION 10)
|
||||||
SET(OPENSCENEGRAPH_SOVERSION 66)
|
SET(OPENSCENEGRAPH_SOVERSION 67)
|
||||||
|
|
||||||
# set to 0 when not a release candidate, non zero means that any generated
|
# set to 0 when not a release candidate, non zero means that any generated
|
||||||
# svn tags will be treated as release candidates of given number
|
# svn tags will be treated as release candidates of given number
|
||||||
|
@ -20,8 +20,8 @@ extern "C" {
|
|||||||
|
|
||||||
#define OPENSCENEGRAPH_MAJOR_VERSION 2
|
#define OPENSCENEGRAPH_MAJOR_VERSION 2
|
||||||
#define OPENSCENEGRAPH_MINOR_VERSION 9
|
#define OPENSCENEGRAPH_MINOR_VERSION 9
|
||||||
#define OPENSCENEGRAPH_PATCH_VERSION 9
|
#define OPENSCENEGRAPH_PATCH_VERSION 10
|
||||||
#define OPENSCENEGRAPH_SOVERSION 66
|
#define OPENSCENEGRAPH_SOVERSION 67
|
||||||
|
|
||||||
/* Convenience macro that can be used to decide whether a feature is present or not i.e.
|
/* Convenience macro that can be used to decide whether a feature is present or not i.e.
|
||||||
* #if OSG_MIN_VERSION_REQUIRED(2,9,5)
|
* #if OSG_MIN_VERSION_REQUIRED(2,9,5)
|
||||||
|
@ -42,7 +42,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec2f& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec2f& vec)
|
inline std::istream& operator >> (std::istream& input, Vec2f& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1];
|
input >> vec._v[0] >> std::ws >> vec._v[1];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec2d& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec2d& vec)
|
inline std::istream& operator >> (std::istream& input, Vec2d& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1];
|
input >> vec._v[0] >> std::ws >> vec._v[1];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec3f& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec3f& vec)
|
inline std::istream& operator >> (std::istream& input, Vec3f& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2];
|
input >> vec._v[0] >> std::ws >> vec._v[1] >> std::ws >> vec._v[2];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec3d& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec3d& vec)
|
inline std::istream& operator >> (std::istream& input, Vec3d& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2];
|
input >> vec._v[0] >> std::ws >> vec._v[1] >> std::ws >> vec._v[2];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,10 @@ inline std::ostream& operator << (std::ostream& output, const Vec4f& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec4f& vec)
|
inline std::istream& operator >> (std::istream& input, Vec4f& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3];
|
input >> vec._v[0] >> std::ws
|
||||||
|
>> vec._v[1] >> std::ws
|
||||||
|
>> vec._v[2] >> std::ws
|
||||||
|
>> vec._v[3];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +128,10 @@ inline std::ostream& operator << (std::ostream& output, const Vec4d& vec)
|
|||||||
}
|
}
|
||||||
inline std::istream& operator >> (std::istream& input, Vec4d& vec)
|
inline std::istream& operator >> (std::istream& input, Vec4d& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3];
|
input >> vec._v[0] >> std::ws
|
||||||
|
>> vec._v[1] >> std::ws
|
||||||
|
>> vec._v[2] >> std::ws
|
||||||
|
>> vec._v[3];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +147,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec2b& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec2b& vec)
|
inline std::istream& operator >> (std::istream& input, Vec2b& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1];
|
input >> vec._v[0] >> std::ws >> vec._v[1];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +163,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec3b& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec3b& vec)
|
inline std::istream& operator >> (std::istream& input, Vec3b& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2];
|
input >> vec._v[0] >> std::ws >> vec._v[1] >> std::ws >> vec._v[2];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +180,10 @@ inline std::ostream& operator << (std::ostream& output, const Vec4b& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec4b& vec)
|
inline std::istream& operator >> (std::istream& input, Vec4b& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3];
|
input >> vec._v[0] >> std::ws
|
||||||
|
>> vec._v[1] >> std::ws
|
||||||
|
>> vec._v[2] >> std::ws
|
||||||
|
>> vec._v[3];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +199,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec2s& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec2s& vec)
|
inline std::istream& operator >> (std::istream& input, Vec2s& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1];
|
input >> vec._v[0] >> std::ws >> vec._v[1];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +215,7 @@ inline std::ostream& operator << (std::ostream& output, const Vec3s& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec3s& vec)
|
inline std::istream& operator >> (std::istream& input, Vec3s& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2];
|
input >> vec._v[0] >> std::ws >> vec._v[1] >> std::ws >> vec._v[2];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +232,10 @@ inline std::ostream& operator << (std::ostream& output, const Vec4s& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec4s& vec)
|
inline std::istream& operator >> (std::istream& input, Vec4s& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3];
|
input >> vec._v[0] >> std::ws
|
||||||
|
>> vec._v[1] >> std::ws
|
||||||
|
>> vec._v[2] >> std::ws
|
||||||
|
>> vec._v[3];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,7 +284,10 @@ inline std::ostream& operator << (std::ostream& output, const Vec4ub& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Vec4ub& vec)
|
inline std::istream& operator >> (std::istream& input, Vec4ub& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3];
|
input >> vec._v[0] >> std::ws
|
||||||
|
>> vec._v[1] >> std::ws
|
||||||
|
>> vec._v[2] >> std::ws
|
||||||
|
>> vec._v[3];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +305,10 @@ inline std::ostream& operator << (std::ostream& output, const Quat& vec)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Quat& vec)
|
inline std::istream& operator >> (std::istream& input, Quat& vec)
|
||||||
{
|
{
|
||||||
input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3];
|
input >> vec._v[0] >> std::ws
|
||||||
|
>> vec._v[1] >> std::ws
|
||||||
|
>> vec._v[2] >> std::ws
|
||||||
|
>> vec._v[3];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +327,10 @@ inline std::ostream& operator << (std::ostream& output, const Plane& pl)
|
|||||||
|
|
||||||
inline std::istream& operator >> (std::istream& input, Plane& vec)
|
inline std::istream& operator >> (std::istream& input, Plane& vec)
|
||||||
{
|
{
|
||||||
input >> vec[0] >> vec[1] >> vec[2] >> vec[3];
|
input >> vec[0] >> std::ws
|
||||||
|
>> vec[1] >> std::ws
|
||||||
|
>> vec[2] >> std::ws
|
||||||
|
>> vec[3];
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user