activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r556612 - /activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp
Date Mon, 16 Jul 2007 13:01:03 GMT
Author: tabish
Date: Mon Jul 16 06:01:02 2007
New Revision: 556612

URL: http://svn.apache.org/viewvc?view=rev&rev=556612
Log:
Code Cleanup

Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp?view=diff&rev=556612&r1=556611&r2=556612
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp Mon Jul
16 06:01:02 2007
@@ -25,8 +25,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 StringTokenizer::StringTokenizer( const std::string& str,
                                   const std::string& delim,
-                                  bool returnDelims )
-{
+                                  bool returnDelims ) {
     // store off the data
     this->str = str;
     this->delim = delim;
@@ -45,9 +44,9 @@
 {
     int count = 0;
     string::size_type localPos = pos;
-    string::size_type lastPos  = pos;
+    string::size_type lastPos = pos;
 
-    while(localPos != string::npos) {
+    while( localPos != string::npos ) {
 
         if( returnDelims && str.find_first_of( delim, localPos ) == localPos ) {
             count += 1;
@@ -58,10 +57,10 @@
         // Find first token by spanning the fist non-delimiter, to the
         // next delimiter, skipping any delimiters that are at the curret
         // location.
-        lastPos = str.find_first_not_of(delim, localPos);
-        localPos = str.find_first_of(delim, lastPos);
+        lastPos = str.find_first_not_of( delim, localPos );
+        localPos = str.find_first_of( delim, lastPos );
 
-        if(lastPos != string::npos) {
+        if( lastPos != string::npos ) {
             count++;
         }
     }
@@ -73,8 +72,8 @@
 bool StringTokenizer::hasMoreTokens() const
 {
     string::size_type nextpos =
-        returnDelims ? str.find_first_of(delim, pos) :
-                       str.find_first_not_of(delim, pos);
+        returnDelims ? str.find_first_of( delim, pos ) :
+                       str.find_first_not_of( delim, pos );
 
     return ( nextpos != string::npos );
 }
@@ -84,7 +83,6 @@
    throw ( lang::exceptions::NoSuchElementException )
 {
     if( pos == string::npos ) {
-
         throw NoSuchElementException(
             __FILE__, __LINE__,
             "StringTokenizer::nextToken - No more Tokens available");



Mime
View raw message