[Positioning] Add option flush-output-files
This commit is contained in:
parent
60a10cb112
commit
46a67d2843
|
@ -1,5 +1,8 @@
|
|||
# Sample configuration file for OWLPS Positioning
|
||||
|
||||
# Miscellaneous options
|
||||
#flush-output-files = true
|
||||
|
||||
[data-input]
|
||||
|
||||
#ap-medium = CSV
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "textfilewriter.hh"
|
||||
#include "configuration.hh"
|
||||
#include "posexcept.hh"
|
||||
|
||||
using namespace std ;
|
||||
|
@ -41,5 +42,9 @@ bool TextFileWriter::write_text(const string &text)
|
|||
return false ;
|
||||
|
||||
file << text ;
|
||||
|
||||
if (Configuration::bool_value("flush-output-files"))
|
||||
file.flush() ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
|
|
@ -87,6 +87,7 @@ void UserInterface::fill_file_options()
|
|||
fill_log_options() ;
|
||||
fill_positioning_options() ;
|
||||
fill_output_options() ;
|
||||
fill_misc_options() ;
|
||||
}
|
||||
|
||||
|
||||
|
@ -192,6 +193,19 @@ If this option is absent, results will be printed on the terminal.")
|
|||
}
|
||||
|
||||
|
||||
void UserInterface::fill_misc_options()
|
||||
{
|
||||
po::options_description options("Miscellaneous options") ;
|
||||
|
||||
options.add_options()
|
||||
("flush-output-files", po::value<bool>()->default_value(true),
|
||||
"Flush output text files after each line.")
|
||||
;
|
||||
|
||||
file_options->add(options) ;
|
||||
}
|
||||
|
||||
|
||||
void UserInterface::parse_options()
|
||||
{
|
||||
parse_command_line() ;
|
||||
|
|
|
@ -29,6 +29,7 @@ protected:
|
|||
void fill_log_options(void) ;
|
||||
void fill_positioning_options(void) ;
|
||||
void fill_output_options(void) ;
|
||||
void fill_misc_options(void) ;
|
||||
|
||||
/// Parse all the configuration inputs and updates Configuration
|
||||
void parse_options(void) ;
|
||||
|
|
Loading…
Reference in New Issue