[complement-svn] SF.net SVN: complement:[1965] trunk/complement/explore
Status: Pre-Alpha
Brought to you by:
complement
|
From: <com...@us...> - 2008-09-08 19:57:51
|
Revision: 1965
http://complement.svn.sourceforge.net/complement/?rev=1965&view=rev
Author: complement
Date: 2008-09-08 19:57:49 +0000 (Mon, 08 Sep 2008)
Log Message:
-----------
add const to some auxilary functions; libmisc version 1.10.2
Modified Paths:
--------------
trunk/complement/explore/include/misc/opts.h
trunk/complement/explore/lib/misc/ChangeLog
trunk/complement/explore/lib/misc/Makefile.inc
trunk/complement/explore/lib/misc/opts.cc
Modified: trunk/complement/explore/include/misc/opts.h
===================================================================
--- trunk/complement/explore/include/misc/opts.h 2008-09-08 19:56:25 UTC (rev 1964)
+++ trunk/complement/explore/include/misc/opts.h 2008-09-08 19:57:49 UTC (rev 1965)
@@ -469,8 +469,8 @@
bool isterm( const std::string& s );
bool is_opt_name( const std::string& s );
bool is_flag_group( const std::string& s );
- bool is_substr(const std::string& small, const std::string& big );
- options_container_type::const_iterator get_opt_index( const std::string& s );
+ bool is_substr(const std::string& small, const std::string& big ) const;
+ options_container_type::const_iterator get_opt_index( const std::string& s ) const;
};
template < class T , class V >
Modified: trunk/complement/explore/lib/misc/ChangeLog
===================================================================
--- trunk/complement/explore/lib/misc/ChangeLog 2008-09-08 19:56:25 UTC (rev 1964)
+++ trunk/complement/explore/lib/misc/ChangeLog 2008-09-08 19:57:49 UTC (rev 1965)
@@ -1,8 +1,12 @@
2008-09-08 Petr Ovtchenkov <pt...@vo...>
* type_traits.h: add enable_if, conditional and decay;
- useful when no STLport and gcc before 4.x.
+ useful when no STLport and gcc before 4.x;
+ * opts.h, opts.cc: add const to some auxilary functions;
+
+ * libmisc: version 1.10.2.
+
2008-07-21 Petr Ovtchenkov <pt...@is...>
* type_traits.h: fix STLport version; use type_traits
Modified: trunk/complement/explore/lib/misc/Makefile.inc
===================================================================
--- trunk/complement/explore/lib/misc/Makefile.inc 2008-09-08 19:56:25 UTC (rev 1964)
+++ trunk/complement/explore/lib/misc/Makefile.inc 2008-09-08 19:57:49 UTC (rev 1965)
@@ -1,4 +1,4 @@
-# -*- Makefile -*- Time-stamp: <08/06/30 10:25:33 ptr>
+# -*- Makefile -*- Time-stamp: <08/09/08 23:48:21 ptr>
# I have only one reason while I should use "C++" variant of MD5 instead of "C":
# names like MD5Init is wide distributed, but some cool programmers use this
@@ -10,6 +10,6 @@
LIBNAME = misc
MAJOR = 1
MINOR = 10
-PATCH = 1
+PATCH = 2
SRC_CC = CyrMoney.cc args.cc arguments.cc opts.cc
SRC_C = md5.c
Modified: trunk/complement/explore/lib/misc/opts.cc
===================================================================
--- trunk/complement/explore/lib/misc/opts.cc 2008-09-08 19:56:25 UTC (rev 1964)
+++ trunk/complement/explore/lib/misc/opts.cc 2008-09-08 19:57:49 UTC (rev 1965)
@@ -128,13 +128,19 @@
return (s.size() > 1) && (s[0] == '-') && !is_flag_group(s);
}
-bool Opts::is_substr(const string& small,const string& big)
+bool Opts::is_substr( const string& small, const string& big ) const
{
- if (small.size() > big.size())
+ if ( small.size() > big.size() ) {
return false;
- for (int i = 0;i < small.size();i++)
- if (small[i] != big[i])
+ }
+
+ string::const_iterator i = small.begin();
+ string::const_iterator j = big.begin();
+ for ( ; i != small.end(); ++i, ++j ) {
+ if ( *i != *j ) {
return false;
+ }
+ }
return true;
}
@@ -155,9 +161,9 @@
}
// this function assumes that is_opt_name(s) = true;
-Opts::options_container_type::const_iterator Opts::get_opt_index( const string& s)
+Opts::options_container_type::const_iterator Opts::get_opt_index( const string& s) const
{
- assert(is_opt_name(s));
+ // assert(is_opt_name(s));
if (s.size() == 2 && isalnum(s[1]) ) { // is short name
options_container_type::const_iterator i = storage.begin();
for ( ; i != storage.end(); ++i ) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|