@@ -201,7 +201,7 @@ void NewFile::clear()
201201 points.clear ();
202202}
203203
204- bool NewFile::interpret_line (const std::string & line, int line_num)
204+ bool NewFile::interpret_line (std::string line, int line_num)
205205{
206206 points_owner.push_back (std::make_unique<Point>(this ,line_num));
207207 if (points_owner.back ()->read_point (line, true ))
@@ -240,7 +240,7 @@ void CORFile::clear()
240240 new_points.clear ();
241241}
242242
243- bool CORFile::interpret_line (const std::string & line, int line_num)
243+ bool CORFile::interpret_line (std::string line, int line_num)
244244{
245245 // std::cout<<"Interpret \""<<line<<"\" as a COR line"<<std::endl;
246246 Project::theone ()->points .emplace_back (this ,line_num);
@@ -520,7 +520,7 @@ void OBSFile::clear()
520520 sub_files.clear ();
521521}
522522
523- bool OBSFile::interpret_line (const std::string & line, int line_num)
523+ bool OBSFile::interpret_line (std::string line, int line_num)
524524{
525525 // std::cout<<"Interpret \""<<line<<"\" as an OBS line"<<std::endl;
526526 std::regex regex_line (R"( ^\s*([^*\s]+)\*?(.*)$)" );
@@ -613,7 +613,10 @@ bool OBSFile::interpret_line(const std::string &line, int line_num)
613613 std::string comment=" " ;
614614 std::size_t comment_pos = line.find (' *' );
615615 if (comment_pos!=std::string::npos)
616- comment=line.substr (line.find (' *' )+1 );
616+ {
617+ comment=line.substr (comment_pos+1 );
618+ line=line.substr (0 ,comment_pos); // remove comment
619+ }
617620
618621 std::string file_path=current_absolute_path+" /" +filename.c_str ();
619622 fs::path next_path=file_path;
@@ -732,7 +735,7 @@ std::unique_ptr<XYZFile> XYZFile::create(const std::string &_filename, Station_B
732735
733736void XYZFile::clear () {}
734737
735- bool XYZFile::interpret_line (const std::string & line, int line_num)
738+ bool XYZFile::interpret_line (std::string line, int line_num)
736739{
737740 std::regex regex_line (R"( ^\s*([^*]+)\*?(.*)$)" );
738741 std::smatch what;
@@ -743,9 +746,9 @@ bool XYZFile::interpret_line(const std::string &line, int line_num)
743746 // what[2] contains the comment part
744747 if ((what[1 ]).length ()>1 )// there is something on the line
745748 {
746- std::string line_data =what[1 ];
749+ line =what[1 ];
747750 station->observations3D .emplace_back (station);
748- if (!station->observations3D .back ().read_obs (line_data ,line_num,this ,what[2 ]))
751+ if (!station->observations3D .back ().read_obs (line ,line_num,this ,what[2 ]))
749752 station->observations3D .pop_back ();
750753 else
751754 return true ;
@@ -978,7 +981,7 @@ std::unique_ptr<AxisFile> AxisFile::create(const std::string &_filename, Station
978981
979982void AxisFile::clear () {}
980983
981- bool AxisFile::interpret_line (const std::string & line, int line_num)
984+ bool AxisFile::interpret_line (std::string line, int line_num)
982985{
983986 // File format:
984987 // target_num pos_num ground_pt sigma_rayon sigma_perp
@@ -991,13 +994,13 @@ bool AxisFile::interpret_line(const std::string &line, int line_num)
991994 // what[2] contains the comment part
992995 if ((what[1 ]).length ()>1 )// there is something on the line
993996 {
994- std::string line_data =what[1 ];
995- if (line_data [0 ]==' L' )
997+ line =what[1 ];
998+ if (line [0 ]==' L' )
996999 {
997- return station->read_constr (line_data ,line_num,this ,what[2 ]);
1000+ return station->read_constr (line ,line_num,this ,what[2 ]);
9981001 }else {
9991002 AxisObs obsAx (station);
1000- if (obsAx.read_obs (line_data ,line_num,this ,what[2 ]))
1003+ if (obsAx.read_obs (line ,line_num,this ,what[2 ]))
10011004 {
10021005 station->updateTarget (obsAx.getTargetNum (), obsAx);
10031006 return true ;
@@ -1030,7 +1033,7 @@ std::unique_ptr<EqFile> EqFile::create(const std::string &_filename, Station_Eq
10301033
10311034void EqFile::clear () {}
10321035
1033- bool EqFile::interpret_line (const std::string & line, int line_num)
1036+ bool EqFile::interpret_line (std::string line, int line_num)
10341037{
10351038 // File format:
10361039 // from to sigma *comm
@@ -1041,6 +1044,7 @@ bool EqFile::interpret_line(const std::string &line, int line_num)
10411044 // what[0] contains the whole string
10421045 // what[1] contains the data part
10431046 // what[2] contains the comment part
1047+ line=what[1 ];
10441048
10451049 bool ok=true ;
10461050 bool active=true ;
0 commit comments