116 {
117
118
119
120
121 float x, y, z;
122 char c;
123
124 is >> std::ws >> c;
125
126
127 if (is.fail() || c != '(' ) {
128 std::cerr
129 << "Could not find required opening parenthesis "
130 << "in input of a BasicVector3D<float>"
131 << std::endl;
132 return is;
133 }
134
135 is >> x >> std::ws >> c;
136 if (is.fail() || c != ',' ) {
137 std::cerr
138 << "Could not find x value and required trailing comma "
139 << "in input of a BasicVector3D<float>"
140 << std::endl;
141 return is;
142 }
143
144 is >> y >> std::ws >> c;
145 if (is.fail() || c != ',' ) {
146 std::cerr
147 << "Could not find y value and required trailing comma "
148 << "in input of a BasicVector3D<float>"
149 << std::endl;
150 return is;
151 }
152
153 is >> z >> std::ws >> c;
154 if (is.fail() || c != ')' ) {
155 std::cerr
156 << "Could not find z value and required close parenthesis "
157 << "in input of a BasicVector3D<float>"
158 << std::endl;
159 return is;
160 }
161
165 return is;
166 }