show history newest first + prune duplicate entries

This commit is contained in:
dockes
2005-11-25 14:36:46 +00:00
parent 5c67dd9461
commit 30bf4052f8
5 changed files with 90 additions and 42 deletions
+2 -16
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid [] = "@(#$Id: conftree.cpp,v 1.3 2005-11-25 08:50:39 dockes Exp $ (C) 2003 J.F.Dockes";
static char rcsid [] = "@(#$Id: conftree.cpp,v 1.4 2005-11-25 14:36:45 dockes Exp $ (C) 2003 J.F.Dockes";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -15,6 +15,7 @@ static char rcsid [] = "@(#$Id: conftree.cpp,v 1.3 2005-11-25 08:50:39 dockes Ex
#include "conftree.h"
#include "pathut.h"
#include "smallut.h"
#ifndef NO_NAMESPACES
using namespace std;
@@ -25,21 +26,6 @@ using std::list;
#define MIN(A,B) ((A)<(B) ? (A) : (B))
#endif
/** Remove instances of characters belonging to set (default {space,
tab}) at beginning and end of input string */
static void trimstring(string &s, const char *ws = " \t")
{
string::size_type pos = s.find_first_not_of(ws);
if (pos == string::npos) {
s = "";
return;
}
s.replace(0, pos, "");
pos = s.find_last_not_of(ws);
if (pos != string::npos && pos != s.length()-1)
s.replace(pos+1, string::npos, "");
}
#define LL 1024
void ConfSimple::parseinput(istream &input)
+15 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.9 2005-11-25 08:50:39 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.10 2005-11-25 14:36:45 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#ifndef TEST_SMALLUT
#include <string>
@@ -278,6 +278,20 @@ bool stringToBool(const string &s)
return false;
}
void trimstring(string &s, const char *ws)
{
string::size_type pos = s.find_first_not_of(ws);
if (pos == string::npos) {
s = "";
return;
}
s.replace(0, pos, "");
pos = s.find_last_not_of(ws);
if (pos != string::npos && pos != s.length()-1)
s.replace(pos+1, string::npos, "");
}
#else
#include <string>
+5 -1
View File
@@ -1,6 +1,6 @@
#ifndef _SMALLUT_H_INCLUDED_
#define _SMALLUT_H_INCLUDED_
/* @(#$Id: smallut.h,v 1.9 2005-11-25 08:50:39 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: smallut.h,v 1.10 2005-11-25 14:36:46 dockes Exp $ (C) 2004 J.F.Dockes */
#include <string>
#include <list>
@@ -29,4 +29,8 @@ extern bool stringToStrings(const string &s, std::list<string> &tokens);
extern bool stringToBool(const string &s);
/** Remove instances of characters belonging to set (default {space,
tab}) at beginning and end of input string */
extern void trimstring(string &s, const char *ws = " \t");
#endif /* _SMALLUT_H_INCLUDED_ */