00001 /** 00002 \file gpsppssync_OptionFile.cpp 00003 \brief The option file for gpsppssync. 00004 00005 \author Glenn D. MacGougan (GDM) 00006 \date 2008-12-22 00007 \since 2008-12-22 00008 00009 \b "LICENSE INFORMATION" \n 00010 Copyright (c) 2008 - All rights reserved. \n 00011 00012 Redistribution and use in source and binary forms, with or without 00013 modification, are permitted provided the following conditions are met: \n 00014 00015 - Redistributions of source code must retain the above copyright 00016 notice, this list of conditions and the following disclaimer. \n 00017 - Redistributions in binary form must reproduce the above copyright 00018 notice, this list of conditions and the following disclaimer in the 00019 documentation and/or other materials provided with the distribution. \n 00020 - The name(s) of the contributor(s) may not be used to endorse or promote 00021 products derived from this software without specific prior written 00022 permission. \n 00023 00024 THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS 00025 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00026 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00027 DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 00028 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00029 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00030 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00032 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00033 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00034 SUCH DAMAGE. 00035 */ 00036 00037 #include "gpsppssync_OptionFile.h" 00038 #include "StdStringUtils.h" 00039 #include "gnss_error.h" 00040 00041 gpsppssync_OptionFile::~gpsppssync_OptionFile() 00042 { 00043 } 00044 00045 00046 gpsppssync_OptionFile::gpsppssync_OptionFile() 00047 { 00048 } 00049 00050 00051 00052 bool gpsppssync_OptionFile::ReadAndInterpretOptions( const std::string OptionFilePath ) 00053 { 00054 if( !ReadOptionFile( OptionFilePath ) ) 00055 { 00056 GNSS_ERROR_MSG( "ReadOptionFile returned false." ); 00057 return false; 00058 } 00059 m_OptionFilePath = OptionFilePath; 00060 00061 if( !GetValue( "ReceiverType", m_ReceiverType ) ) 00062 { 00063 GNSS_ERROR_MSG( "Invalid option: ReceiverType" ); 00064 return false; 00065 } 00066 00067 if( !GetValue( "ReceiverSerialPortNumber", m_ReceiverSerialPortNumber ) ) 00068 { 00069 GNSS_ERROR_MSG( "Invalid option: ReceiverSerialPortNumber" ); 00070 return false; 00071 } 00072 00073 if( !GetValue( "ComPort", m_SerialPortNumber ) ) 00074 { 00075 GNSS_ERROR_MSG( "Invalid option: ComPort" ); 00076 return false; 00077 } 00078 00079 if( !GetValue( "PerformPPSTest", m_PerformPPSTest ) ) 00080 { 00081 GNSS_ERROR_MSG( "Invalid option: PerformPPSTest" ); 00082 return false; 00083 } 00084 00085 if( !GetValue( "AllowTimeForHyperTerminalComparison", m_AllowTimeForHyperTerminalComparison ) ) 00086 { 00087 GNSS_ERROR_MSG( "Invalid option: AllowTimeForHyperTerminalComparison" ); 00088 return false; 00089 } 00090 00091 return true; 00092 } 00093 00094