X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fregmatch.cpp;fp=source%2Fregmatch.cpp;h=0000000000000000000000000000000000000000;hp=f81be1a5225b09886579df8a92582078609b2a61;hb=b42ed73a1b241c0e93ee03c43c4584b41c549bac;hpb=5b1368cb791cab043f0435628cacbaff36e39b7b diff --git a/source/regmatch.cpp b/source/regmatch.cpp deleted file mode 100644 index f81be1a..0000000 --- a/source/regmatch.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* $Id$ - -This file is part of libmspstrings -Copyright © 2007 Mikko Rasa -Distributed under the LGPL -*/ - -#include -#include "regmatch.h" - -using namespace std; - -namespace Msp { - -RegMatch::RegMatch(const string &str, const GroupArray &g): - groups(g) -{ - for(GroupArray::iterator i=groups.begin(); i!=groups.end(); ++i) - if(i->match) - { - i->length = i->end-i->begin; - i->str = str.substr(i->begin, i->length); - } -} - -const RegMatch::Group &RegMatch::group(unsigned i) const -{ - if(i>=groups.size()) - throw InvalidParameterValue("Group index out of range"); - return groups[i]; -} - -} // namespace Msp