From 2305993a066764f81d847e288fd279b8408764d2 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Thu, 7 Apr 2011 17:02:53 +0300 Subject: [PATCH] Unused library removed --- stglibs/common_settings.lib/Makefile | 12 -- .../common_settings.lib/common_settings.cpp | 128 ------------------ stglibs/common_settings.lib/common_settings.h | 68 ---------- 3 files changed, 208 deletions(-) delete mode 100644 stglibs/common_settings.lib/Makefile delete mode 100644 stglibs/common_settings.lib/common_settings.cpp delete mode 100644 stglibs/common_settings.lib/common_settings.h diff --git a/stglibs/common_settings.lib/Makefile b/stglibs/common_settings.lib/Makefile deleted file mode 100644 index 7829e445..00000000 --- a/stglibs/common_settings.lib/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.3 2007/05/08 14:40:09 nobunaga Exp $ -############################################################################### - -LIB_NAME = common_settings -PROG = lib$(LIB_NAME) - -SRCS = common_settings.cpp - -INCS = common_settings.h - -include ../Makefile.in diff --git a/stglibs/common_settings.lib/common_settings.cpp b/stglibs/common_settings.lib/common_settings.cpp deleted file mode 100644 index 53a61c16..00000000 --- a/stglibs/common_settings.lib/common_settings.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Date: 29.03.2007 - * Author : Boris Mikhailenko - */ - -/* -$Revision: 1.2 $ -$Date: 2007/04/07 13:29:07 $ -*/ - -#include -#include -#include -#include -#include - -using namespace std; - -#include "common_settings.h" -#include "common.h" - -//----------------------------------------------------------------------------- -COMMON_SETTINGS::COMMON_SETTINGS() -{ - -} -//----------------------------------------------------------------------------- -COMMON_SETTINGS::~COMMON_SETTINGS() -{ - -} -//----------------------------------------------------------------------------- -int COMMON_SETTINGS::ParseYesNo(const string & value, bool * val) -{ -if (0 == strcasecmp(value.c_str(), "yes")) - { - *val = true; - return 0; - } -if (0 == strcasecmp(value.c_str(), "no")) - { - *val = false; - return 0; - } - -strError = "Incorrect value \'" + value + "\'."; -return -1; -} -//----------------------------------------------------------------------------- -int COMMON_SETTINGS::ParseInt(const string & value, int * val) -{ -char *res; -*val = strtol(value.c_str(), &res, 10); -if (*res != 0) - { - strError = "Cannot convert \'" + value + "\' to integer."; - return -1; - } -return 0; -} -//----------------------------------------------------------------------------- -int COMMON_SETTINGS::ParseIntInRange(const string & value, int min, int max, int * val) -{ -if (ParseInt(value, val) != 0) - return -1; - -if (*val < min || *val > max) - { - strError = "Value \'" + value + "\' out of range."; - return -1; - } - -return 0; -} -//----------------------------------------------------------------------------- -int COMMON_SETTINGS::ParseDouble(const std::string & value, double * val) -{ -char *res; -*val = strtod(value.c_str(), &res); -if (*res != 0) - { - strError = "Cannot convert \'" + value + "\' to double."; - return -1; - } -return 0; -} -//----------------------------------------------------------------------------- -int COMMON_SETTINGS::ParseDoubleInRange(const std::string & value, double min, double max, double * val) -{ -if (ParseDouble(value, val) != 0) - return -1; - -if (*val < min || *val > max) - { - strError = "Value \'" + value + "\' out of range."; - return -1; - } - -return 0; -} -//----------------------------------------------------------------------------- -string COMMON_SETTINGS::GetStrError() const -{ -return strError; -} -//----------------------------------------------------------------------------- -int COMMON_SETTINGS::Reload () -{ -return ReadSettings(); -} -//----------------------------------------------------------------------------- - diff --git a/stglibs/common_settings.lib/common_settings.h b/stglibs/common_settings.lib/common_settings.h deleted file mode 100644 index 4a15910d..00000000 --- a/stglibs/common_settings.lib/common_settings.h +++ /dev/null @@ -1,68 +0,0 @@ - /* - $Revision: 1.3 $ - $Date: 2007/10/24 08:04:07 $ - */ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Date: 29.03.2007 - * Author : Boris Mikhailenko - */ - - /* - $Revision: 1.3 $ - $Date: 2007/10/24 08:04:07 $ - */ - - -#ifndef common_settingsh_h -#define common_settingsh_h 1 - -#include -#include -//#include - -#include "common.h" -#include "base_settings.h" - -//----------------------------------------------------------------------------- -class COMMON_SETTINGS -{ -public: - COMMON_SETTINGS(); - virtual ~COMMON_SETTINGS(); - virtual int Reload(); - virtual int ReadSettings() = 0; - - virtual std::string GetStrError() const; - -protected: - - virtual int ParseInt(const std::string & value, int * val); - virtual int ParseIntInRange(const std::string & value, int min, int max, int * val); - - virtual int ParseDouble(const std::string & value, double * val); - virtual int ParseDoubleInRange(const std::string & value, double min, double max, double * val); - - virtual int ParseYesNo(const std::string & value, bool * val); - - mutable std::string strError; -}; -//----------------------------------------------------------------------------- -#endif - -- 2.44.2