Author: tabish
Date: Thu Aug  9 12:17:25 2007
New Revision: 564343

URL: http://svn.apache.org/viewvc?view=rev&rev=564343
Log: (empty)

Modified:
    
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.cpp
    
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.h

Modified: 
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.cpp
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.cpp?view=diff&rev=564343&r1=564342&r2=564343
==============================================================================
--- 
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.cpp
 (original)
+++ 
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.cpp
 Thu Aug  9 12:17:25 2007
@@ -24,6 +24,8 @@
 #include <decaf/lang/Float.h>
 #include <decaf/util/StringTokenizer.h>
 #include <decaf/lang/exceptions/NumberFormatException.h>
+#include <apr_pools.h>
+#include <apr_strmatch.h>
 
 using namespace decaf;
 using namespace decaf::util;
@@ -90,6 +92,15 @@
 
 
////////////////////////////////////////////////////////////////////////////////
 std::string* HexStringParser::getSegmentsFromHexString( const std::string& 
hexString ) {
+
+//    apr_pool_t* thePool = NULL;
+//    apr_pool_create( &thePool, NULL );
+//    apr_strmatch_pattern* pattern =
+//        apr_strmatch_precompile( thePool, HEX_PATTERN.c_str(), 0 );
+//
+//    std::vector<std::string> hexSegments;
+//
+
 
     // TODO
 //    Matcher matcher = PATTERN.matcher(hexString);

Modified: 
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.h
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.h?view=diff&rev=564343&r1=564342&r2=564343
==============================================================================
--- 
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.h
 (original)
+++ 
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/internal/util/HexStringParser.h
 Thu Aug  9 12:17:25 2007
@@ -186,18 +186,20 @@
             if( ( pos = target.find_first_of( find, 0 ) ) != std::string::npos 
) {
                 return target.replace( pos, find.length(), replace );
             }
+
+            return target;
         }
 
-        // TODO
         std::string& replaceAll( std::string& target,
                                  const std::string& find,
                                  const std::string& replace ) {
 
             std::string::size_type pos = std::string::npos;
-
-            if( ( pos = target.find_first_of( find, 0 ) ) != std::string::npos 
) {
-                return target.replace( pos, find.length(), replace );
+            while( ( pos = target.find( find ) ) != std::string::npos ) {
+                target.replace( pos, find.length(), replace );
             }
+
+            return target;
         }
 
     };


Reply via email to