From 40c510a28aa7e4d315aee5790bb2b343c7d08fd1 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Sun, 23 Oct 2011 16:51:59 +0200 Subject: [PATCH] utilities: Removed unused functions. --- src/utilities.cpp | 34 ++++++++-------------------------- src/utilities.h | 13 ++++--------- 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/src/utilities.cpp b/src/utilities.cpp index 69e0387..770b788 100644 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Massimiliano Torromeo * - * massimiliano.torromeo@gmail.com * + * Copyright (C) 2006 by Massimiliano Torromeo * + * massimiliano.torromeo@gmail.com * * * * 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 * @@ -18,6 +18,12 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include "utilities.h" + +#include "debug.h" + +#include + //for browsing the filesystem #include #include @@ -26,11 +32,6 @@ #include #include -#include - -#include "utilities.h" -#include "debug.h" - using namespace std; bool case_less::operator()(const string &left, const string &right) const { @@ -48,17 +49,6 @@ string trim(const string& s) { return string(s, b, e - b + 1); } -void string_copy(const string &s, char **cs) { - *cs = (char*)malloc(s.length()); - strcpy(*cs, s.c_str()); -} - -char * string_copy(const string &s) { - char *cs = NULL; - string_copy(s, &cs); - return cs; -} - bool fileExists(const string &file) { fstream fin; fin.open(file.c_str() ,ios::in); @@ -118,14 +108,6 @@ int evalIntConf (int *val, int def, int imin, int imax) { return *val; } -const string &evalStrConf (const string &val, const string &def) { - return val.empty() ? def : val; -} -const string &evalStrConf (string *val, const string &def) { - *val = evalStrConf(*val, def); - return *val; -} - bool split (vector &vec, const string &str, const string &delim, bool destructive) { vec.clear(); diff --git a/src/utilities.h b/src/utilities.h index 742fdac..f63dc35 100644 --- a/src/utilities.h +++ b/src/utilities.h @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Massimiliano Torromeo * - * massimiliano.torromeo@gmail.com * + * Copyright (C) 2006 by Massimiliano Torromeo * + * massimiliano.torromeo@gmail.com * * * * 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 * @@ -30,11 +30,8 @@ public: }; std::string trim(const std::string& s); -std::string strreplace (std::string orig, const std::string &search, const std::string &replace); -std::string cmdclean (std::string cmdline); - -char *string_copy(const std::string &); -void string_copy(const std::string &, char **); +std::string strreplace(std::string orig, const std::string &search, const std::string &replace); +std::string cmdclean(std::string cmdline); bool fileExists(const std::string &file); bool rmtree(std::string path); @@ -45,8 +42,6 @@ int constrain(int x, int imin, int imax); int evalIntConf(int val, int def, int imin, int imax); int evalIntConf(int *val, int def, int imin, int imax); -const std::string &evalStrConf(const std::string &val, const std::string &def); -const std::string &evalStrConf(std::string *val, const std::string &def); bool split(std::vector &vec, const std::string &str, const std::string &delim, bool destructive=true);