Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54436 - /trunk/storage/libstorage/src/StorageTypes.h
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Wed, 07 Jan 2009 15:09:17 -0000
  • Message-id: <E1LKa21-0006VC-5S@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Wed Jan 7 16:09:16 2009
New Revision: 54436

URL: http://svn.opensuse.org/viewcvs/yast?rev=54436&view=rev
Log:
- removed unused functor
- use boost functions

Modified:
trunk/storage/libstorage/src/StorageTypes.h

Modified: trunk/storage/libstorage/src/StorageTypes.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageTypes.h?rev=54436&r1=54435&r2=54436&view=diff
==============================================================================
--- trunk/storage/libstorage/src/StorageTypes.h (original)
+++ trunk/storage/libstorage/src/StorageTypes.h Wed Jan 7 16:09:16 2009
@@ -1,7 +1,8 @@
#ifndef STORAGE_TYPES_H
#define STORAGE_TYPES_H

-#include <iostream>
+#include <ostream>
+#include <boost/algorithm/string.hpp>

#include "y2storage/Regex.h"
#include "y2storage/AppUtil.h"
@@ -130,13 +131,6 @@
};


-struct match_string
- {
- match_string(const string& t) : val(t) {}
- bool operator()(const string&s) { return s == val; }
- const string& val;
- };
-
struct match_regex
{
match_regex(const Regex& t) : r(t) {}
@@ -147,14 +141,14 @@
struct find_begin
{
find_begin(const string& t) : val(t) {}
- bool operator()(const string&s) { return s.find(val) == 0; }
+ bool operator()(const string& s) { return boost::starts_with(s, val); }
const string& val;
};

struct find_any
{
find_any(const string& t) : val(t) {}
- bool operator()(const string&s) { return s.find(val) != string::npos; }
+ bool operator()(const string& s) { return boost::contains(s, val); }
const string& val;
};


--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages