|
Boost-Commit : |
From: john_at_[hidden]
Date: 2007-10-22 12:14:02
Author: johnmaddock
Date: 2007-10-22 12:14:02 EDT (Mon, 22 Oct 2007)
New Revision: 40288
URL: http://svn.boost.org/trac/boost/changeset/40288
Log:
Simplified regex usage.
Text files modified:
trunk/tools/bcp/scan_cvs_path.cpp | 27 +++------------------------
1 files changed, 3 insertions(+), 24 deletions(-)
Modified: trunk/tools/bcp/scan_cvs_path.cpp
==============================================================================
--- trunk/tools/bcp/scan_cvs_path.cpp (original)
+++ trunk/tools/bcp/scan_cvs_path.cpp 2007-10-22 12:14:02 EDT (Mon, 22 Oct 2007)
@@ -123,31 +123,10 @@
if(fs::exists(properties))
{
fileview prop(properties);
- boost::regex_token_iterator<const char*>
- mime_it(prop.begin(), prop.end(), entry_line_expression, 1);
- bool have_mime = false;
-
- while(mime_it != j)
- {
- std::string prop = mime_it->str();
- if(prop == "svn:mime-type")
- {
- have_mime = true;
- if(++mime_it != j && ++mime_it != j &&
- mime_it->str().find("text/") != 0)
- {
- binary = true;
- }
- }
- ++mime_it;
- }
- /*
- if(!have_mime)
- {
- std::cerr << "CAUTION: file " << fpath << " does not have a mime type set." << std::endl;
- }
- */
+ static const boost::regex mime_type(
+ "svn:mime-type[[:blank:]]*(?:\\n|\\r|\\r\\n)[^\\r\\n]*(?:\\n|\\r|\\r\\n)[[:blank:]]*text/");
+ binary = regex_search(prop.begin(), prop.end(), mime_type) ? false : true;
}
}
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk