activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r905091 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util: Properties.cpp Properties.h
Date Sun, 31 Jan 2010 18:28:57 GMT
Author: tabish
Date: Sun Jan 31 18:28:56 2010
New Revision: 905091

URL: http://svn.apache.org/viewvc?rev=905091&view=rev
Log:
Check the defaults for properties before giving up.

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

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp?rev=905091&r1=905090&r2=905091&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp Sun Jan 31
18:28:56 2010
@@ -43,6 +43,19 @@
 }}
 
 ////////////////////////////////////////////////////////////////////////////////
+namespace {
+
+    enum TokenState {
+        NONE = 0,
+        SLASH = 1,
+        CONTINUE = 2,
+        KEY_DONE = 3,
+        IGNOE = 4
+    };
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
 Properties::Properties() {
     this->internal.reset( new PropertiesInternal() );
 }
@@ -98,6 +111,8 @@
     synchronized( &( internal->properties ) ) {
         if( this->internal->properties.containsKey( name ) ) {
             return this->internal->properties.get( name ).c_str();
+        } else if( this->defaults != NULL && this->defaults->hasProperty(
name ) ) {
+            return this->defaults->getProperty( name );
         }
     }
 
@@ -111,6 +126,8 @@
     synchronized( &( internal->properties ) ) {
         if( this->internal->properties.containsKey( name ) ) {
             return this->internal->properties.get( name );
+        } else if( this->defaults != NULL && this->defaults->hasProperty(
name ) ) {
+            return this->defaults->getProperty( name );
         }
     }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.h?rev=905091&r1=905090&r2=905091&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.h Sun Jan 31 18:28:56
2010
@@ -18,7 +18,6 @@
 #ifndef _DECAF_UTIL_PROPERTIES_H_
 #define _DECAF_UTIL_PROPERTIES_H_
 
-#include <memory>
 #include <vector>
 #include <string>
 #include <decaf/util/Config.h>
@@ -26,6 +25,7 @@
 #include <decaf/io/OutputStream.h>
 #include <decaf/io/Reader.h>
 #include <decaf/io/Writer.h>
+#include <decaf/lang/Pointer.h>
 #include <decaf/lang/exceptions/IllegalArgumentException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 #include <decaf/io/IOException.h>
@@ -50,7 +50,7 @@
     class DECAF_API Properties{
     private:
 
-        std::auto_ptr<PropertiesInternal> internal;
+        decaf::lang::Pointer<PropertiesInternal> internal;
 
     protected:
 
@@ -58,7 +58,7 @@
          * Default list used to answer for any keys not found in the properties list, can
          * be filled in by another implementation of this class.
          */
-        std::auto_ptr<Properties> defaults;
+        decaf::lang::Pointer<Properties> defaults;
 
     public:
 



Mime
View raw message