From 9325ec681e8bb61e6a5d15e42f61d10aa7a483e5 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 14 Jul 2000 19:15:41 +0000 Subject: [PATCH] Tweaking api. --- simgear/io/sg_file.cxx | 3 ++- simgear/io/sg_file.hxx | 3 +-- simgear/io/sg_serial.cxx | 4 +++- simgear/io/sg_serial.hxx | 4 +--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/simgear/io/sg_file.cxx b/simgear/io/sg_file.cxx index 687a5a05..4707c397 100644 --- a/simgear/io/sg_file.cxx +++ b/simgear/io/sg_file.cxx @@ -36,8 +36,9 @@ FG_USING_STD(string); -SGFile::SGFile() { +SGFile::SGFile( const string &file) { set_type( sgFileType ); + file_name = file; } diff --git a/simgear/io/sg_file.hxx b/simgear/io/sg_file.hxx index 994cc275..b2618f28 100644 --- a/simgear/io/sg_file.hxx +++ b/simgear/io/sg_file.hxx @@ -52,7 +52,7 @@ class SGFile : public SGIOChannel { public: - SGFile(); + SGFile( const string& file ); ~SGFile(); // open the file based on specified direction @@ -74,7 +74,6 @@ public: bool close(); inline string get_file_name() const { return file_name; } - inline void set_file_name( const string& fn ) { file_name = fn; } }; diff --git a/simgear/io/sg_serial.cxx b/simgear/io/sg_serial.cxx index 2d409fb8..f59a9824 100644 --- a/simgear/io/sg_serial.cxx +++ b/simgear/io/sg_serial.cxx @@ -33,10 +33,12 @@ FG_USING_STD(string); -SGSerial::SGSerial() : +SGSerial::SGSerial( const string& device_name, const string& baud_rate ) : save_len(0) { set_type( sgSerialType ); + device = device_name; + baud = baud_rate; } diff --git a/simgear/io/sg_serial.hxx b/simgear/io/sg_serial.hxx index ce7a7d4d..43cb4433 100644 --- a/simgear/io/sg_serial.hxx +++ b/simgear/io/sg_serial.hxx @@ -57,7 +57,7 @@ class SGSerial : public SGIOChannel { public: - SGSerial(); + SGSerial( const string& device_name, const string& baud_rate ); ~SGSerial(); // open the serial port based on specified direction @@ -79,9 +79,7 @@ public: bool close(); inline string get_device() const { return device; } - inline void set_device( const string& d ) { device = d; } inline string get_baud() const { return baud; } - inline void set_baud( const string& b ) { baud = b; } }; -- 2.39.5