2727#include < sstream>
2828#include < filesystem>
2929#include < include/functions/dnaiostreamfuncs.hpp>
30+ #include < include/functions/dnafilepathfuncs.hpp>
3031#include < include/io/adj_file.hpp>
3132
3233namespace dynadjust {
@@ -1116,7 +1117,7 @@ void DynAdjustPrinter::PrintStationFileHeader(std::ostream& os, std::string_view
11161117 print_file_header (os, std::string (" DYNADJUST " ) + std::string (file_type) + " OUTPUT FILE" );
11171118
11181119 os << std::setw (PRINT_VAR_PAD) << std::left << " File name:" <<
1119- std::filesystem::absolute (filename). string ( ) << std::endl << std::endl;
1120+ safe_absolute_path (filename) << std::endl << std::endl;
11201121}
11211122
11221123void DynAdjustPrinter::PrintStationColumnHeaders (std::ostream& os, const std::string& stn_coord_types,
@@ -2632,7 +2633,7 @@ void DynAdjustPrinter::PrintPositionalUncertainty()
26322633
26332634 if (adjust_.projectSettings_ .o ._apply_type_b_file )
26342635 apu_file << std::setw (PRINT_VAR_PAD) << std::left << " Type B uncertainty file:" <<
2635- std::filesystem::absolute (adjust_.projectSettings_ .a .type_b_file ). string ( ) << std::endl;
2636+ safe_absolute_path (adjust_.projectSettings_ .a .type_b_file ) << std::endl;
26362637 }
26372638
26382639 apu_file << OUTPUTLINE << std::endl << std::endl;
@@ -3352,16 +3353,16 @@ void DynAdjustPrinter::PrintOutputFileHeaderInfo()
33523353 // Print formatted header
33533354 print_file_header (adjust_.xyz_file , " DYNADJUST COORDINATE OUTPUT FILE" );
33543355
3355- adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " File name:" << std::filesystem::absolute (adjust_.projectSettings_ .o ._adj_file ). string ( ) << std::endl << std::endl;
3356- adjust_.xyz_file << std::setw (PRINT_VAR_PAD) << std::left << " File name:" << std::filesystem::absolute (adjust_.projectSettings_ .o ._xyz_file ). string ( ) << std::endl << std::endl;
3356+ adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " File name:" << safe_absolute_path (adjust_.projectSettings_ .o ._adj_file ) << std::endl << std::endl;
3357+ adjust_.xyz_file << std::setw (PRINT_VAR_PAD) << std::left << " File name:" << safe_absolute_path (adjust_.projectSettings_ .o ._xyz_file ) << std::endl << std::endl;
33573358
33583359 adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Command line arguments: " ;
33593360 adjust_.adj_file << adjust_.projectSettings_ .a .command_line_arguments << std::endl << std::endl;
33603361
33613362 if (adjust_.projectSettings_ .i .input_files .empty ())
33623363 {
3363- adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Stations file:" << std::filesystem::absolute (adjust_.projectSettings_ .a .bst_file ). string ( ) << std::endl;
3364- adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Measurements file:" << std::filesystem::absolute (adjust_.projectSettings_ .a .bms_file ). string ( ) << std::endl;
3364+ adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Stations file:" << safe_absolute_path (adjust_.projectSettings_ .a .bst_file ) << std::endl;
3365+ adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Measurements file:" << safe_absolute_path (adjust_.projectSettings_ .a .bms_file ) << std::endl;
33653366 }
33663367 else
33673368 {
@@ -3382,8 +3383,8 @@ void DynAdjustPrinter::PrintOutputFileHeaderInfo()
33823383
33833384
33843385 // Geoid model
3385- adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Geoid model: " << std::filesystem::absolute (adjust_.projectSettings_ .n .ntv2_geoid_file ). string ( ) << std::endl;
3386- adjust_.xyz_file << std::setw (PRINT_VAR_PAD) << std::left << " Geoid model: " << std::filesystem::absolute (adjust_.projectSettings_ .n .ntv2_geoid_file ). string ( ) << std::endl;
3386+ adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Geoid model: " << safe_absolute_path (adjust_.projectSettings_ .n .ntv2_geoid_file ) << std::endl;
3387+ adjust_.xyz_file << std::setw (PRINT_VAR_PAD) << std::left << " Geoid model: " << safe_absolute_path (adjust_.projectSettings_ .n .ntv2_geoid_file ) << std::endl;
33873388
33883389 switch (adjust_.projectSettings_ .a .adjust_mode )
33893390 {
@@ -3445,9 +3446,9 @@ void DynAdjustPrinter::PrintOutputFileHeaderInfo()
34453446 if (adjust_.projectSettings_ .o ._apply_type_b_file )
34463447 {
34473448 adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Type B uncertainty file:" <<
3448- std::filesystem::absolute (adjust_.projectSettings_ .a .type_b_file ). string ( ) << std::endl;
3449+ safe_absolute_path (adjust_.projectSettings_ .a .type_b_file ) << std::endl;
34493450 adjust_.xyz_file << std::setw (PRINT_VAR_PAD) << std::left << " Type B uncertainty file:" <<
3450- std::filesystem::absolute (adjust_.projectSettings_ .a .type_b_file ). string ( ) << std::endl;
3451+ safe_absolute_path (adjust_.projectSettings_ .a .type_b_file ) << std::endl;
34513452 }
34523453 }
34533454
0 commit comments