27
27
#include < sstream>
28
28
#include < filesystem>
29
29
#include < include/functions/dnaiostreamfuncs.hpp>
30
+ #include < include/functions/dnafilepathfuncs.hpp>
30
31
#include < include/io/adj_file.hpp>
31
32
32
33
namespace dynadjust {
@@ -1116,7 +1117,7 @@ void DynAdjustPrinter::PrintStationFileHeader(std::ostream& os, std::string_view
1116
1117
print_file_header (os, std::string (" DYNADJUST " ) + std::string (file_type) + " OUTPUT FILE" );
1117
1118
1118
1119
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;
1120
1121
}
1121
1122
1122
1123
void DynAdjustPrinter::PrintStationColumnHeaders (std::ostream& os, const std::string& stn_coord_types,
@@ -2632,7 +2633,7 @@ void DynAdjustPrinter::PrintPositionalUncertainty()
2632
2633
2633
2634
if (adjust_.projectSettings_ .o ._apply_type_b_file )
2634
2635
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;
2636
2637
}
2637
2638
2638
2639
apu_file << OUTPUTLINE << std::endl << std::endl;
@@ -3352,16 +3353,16 @@ void DynAdjustPrinter::PrintOutputFileHeaderInfo()
3352
3353
// Print formatted header
3353
3354
print_file_header (adjust_.xyz_file , " DYNADJUST COORDINATE OUTPUT FILE" );
3354
3355
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;
3357
3358
3358
3359
adjust_.adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Command line arguments: " ;
3359
3360
adjust_.adj_file << adjust_.projectSettings_ .a .command_line_arguments << std::endl << std::endl;
3360
3361
3361
3362
if (adjust_.projectSettings_ .i .input_files .empty ())
3362
3363
{
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;
3365
3366
}
3366
3367
else
3367
3368
{
@@ -3382,8 +3383,8 @@ void DynAdjustPrinter::PrintOutputFileHeaderInfo()
3382
3383
3383
3384
3384
3385
// 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;
3387
3388
3388
3389
switch (adjust_.projectSettings_ .a .adjust_mode )
3389
3390
{
@@ -3445,9 +3446,9 @@ void DynAdjustPrinter::PrintOutputFileHeaderInfo()
3445
3446
if (adjust_.projectSettings_ .o ._apply_type_b_file )
3446
3447
{
3447
3448
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;
3449
3450
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;
3451
3452
}
3452
3453
}
3453
3454
0 commit comments