activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r419422 [3/11] - in /incubator/activemq/trunk/openwire-cpp/src/main/cpp: activemq/ activemq/command/ activemq/protocol/openwire/ activemq/transport/ activemq/transport/tcp/ cms/ ppr/ ppr/io/ ppr/io/encoding/ ppr/net/ ppr/thread/ ppr/util/
Date Thu, 06 Jul 2006 03:18:03 GMT
Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp Wed Jul  5 20:17:58 2006
@@ -1,463 +1,463 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQMapMessage.hpp"
-
-#include "ppr/io/ByteArrayOutputStream.hpp"
-#include "ppr/io/ByteArrayInputStream.hpp"
-#include "ppr/io/DataOutputStream.hpp"
-#include "ppr/io/DataInputStream.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQMapMessage::ActiveMQMapMessage()
-{
-    contentMap = new PropertyMap() ;
-}
-
-/*
- * 
- */
-ActiveMQMapMessage::~ActiveMQMapMessage()
-{
-}
-
-/*
- * 
- */
-unsigned char ActiveMQMapMessage::getDataStructureType()
-{
-    return ActiveMQMapMessage::TYPE ;
-}
-
-/*
- * 
- */
-p<PropertyMap> ActiveMQMapMessage::getBody()
-{
-    return contentMap ;
-}
-
-/*
- * 
- */
-bool ActiveMQMapMessage::getBoolean(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = string(name) ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No boolean value available for given key") ;
-
-    try
-    {
-        // Try to get value as a boolean
-        return tempIter->second.getBoolean() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*
- * 
- */
-void ActiveMQMapMessage::setBoolean(const char* name, bool value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    //contentMap->insert (pair<string,p<MapItemHolder> > (key, new MapItemHolder(value)));
-    (*contentMap)[key] = MapItemHolder(value);
-}
-
-/*
- * 
- */
-char ActiveMQMapMessage::getByte(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = string(name) ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No byte value available for given key") ;
-
-    try
-    {
-        // Try to get value as a byte
-        return tempIter->second.getByte() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*
- * 
- */
-void ActiveMQMapMessage::setByte(const char* name, char value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    (*contentMap)[key] = MapItemHolder(value);
-}
-
-/*
- * 
- */
-array<char> ActiveMQMapMessage::getBytes(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = string(name) ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No byte array value available for given key") ;
-
-    try
-    {
-        // Try to get value as a byte array
-        return tempIter->second.getBytes() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*
- * 
- */
-void ActiveMQMapMessage::setBytes(const char* name, array<char> value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    (*contentMap)[key] = MapItemHolder(value);
-}
-
-/*
- * 
- */
-double ActiveMQMapMessage::getDouble(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = name ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No double value available for given key") ;
-
-    try
-    {
-        // Try to get value as a double
-        return tempIter->second.getDouble() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*
- * 
- */
-void ActiveMQMapMessage::setDouble(const char* name, double value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- * 
- */
-float ActiveMQMapMessage::getFloat(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = name ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No float value available for given key") ;
-
-    try
-    {
-        // Try to get value as a float
-        return tempIter->second.getFloat() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*F
- * 
- */
-void ActiveMQMapMessage::setFloat(const char* name, float value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- * 
- */
-int ActiveMQMapMessage::getInt(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = name ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No integer value available for given key") ;
-
-    try
-    {
-        // Try to get value as an integer
-        return tempIter->second.getInt() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*
- * 
- */
-void ActiveMQMapMessage::setInt(const char* name, int value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- * 
- */
-long long ActiveMQMapMessage::getLong(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = name ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No long value available for given key") ;
-
-    try
-    {
-        // Try to get value as a long
-        return tempIter->second.getLong() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*
- * 
- */
-void ActiveMQMapMessage::setLong(const char* name, long long value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- * 
- */
-short ActiveMQMapMessage::getShort(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = name ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No short value available for given key") ;
-
-    try
-    {
-        // Try to get value as a short
-        return tempIter->second.getShort() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*
- * 
- */
-void ActiveMQMapMessage::setShort(const char* name, short value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- * 
- */
-p<string> ActiveMQMapMessage::getString(const char* name) throw (MessageFormatException, IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    PropertyMap::iterator tempIter ;
-    string key = name ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    if( tempIter == contentMap->end() )
-        throw MessageFormatException("No short value available for given key") ;
-
-    try
-    {
-        // Try to get value as a string
-        return tempIter->second.getString() ;
-    }
-    catch( ConversionException ce )
-    {
-        throw MessageFormatException( ce.what() ) ;
-    }
-}
-
-/*
- * 
- */
-void ActiveMQMapMessage::setString(const char* name, const char* value) throw (IllegalArgumentException)
-{
-    // Assert arguments
-    if( name == NULL || strcmp(name, "") == 0 )
-        throw IllegalArgumentException("Invalid key name") ;
-
-    string key = name ;
-    (*contentMap)[key] = MapItemHolder(value) ;
-}
-
-/*
- * 
- */
-array<string> ActiveMQMapMessage::getMapNames()
-{
-    PropertyMap::iterator tempIter ;
-    array<string> keyNames (contentMap->size()) ;
-    int        index = 0 ;
-
-    for( tempIter = contentMap->begin() ;
-         tempIter != contentMap->end() ;
-         tempIter++ )
-    {
-        keyNames[index++] = new string(tempIter->first) ;
-    }
-    return keyNames ;
-}
-
-/*
- * 
- */
-bool ActiveMQMapMessage::itemExists(const char* name)
-{
-    PropertyMap::iterator tempIter ;
-    string key = name ;
-
-    // Check if key exists in map
-    tempIter = contentMap->find(key) ;
-    return ( tempIter != contentMap->end() ) ? true : false ;
-}
-
-/*
- *
- */
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQMapMessage.hpp"
+
+#include "ppr/io/ByteArrayOutputStream.hpp"
+#include "ppr/io/ByteArrayInputStream.hpp"
+#include "ppr/io/DataOutputStream.hpp"
+#include "ppr/io/DataInputStream.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQMapMessage::ActiveMQMapMessage()
+{
+    contentMap = new PropertyMap() ;
+}
+
+/*
+ * 
+ */
+ActiveMQMapMessage::~ActiveMQMapMessage()
+{
+}
+
+/*
+ * 
+ */
+unsigned char ActiveMQMapMessage::getDataStructureType()
+{
+    return ActiveMQMapMessage::TYPE ;
+}
+
+/*
+ * 
+ */
+p<PropertyMap> ActiveMQMapMessage::getBody()
+{
+    return contentMap ;
+}
+
+/*
+ * 
+ */
+bool ActiveMQMapMessage::getBoolean(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = string(name) ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No boolean value available for given key") ;
+
+    try
+    {
+        // Try to get value as a boolean
+        return tempIter->second.getBoolean() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*
+ * 
+ */
+void ActiveMQMapMessage::setBoolean(const char* name, bool value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    //contentMap->insert (pair<string,p<MapItemHolder> > (key, new MapItemHolder(value)));
+    (*contentMap)[key] = MapItemHolder(value);
+}
+
+/*
+ * 
+ */
+char ActiveMQMapMessage::getByte(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = string(name) ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No byte value available for given key") ;
+
+    try
+    {
+        // Try to get value as a byte
+        return tempIter->second.getByte() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*
+ * 
+ */
+void ActiveMQMapMessage::setByte(const char* name, char value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    (*contentMap)[key] = MapItemHolder(value);
+}
+
+/*
+ * 
+ */
+array<char> ActiveMQMapMessage::getBytes(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = string(name) ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No byte array value available for given key") ;
+
+    try
+    {
+        // Try to get value as a byte array
+        return tempIter->second.getBytes() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*
+ * 
+ */
+void ActiveMQMapMessage::setBytes(const char* name, array<char> value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    (*contentMap)[key] = MapItemHolder(value);
+}
+
+/*
+ * 
+ */
+double ActiveMQMapMessage::getDouble(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = name ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No double value available for given key") ;
+
+    try
+    {
+        // Try to get value as a double
+        return tempIter->second.getDouble() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*
+ * 
+ */
+void ActiveMQMapMessage::setDouble(const char* name, double value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ * 
+ */
+float ActiveMQMapMessage::getFloat(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = name ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No float value available for given key") ;
+
+    try
+    {
+        // Try to get value as a float
+        return tempIter->second.getFloat() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*F
+ * 
+ */
+void ActiveMQMapMessage::setFloat(const char* name, float value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ * 
+ */
+int ActiveMQMapMessage::getInt(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = name ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No integer value available for given key") ;
+
+    try
+    {
+        // Try to get value as an integer
+        return tempIter->second.getInt() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*
+ * 
+ */
+void ActiveMQMapMessage::setInt(const char* name, int value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ * 
+ */
+long long ActiveMQMapMessage::getLong(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = name ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No long value available for given key") ;
+
+    try
+    {
+        // Try to get value as a long
+        return tempIter->second.getLong() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*
+ * 
+ */
+void ActiveMQMapMessage::setLong(const char* name, long long value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ * 
+ */
+short ActiveMQMapMessage::getShort(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = name ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No short value available for given key") ;
+
+    try
+    {
+        // Try to get value as a short
+        return tempIter->second.getShort() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*
+ * 
+ */
+void ActiveMQMapMessage::setShort(const char* name, short value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQMapMessage::getString(const char* name) throw (MessageFormatException, IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    PropertyMap::iterator tempIter ;
+    string key = name ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    if( tempIter == contentMap->end() )
+        throw MessageFormatException("No short value available for given key") ;
+
+    try
+    {
+        // Try to get value as a string
+        return tempIter->second.getString() ;
+    }
+    catch( ConversionException ce )
+    {
+        throw MessageFormatException( ce.what() ) ;
+    }
+}
+
+/*
+ * 
+ */
+void ActiveMQMapMessage::setString(const char* name, const char* value) throw (IllegalArgumentException)
+{
+    // Assert arguments
+    if( name == NULL || strcmp(name, "") == 0 )
+        throw IllegalArgumentException("Invalid key name") ;
+
+    string key = name ;
+    (*contentMap)[key] = MapItemHolder(value) ;
+}
+
+/*
+ * 
+ */
+array<string> ActiveMQMapMessage::getMapNames()
+{
+    PropertyMap::iterator tempIter ;
+    array<string> keyNames (contentMap->size()) ;
+    int        index = 0 ;
+
+    for( tempIter = contentMap->begin() ;
+         tempIter != contentMap->end() ;
+         tempIter++ )
+    {
+        keyNames[index++] = new string(tempIter->first) ;
+    }
+    return keyNames ;
+}
+
+/*
+ * 
+ */
+bool ActiveMQMapMessage::itemExists(const char* name)
+{
+    PropertyMap::iterator tempIter ;
+    string key = name ;
+
+    // Check if key exists in map
+    tempIter = contentMap->find(key) ;
+    return ( tempIter != contentMap->end() ) ? true : false ;
+}
+
+/*
+ *
+ */
 int ActiveMQMapMessage::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> ostream) throw (IOException)
 {
     int size = 0 ;
@@ -466,7 +466,7 @@
     if( mode == IMarshaller::MARSHAL_SIZE )
     {
         p<ByteArrayOutputStream> bos = new ByteArrayOutputStream() ;
-        p<DataOutputStream>      dos = new DataOutputStream( bos ) ;
+        p<DataOutputStream>      dos = new DataOutputStream( bos ) ;
 
         // Marshal map into a byte array
         marshaller->marshalMap(contentMap, IMarshaller::MARSHAL_WRITE, dos) ;
@@ -480,9 +480,9 @@
     return size ;
 }
 
-/*
- *
- */
+/*
+ *
+ */
 void ActiveMQMapMessage::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> istream) throw (IOException)
 {
     // Note! Message content unmarshalling is done in super class
@@ -492,7 +492,7 @@
     if( mode == IMarshaller::MARSHAL_READ )
     {
         p<ByteArrayInputStream> bis = new ByteArrayInputStream( this->content ) ;
-        p<DataInputStream>      dis = new DataInputStream( bis ) ;
+        p<DataInputStream>      dis = new DataInputStream( bis ) ;
 
         // Unmarshal map into a map
         contentMap = marshaller->unmarshalMap(mode, dis) ;

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp Wed Jul  5 20:17:58 2006
@@ -1,368 +1,368 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQMessage.hpp"
-
-#include "ppr/io/ByteArrayOutputStream.hpp"
-#include "ppr/io/ByteArrayInputStream.hpp"
-#include "ppr/io/DataOutputStream.hpp"
-#include "ppr/io/DataInputStream.hpp"
-
-using namespace apache::activemq::command;
-
-
-// Constructors -----------------------------------------------------
-
-
-// Attribute methods ------------------------------------------------
-
-/*
- * 
- */
-unsigned char ActiveMQMessage::getDataStructureType()
-{
-    return ActiveMQMessage::TYPE ;
-}
-
-/*
- * 
- */
-p<IDestination> ActiveMQMessage::getFromDestination()
-{
-    return this->destination ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setFromDestination(p<IDestination> destination)
-{
-    this->destination = p_dyncast<ActiveMQDestination> (destination) ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setAcknowledger(p<IAcknowledger> acknowledger) 
-{
-    this->acknowledger = acknowledger ;
-}
-
-/*
- * 
- */
-p<PropertyMap> ActiveMQMessage::getProperties()
-{
-    if( properties == NULL )
-        properties = new PropertyMap() ;
-
-    return properties;
-}
-
-/*
- * 
- */
-p<string> ActiveMQMessage::getJMSCorrelationID()
-{
-    return this->correlationId ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setJMSCorrelationID(const char* correlationId)
-{
-    this->correlationId = new string(correlationId) ;
-}
-
-/*
- * 
- */
-p<IDestination> ActiveMQMessage::getJMSDestination()
-{
-    return this->originalDestination ;
-}
-
-/*
- * 
- */
-long long ActiveMQMessage::getJMSExpiration()
-{
-    return this->expiration ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setJMSExpiration(long long time)
-{
-    this->expiration = time ;
-}
-
-/*
- * 
- */
-p<string> ActiveMQMessage::getJMSMessageID()
-{
-    p<string>     str ;
-    p<ProducerId> pid = this->getMessageId()->getProducerId() ;
-    char          buffer[256] ;
-
-    // Compose message id as a string
-#ifdef unix
-    sprintf(buffer, "%s:%lld:%lld:%lld", pid->getConnectionId()->c_str(),
-                                          pid->getSessionId(),
-                                          pid->getValue(),
-                                          messageId->getProducerSequenceId() ) ;
-#else
-    sprintf(buffer, "%s:%I64d:%I64d:%I64d", pid->getConnectionId()->c_str(),
-                                            pid->getSessionId(),
-                                            pid->getValue(),
-                                            messageId->getProducerSequenceId() ) ;
-#endif
-
-    str = new string(buffer) ;
-    return str ;
-}
-
-/*
- * 
- */
-bool ActiveMQMessage::getJMSPersistent()
-{
-    return this->persistent ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setJMSPersistent(bool persistent)
-{
-    this->persistent = persistent ;
-}
-
-/*
- * 
- */
-unsigned char ActiveMQMessage::getJMSPriority()
-{
-    return this->priority ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setJMSPriority(unsigned char priority)
-{
-    this->priority = priority ;
-}
-
-/*
- * 
- */
-bool ActiveMQMessage::getJMSRedelivered()
-{
-    return ( this->redeliveryCounter > 0 ) ? true : false ;
-}
-
-/*
- * 
- */
-p<IDestination> ActiveMQMessage::getJMSReplyTo()
-{
-    return this->replyTo ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setJMSReplyTo(p<IDestination> destination)
-{
-    this->replyTo = p_dyncast<ActiveMQDestination> (destination) ;
-
-}
-
-/*
- * 
- */
-long long ActiveMQMessage::getJMSTimestamp()
-{
-    return this->timestamp ;
-}
-
-/*
- * 
- */
-p<string> ActiveMQMessage::getJMSType()
-{
-    return this->type ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setJMSType(const char* type)
-{
-    this->type = new string(type) ;
-}
-
-/*
- * 
- */
-int ActiveMQMessage::getJMSXDeliveryCount()
-{
-    return this->redeliveryCounter + 1 ;
-}
-
-/*
- * 
- */
-p<string> ActiveMQMessage::getJMSXGroupID()
-{
-    return this->groupID ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setJMSXGroupID(const char* groupId)
-{
-    this->groupID = new string(groupId) ;
-}
-
-/*
- * 
- */
-int ActiveMQMessage::getJMSXGroupSeq()
-{
-    return this->groupSequence ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::setJMSXGroupSeq(int sequence)
-{
-    this->groupSequence = sequence ;
-}
-
-/*
- * 
- */
-p<string> ActiveMQMessage::getJMSXProducerTxID()
-{
-    p<TransactionId> txId = this->originalTransactionId ;
-    p<string>        str ;
-    
-    if( txId == NULL )
-        txId = this->transactionId ;
-
-    if( txId != NULL )
-    {
-        if( txId->getDataStructureType() == LocalTransactionId::TYPE )
-        {
-            p<LocalTransactionId> localTxId = p_cast<LocalTransactionId> (txId) ;
-            char buffer[256] ;
-
-            // Compose local transaction id string
-#ifdef unix
-            sprintf(buffer, "%lld", localTxId->getValue() ) ;
-#else
-            sprintf(buffer, "%I64d", localTxId->getValue() ) ;
-#endif
-
-            str = new string(buffer ) ;
-            return str  ;
-        }
-        else if( txId->getDataStructureType() == XATransactionId::TYPE )
-        {
-            p<XATransactionId> xaTxId = p_cast<XATransactionId> (txId) ;
-            char buffer[256] ;
-
-            // Compose XA transaction id string
-            sprintf(buffer, "XID:%d:%s:%s", xaTxId->getFormatId(),
-                                            Hex::toString( xaTxId->getGlobalTransactionId() )->c_str(),
-                                            Hex::toString( xaTxId->getBranchQualifier() )->c_str() ) ;
-
-            str = new string(buffer ) ;
-            return str  ;
-        }
-        return NULL ;
-    }
-    return NULL ;
-}
-
-
-// Operation methods ------------------------------------------------
-
-/*
- *
- */
-void ActiveMQMessage::acknowledge()
-{
-    if( acknowledger != NULL )
-        acknowledger->acknowledge(smartify(this)) ;
-}
-
-
-// Implementation methods -------------------------------------------
-
-/*
- * 
- */
-int ActiveMQMessage::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> ostream) throw(IOException)
-{
-    int size = 0 ;
-
-    // Update message content if available
-    if( mode == IMarshaller::MARSHAL_SIZE && this->properties != NULL )
-    {
-        p<ByteArrayOutputStream> bos = new ByteArrayOutputStream() ;
-        p<DataOutputStream>      dos = new DataOutputStream( bos ) ;
-
-        // Marshal properties into a byte array
-        marshaller->marshalMap(properties, IMarshaller::MARSHAL_WRITE, dos) ;
-
-        // Store properties byte array in message content
-        this->marshalledProperties = bos->toArray() ;
-    }
-    // Note! Message propertys marshalling is done in super class
-    size += Message::marshal(marshaller, mode, ostream) ;
-
-    return size ;
-}
-
-/*
- * 
- */
-void ActiveMQMessage::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> istream) throw(IOException)
-{
-    // Note! Message property unmarshalling is done in super class
-    Message::unmarshal(marshaller, mode, istream) ;
-
-    // Extract properties from message
-    if( mode == IMarshaller::MARSHAL_READ )
-    {
-        if( this->marshalledProperties != NULL )
-        {
-            p<ByteArrayInputStream> bis = new ByteArrayInputStream( this->marshalledProperties ) ;
-            p<DataInputStream>      dis = new DataInputStream( bis ) ;
-
-            // Unmarshal map into a map
-            properties = marshaller->unmarshalMap(mode, dis) ;
-        }
-    }
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQMessage.hpp"
+
+#include "ppr/io/ByteArrayOutputStream.hpp"
+#include "ppr/io/ByteArrayInputStream.hpp"
+#include "ppr/io/DataOutputStream.hpp"
+#include "ppr/io/DataInputStream.hpp"
+
+using namespace apache::activemq::command;
+
+
+// Constructors -----------------------------------------------------
+
+
+// Attribute methods ------------------------------------------------
+
+/*
+ * 
+ */
+unsigned char ActiveMQMessage::getDataStructureType()
+{
+    return ActiveMQMessage::TYPE ;
+}
+
+/*
+ * 
+ */
+p<IDestination> ActiveMQMessage::getFromDestination()
+{
+    return this->destination ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setFromDestination(p<IDestination> destination)
+{
+    this->destination = p_dyncast<ActiveMQDestination> (destination) ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setAcknowledger(p<IAcknowledger> acknowledger) 
+{
+    this->acknowledger = acknowledger ;
+}
+
+/*
+ * 
+ */
+p<PropertyMap> ActiveMQMessage::getProperties()
+{
+    if( properties == NULL )
+        properties = new PropertyMap() ;
+
+    return properties;
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQMessage::getJMSCorrelationID()
+{
+    return this->correlationId ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setJMSCorrelationID(const char* correlationId)
+{
+    this->correlationId = new string(correlationId) ;
+}
+
+/*
+ * 
+ */
+p<IDestination> ActiveMQMessage::getJMSDestination()
+{
+    return this->originalDestination ;
+}
+
+/*
+ * 
+ */
+long long ActiveMQMessage::getJMSExpiration()
+{
+    return this->expiration ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setJMSExpiration(long long time)
+{
+    this->expiration = time ;
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQMessage::getJMSMessageID()
+{
+    p<string>     str ;
+    p<ProducerId> pid = this->getMessageId()->getProducerId() ;
+    char          buffer[256] ;
+
+    // Compose message id as a string
+#ifdef unix
+    sprintf(buffer, "%s:%lld:%lld:%lld", pid->getConnectionId()->c_str(),
+                                          pid->getSessionId(),
+                                          pid->getValue(),
+                                          messageId->getProducerSequenceId() ) ;
+#else
+    sprintf(buffer, "%s:%I64d:%I64d:%I64d", pid->getConnectionId()->c_str(),
+                                            pid->getSessionId(),
+                                            pid->getValue(),
+                                            messageId->getProducerSequenceId() ) ;
+#endif
+
+    str = new string(buffer) ;
+    return str ;
+}
+
+/*
+ * 
+ */
+bool ActiveMQMessage::getJMSPersistent()
+{
+    return this->persistent ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setJMSPersistent(bool persistent)
+{
+    this->persistent = persistent ;
+}
+
+/*
+ * 
+ */
+unsigned char ActiveMQMessage::getJMSPriority()
+{
+    return this->priority ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setJMSPriority(unsigned char priority)
+{
+    this->priority = priority ;
+}
+
+/*
+ * 
+ */
+bool ActiveMQMessage::getJMSRedelivered()
+{
+    return ( this->redeliveryCounter > 0 ) ? true : false ;
+}
+
+/*
+ * 
+ */
+p<IDestination> ActiveMQMessage::getJMSReplyTo()
+{
+    return this->replyTo ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setJMSReplyTo(p<IDestination> destination)
+{
+    this->replyTo = p_dyncast<ActiveMQDestination> (destination) ;
+
+}
+
+/*
+ * 
+ */
+long long ActiveMQMessage::getJMSTimestamp()
+{
+    return this->timestamp ;
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQMessage::getJMSType()
+{
+    return this->type ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setJMSType(const char* type)
+{
+    this->type = new string(type) ;
+}
+
+/*
+ * 
+ */
+int ActiveMQMessage::getJMSXDeliveryCount()
+{
+    return this->redeliveryCounter + 1 ;
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQMessage::getJMSXGroupID()
+{
+    return this->groupID ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setJMSXGroupID(const char* groupId)
+{
+    this->groupID = new string(groupId) ;
+}
+
+/*
+ * 
+ */
+int ActiveMQMessage::getJMSXGroupSeq()
+{
+    return this->groupSequence ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::setJMSXGroupSeq(int sequence)
+{
+    this->groupSequence = sequence ;
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQMessage::getJMSXProducerTxID()
+{
+    p<TransactionId> txId = this->originalTransactionId ;
+    p<string>        str ;
+    
+    if( txId == NULL )
+        txId = this->transactionId ;
+
+    if( txId != NULL )
+    {
+        if( txId->getDataStructureType() == LocalTransactionId::TYPE )
+        {
+            p<LocalTransactionId> localTxId = p_cast<LocalTransactionId> (txId) ;
+            char buffer[256] ;
+
+            // Compose local transaction id string
+#ifdef unix
+            sprintf(buffer, "%lld", localTxId->getValue() ) ;
+#else
+            sprintf(buffer, "%I64d", localTxId->getValue() ) ;
+#endif
+
+            str = new string(buffer ) ;
+            return str  ;
+        }
+        else if( txId->getDataStructureType() == XATransactionId::TYPE )
+        {
+            p<XATransactionId> xaTxId = p_cast<XATransactionId> (txId) ;
+            char buffer[256] ;
+
+            // Compose XA transaction id string
+            sprintf(buffer, "XID:%d:%s:%s", xaTxId->getFormatId(),
+                                            Hex::toString( xaTxId->getGlobalTransactionId() )->c_str(),
+                                            Hex::toString( xaTxId->getBranchQualifier() )->c_str() ) ;
+
+            str = new string(buffer ) ;
+            return str  ;
+        }
+        return NULL ;
+    }
+    return NULL ;
+}
+
+
+// Operation methods ------------------------------------------------
+
+/*
+ *
+ */
+void ActiveMQMessage::acknowledge()
+{
+    if( acknowledger != NULL )
+        acknowledger->acknowledge(smartify(this)) ;
+}
+
+
+// Implementation methods -------------------------------------------
+
+/*
+ * 
+ */
+int ActiveMQMessage::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> ostream) throw(IOException)
+{
+    int size = 0 ;
+
+    // Update message content if available
+    if( mode == IMarshaller::MARSHAL_SIZE && this->properties != NULL )
+    {
+        p<ByteArrayOutputStream> bos = new ByteArrayOutputStream() ;
+        p<DataOutputStream>      dos = new DataOutputStream( bos ) ;
+
+        // Marshal properties into a byte array
+        marshaller->marshalMap(properties, IMarshaller::MARSHAL_WRITE, dos) ;
+
+        // Store properties byte array in message content
+        this->marshalledProperties = bos->toArray() ;
+    }
+    // Note! Message propertys marshalling is done in super class
+    size += Message::marshal(marshaller, mode, ostream) ;
+
+    return size ;
+}
+
+/*
+ * 
+ */
+void ActiveMQMessage::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> istream) throw(IOException)
+{
+    // Note! Message property unmarshalling is done in super class
+    Message::unmarshal(marshaller, mode, istream) ;
+
+    // Extract properties from message
+    if( mode == IMarshaller::MARSHAL_READ )
+    {
+        if( this->marshalledProperties != NULL )
+        {
+            p<ByteArrayInputStream> bis = new ByteArrayInputStream( this->marshalledProperties ) ;
+            p<DataInputStream>      dis = new DataInputStream( bis ) ;
+
+            // Unmarshal map into a map
+            properties = marshaller->unmarshalMap(mode, dis) ;
+        }
+    }
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp Wed Jul  5 20:17:58 2006
@@ -1,35 +1,35 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQObjectMessage.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQObjectMessage::ActiveMQObjectMessage()
-{
-}
-
-ActiveMQObjectMessage::~ActiveMQObjectMessage()
-{
-}
-
-unsigned char ActiveMQObjectMessage::getDataStructureType()
-{
-    return ActiveMQObjectMessage::TYPE ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQObjectMessage.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQObjectMessage::ActiveMQObjectMessage()
+{
+}
+
+ActiveMQObjectMessage::~ActiveMQObjectMessage()
+{
+}
+
+unsigned char ActiveMQObjectMessage::getDataStructureType()
+{
+    return ActiveMQObjectMessage::TYPE ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQObjectMessage.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp Wed Jul  5 20:17:58 2006
@@ -1,75 +1,75 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQQueue.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQQueue::ActiveMQQueue()
-   : ActiveMQDestination()
-{
-}
-
-/*
- * 
- */
-ActiveMQQueue::ActiveMQQueue(const char* name)
-   : ActiveMQDestination(name)
-{
-}
-
-/*
- * 
- */
-ActiveMQQueue::~ActiveMQQueue()
-{
-}
-
-/*
- * 
- */
-unsigned char ActiveMQQueue::getDataStructureType()
-{
-    return ActiveMQQueue::TYPE ; 
-}
-
-/*
- * 
- */
-p<string> ActiveMQQueue::getQueueName()
-{
-    return this->getPhysicalName() ;
-}
-
-/*
- * 
- */
-int ActiveMQQueue::getDestinationType()
-{
-    return ActiveMQDestination::ACTIVEMQ_QUEUE ;
-}
-
-/*
- * 
- */
-p<ActiveMQDestination> ActiveMQQueue::createDestination(const char* name)
-{
-    p<ActiveMQQueue> queue = new ActiveMQQueue(name) ;
-    return queue ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQQueue.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQQueue::ActiveMQQueue()
+   : ActiveMQDestination()
+{
+}
+
+/*
+ * 
+ */
+ActiveMQQueue::ActiveMQQueue(const char* name)
+   : ActiveMQDestination(name)
+{
+}
+
+/*
+ * 
+ */
+ActiveMQQueue::~ActiveMQQueue()
+{
+}
+
+/*
+ * 
+ */
+unsigned char ActiveMQQueue::getDataStructureType()
+{
+    return ActiveMQQueue::TYPE ; 
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQQueue::getQueueName()
+{
+    return this->getPhysicalName() ;
+}
+
+/*
+ * 
+ */
+int ActiveMQQueue::getDestinationType()
+{
+    return ActiveMQDestination::ACTIVEMQ_QUEUE ;
+}
+
+/*
+ * 
+ */
+p<ActiveMQDestination> ActiveMQQueue::createDestination(const char* name)
+{
+    p<ActiveMQQueue> queue = new ActiveMQQueue(name) ;
+    return queue ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQQueue.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp Wed Jul  5 20:17:58 2006
@@ -1,35 +1,35 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQStreamMessage.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQStreamMessage::ActiveMQStreamMessage()
-{
-}
-
-ActiveMQStreamMessage::~ActiveMQStreamMessage()
-{
-}
-
-unsigned char ActiveMQStreamMessage::getDataStructureType()
-{
-    return ActiveMQStreamMessage::TYPE ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQStreamMessage.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQStreamMessage::ActiveMQStreamMessage()
+{
+}
+
+ActiveMQStreamMessage::~ActiveMQStreamMessage()
+{
+}
+
+unsigned char ActiveMQStreamMessage::getDataStructureType()
+{
+    return ActiveMQStreamMessage::TYPE ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQStreamMessage.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp Wed Jul  5 20:17:58 2006
@@ -1,53 +1,53 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQTempDestination.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQTempDestination::ActiveMQTempDestination()
-   : ActiveMQDestination()
-{
-    // no-op
-}
-
-/*
- * 
- */
-ActiveMQTempDestination::ActiveMQTempDestination(const char* name)
-   : ActiveMQDestination(name)
-{
-    // no-op
-}
-
-/*
- * 
- */
-ActiveMQTempDestination::~ActiveMQTempDestination()
-{
-    // no-op
-}
-
-/*
- * 
- */
-unsigned char ActiveMQTempDestination::getDataStructureType()
-{
-    return ActiveMQTempDestination::TYPE ; 
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQTempDestination.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQTempDestination::ActiveMQTempDestination()
+   : ActiveMQDestination()
+{
+    // no-op
+}
+
+/*
+ * 
+ */
+ActiveMQTempDestination::ActiveMQTempDestination(const char* name)
+   : ActiveMQDestination(name)
+{
+    // no-op
+}
+
+/*
+ * 
+ */
+ActiveMQTempDestination::~ActiveMQTempDestination()
+{
+    // no-op
+}
+
+/*
+ * 
+ */
+unsigned char ActiveMQTempDestination::getDataStructureType()
+{
+    return ActiveMQTempDestination::TYPE ; 
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempDestination.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempQueue.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempQueue.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempQueue.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempQueue.cpp Wed Jul  5 20:17:58 2006
@@ -1,75 +1,75 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQTempQueue.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQTempQueue::ActiveMQTempQueue()
-   : ActiveMQTempDestination()
-{
-}
-
-/*
- * 
- */
-ActiveMQTempQueue::ActiveMQTempQueue(const char* name)
-   : ActiveMQTempDestination(name)
-{
-}
-
-/*
- * 
- */
-ActiveMQTempQueue::~ActiveMQTempQueue()
-{
-}
-
-/*
- * 
- */
-unsigned char ActiveMQTempQueue::getDataStructureType()
-{
-    return ActiveMQTempQueue::TYPE ; 
-}
-
-/*
- * 
- */
-p<string> ActiveMQTempQueue::getQueueName()
-{
-    return this->getPhysicalName() ;
-}
-
-/*
- * 
- */
-int ActiveMQTempQueue::getDestinationType()
-{
-    return ActiveMQDestination::ACTIVEMQ_QUEUE ;
-}
-
-/*
- * 
- */
-p<ActiveMQDestination> ActiveMQTempQueue::createDestination(const char* name)
-{
-    p<ActiveMQTempQueue> tempQueue = new ActiveMQTempQueue(name) ;
-    return tempQueue ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQTempQueue.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQTempQueue::ActiveMQTempQueue()
+   : ActiveMQTempDestination()
+{
+}
+
+/*
+ * 
+ */
+ActiveMQTempQueue::ActiveMQTempQueue(const char* name)
+   : ActiveMQTempDestination(name)
+{
+}
+
+/*
+ * 
+ */
+ActiveMQTempQueue::~ActiveMQTempQueue()
+{
+}
+
+/*
+ * 
+ */
+unsigned char ActiveMQTempQueue::getDataStructureType()
+{
+    return ActiveMQTempQueue::TYPE ; 
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQTempQueue::getQueueName()
+{
+    return this->getPhysicalName() ;
+}
+
+/*
+ * 
+ */
+int ActiveMQTempQueue::getDestinationType()
+{
+    return ActiveMQDestination::ACTIVEMQ_QUEUE ;
+}
+
+/*
+ * 
+ */
+p<ActiveMQDestination> ActiveMQTempQueue::createDestination(const char* name)
+{
+    p<ActiveMQTempQueue> tempQueue = new ActiveMQTempQueue(name) ;
+    return tempQueue ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempQueue.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempTopic.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempTopic.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempTopic.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempTopic.cpp Wed Jul  5 20:17:58 2006
@@ -1,75 +1,75 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQTempTopic.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQTempTopic::ActiveMQTempTopic()
-   : ActiveMQTempDestination()
-{
-}
-
-/*
- * 
- */
-ActiveMQTempTopic::ActiveMQTempTopic(const char* name)
-   : ActiveMQTempDestination(name)
-{
-}
-
-/*
- * 
- */
-ActiveMQTempTopic::~ActiveMQTempTopic()
-{
-}
-
-/*
- * 
- */
-unsigned char ActiveMQTempTopic::getDataStructureType()
-{
-    return ActiveMQTempTopic::TYPE ; 
-}
-
-/*
- * 
- */
-p<string> ActiveMQTempTopic::getTopicName()
-{
-    return this->getPhysicalName() ;
-}
-
-/*
- * 
- */
-int ActiveMQTempTopic::getDestinationType()
-{
-    return ActiveMQDestination::ACTIVEMQ_TOPIC ;
-}
-
-/*
- * 
- */
-p<ActiveMQDestination> ActiveMQTempTopic::createDestination(const char* name)
-{
-    p<ActiveMQTempTopic> tempTopic = new ActiveMQTempTopic(name) ;
-    return tempTopic ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQTempTopic.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQTempTopic::ActiveMQTempTopic()
+   : ActiveMQTempDestination()
+{
+}
+
+/*
+ * 
+ */
+ActiveMQTempTopic::ActiveMQTempTopic(const char* name)
+   : ActiveMQTempDestination(name)
+{
+}
+
+/*
+ * 
+ */
+ActiveMQTempTopic::~ActiveMQTempTopic()
+{
+}
+
+/*
+ * 
+ */
+unsigned char ActiveMQTempTopic::getDataStructureType()
+{
+    return ActiveMQTempTopic::TYPE ; 
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQTempTopic::getTopicName()
+{
+    return this->getPhysicalName() ;
+}
+
+/*
+ * 
+ */
+int ActiveMQTempTopic::getDestinationType()
+{
+    return ActiveMQDestination::ACTIVEMQ_TOPIC ;
+}
+
+/*
+ * 
+ */
+p<ActiveMQDestination> ActiveMQTempTopic::createDestination(const char* name)
+{
+    p<ActiveMQTempTopic> tempTopic = new ActiveMQTempTopic(name) ;
+    return tempTopic ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTempTopic.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp Wed Jul  5 20:17:58 2006
@@ -1,121 +1,121 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQTextMessage.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQTextMessage::ActiveMQTextMessage()
-{
-    encoder = CharsetEncoderRegistry::getEncoder() ;
-    setText(NULL) ;
-}
-
-/*
- * 
- */
-ActiveMQTextMessage::ActiveMQTextMessage(const char* text)
-{
-    encoder = CharsetEncoderRegistry::getEncoder() ;
-    setText(text) ;
-}
-
-/*
- * 
- */
-ActiveMQTextMessage::ActiveMQTextMessage(const char* text, const char* encname)
-{
-    encoder = CharsetEncoderRegistry::getEncoder(encname) ;
-    setText(text) ;
-}
-
-/*
- * 
- */
-ActiveMQTextMessage::~ActiveMQTextMessage()
-{
-}
-
-/*
- * 
- */
-unsigned char ActiveMQTextMessage::getDataStructureType()
-{
-    return ActiveMQTextMessage::TYPE ;
-}
-
-/*
- * 
- */
-p<string> ActiveMQTextMessage::getText()
-{
-    // Extract text from message content
-    if( this->content.size() > 0 )
-    {
-        p<string> value ;
-
-        // Use undecoded string, skip string length
-        value = new string( this->content.c_array() + sizeof(int), this->content.size() - sizeof(int) ) ;
-
-        // Decode string if an encoder has been set up
-        if( encoder != NULL )
-            value = encoder->decode( value ) ;
-
-        return value ;
-    }
-    return NULL ;
-}
-
-/*
- * 
- */
-void ActiveMQTextMessage::setText(const char* text)
-{
-    if( text != NULL )
-    {
-        p<DataOutputStream>      dos ;
-        p<ByteArrayOutputStream> bos ;
-        p<string>                value ;
-        int                      length ;
-
-        // Set up in-memory streams
-        bos = new ByteArrayOutputStream() ;
-        dos = new DataOutputStream( bos ) ;
-
-        // Encode string if an encoder has been set up
-        if( encoder != NULL )
-        {
-            // Encode string
-            value = encoder->encode( p<string> (new string(text)), &length) ;
-        }
-        else   // ...use unencoded string
-        {
-            length = (int)strlen(text) ;
-            value  = new string(text) ;
-        }
-        // Prepend data with the string length (4 bytes)
-        dos->writeInt( length ) ;
-        dos->write( value->c_str(), 0, length ) ;
-
-        // Finally, store text in content holder
-        this->content = bos->toArray() ;
-    }
-    else
-        this->content = NULL ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQTextMessage.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQTextMessage::ActiveMQTextMessage()
+{
+    encoder = CharsetEncoderRegistry::getEncoder() ;
+    setText(NULL) ;
+}
+
+/*
+ * 
+ */
+ActiveMQTextMessage::ActiveMQTextMessage(const char* text)
+{
+    encoder = CharsetEncoderRegistry::getEncoder() ;
+    setText(text) ;
+}
+
+/*
+ * 
+ */
+ActiveMQTextMessage::ActiveMQTextMessage(const char* text, const char* encname)
+{
+    encoder = CharsetEncoderRegistry::getEncoder(encname) ;
+    setText(text) ;
+}
+
+/*
+ * 
+ */
+ActiveMQTextMessage::~ActiveMQTextMessage()
+{
+}
+
+/*
+ * 
+ */
+unsigned char ActiveMQTextMessage::getDataStructureType()
+{
+    return ActiveMQTextMessage::TYPE ;
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQTextMessage::getText()
+{
+    // Extract text from message content
+    if( this->content.size() > 0 )
+    {
+        p<string> value ;
+
+        // Use undecoded string, skip string length
+        value = new string( this->content.c_array() + sizeof(int), this->content.size() - sizeof(int) ) ;
+
+        // Decode string if an encoder has been set up
+        if( encoder != NULL )
+            value = encoder->decode( value ) ;
+
+        return value ;
+    }
+    return NULL ;
+}
+
+/*
+ * 
+ */
+void ActiveMQTextMessage::setText(const char* text)
+{
+    if( text != NULL )
+    {
+        p<DataOutputStream>      dos ;
+        p<ByteArrayOutputStream> bos ;
+        p<string>                value ;
+        int                      length ;
+
+        // Set up in-memory streams
+        bos = new ByteArrayOutputStream() ;
+        dos = new DataOutputStream( bos ) ;
+
+        // Encode string if an encoder has been set up
+        if( encoder != NULL )
+        {
+            // Encode string
+            value = encoder->encode( p<string> (new string(text)), &length) ;
+        }
+        else   // ...use unencoded string
+        {
+            length = (int)strlen(text) ;
+            value  = new string(text) ;
+        }
+        // Prepend data with the string length (4 bytes)
+        dos->writeInt( length ) ;
+        dos->write( value->c_str(), 0, length ) ;
+
+        // Finally, store text in content holder
+        this->content = bos->toArray() ;
+    }
+    else
+        this->content = NULL ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTopic.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTopic.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTopic.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTopic.cpp Wed Jul  5 20:17:58 2006
@@ -1,75 +1,75 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/ActiveMQTopic.hpp"
-
-using namespace apache::activemq::command;
-
-/*
- * 
- */
-ActiveMQTopic::ActiveMQTopic()
-   : ActiveMQDestination()
-{
-}
-
-/*
- * 
- */
-ActiveMQTopic::ActiveMQTopic(const char* name)
-   : ActiveMQDestination(name)
-{
-}
-
-/*
- * 
- */
-ActiveMQTopic::~ActiveMQTopic()
-{
-}
-
-/*
- * 
- */
-unsigned char ActiveMQTopic::getDataStructureType()
-{
-    return ActiveMQTopic::TYPE ; 
-}
-
-/*
- * 
- */
-p<string> ActiveMQTopic::getTopicName()
-{
-    return this->getPhysicalName() ;
-}
-
-/*
- * 
- */
-int ActiveMQTopic::getDestinationType()
-{
-    return ActiveMQDestination::ACTIVEMQ_TOPIC ;
-}
-
-/*
- * 
- */
-p<ActiveMQDestination> ActiveMQTopic::createDestination(const char* name)
-{
-    p<ActiveMQTopic> topic = new ActiveMQTopic(name) ;
-    return topic ;
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/ActiveMQTopic.hpp"
+
+using namespace apache::activemq::command;
+
+/*
+ * 
+ */
+ActiveMQTopic::ActiveMQTopic()
+   : ActiveMQDestination()
+{
+}
+
+/*
+ * 
+ */
+ActiveMQTopic::ActiveMQTopic(const char* name)
+   : ActiveMQDestination(name)
+{
+}
+
+/*
+ * 
+ */
+ActiveMQTopic::~ActiveMQTopic()
+{
+}
+
+/*
+ * 
+ */
+unsigned char ActiveMQTopic::getDataStructureType()
+{
+    return ActiveMQTopic::TYPE ; 
+}
+
+/*
+ * 
+ */
+p<string> ActiveMQTopic::getTopicName()
+{
+    return this->getPhysicalName() ;
+}
+
+/*
+ * 
+ */
+int ActiveMQTopic::getDestinationType()
+{
+    return ActiveMQDestination::ACTIVEMQ_TOPIC ;
+}
+
+/*
+ * 
+ */
+p<ActiveMQDestination> ActiveMQTopic::createDestination(const char* name)
+{
+    p<ActiveMQTopic> topic = new ActiveMQTopic(name) ;
+    return topic ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTopic.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp?rev=419422&r1=419421&r2=419422&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp (original)
+++ incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp Wed Jul  5 20:17:58 2006
@@ -1,120 +1,120 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "activemq/command/BaseCommand.hpp"
-
-using namespace apache::activemq::command;
-
-
-// Attribute methods ------------------------------------------------
-
-/*
- * 
- */
-int BaseCommand::getCommandId()
-{
-    return commandId ; 
-}
-
-/*
- * 
- */
-void BaseCommand::setCommandId(int id)
-{
-    commandId = id ; 
-}
-
-/*
- * 
- */
-bool BaseCommand::getResponseRequired()
-{
-    return responseRequired ;
-}
-
-/*
- * 
- */
-void BaseCommand::setResponseRequired(bool value)
-{
-    responseRequired = value ;
-}
-
-/*
- * 
- */
-int BaseCommand::getHashCode()
-{
-    return ( commandId * 38 ) + BaseDataStructure::getDataStructureType() ;
-}
-
-
-// Operation methods ------------------------------------------------
-
-/*
- * 
- */
-int BaseCommand::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> ostream) throw(IOException)
-{
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "activemq/command/BaseCommand.hpp"
+
+using namespace apache::activemq::command;
+
+
+// Attribute methods ------------------------------------------------
+
+/*
+ * 
+ */
+int BaseCommand::getCommandId()
+{
+    return commandId ; 
+}
+
+/*
+ * 
+ */
+void BaseCommand::setCommandId(int id)
+{
+    commandId = id ; 
+}
+
+/*
+ * 
+ */
+bool BaseCommand::getResponseRequired()
+{
+    return responseRequired ;
+}
+
+/*
+ * 
+ */
+void BaseCommand::setResponseRequired(bool value)
+{
+    responseRequired = value ;
+}
+
+/*
+ * 
+ */
+int BaseCommand::getHashCode()
+{
+    return ( commandId * 38 ) + BaseDataStructure::getDataStructureType() ;
+}
+
+
+// Operation methods ------------------------------------------------
+
+/*
+ * 
+ */
+int BaseCommand::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> ostream) throw(IOException)
+{
     int size = 0 ;
 
     size += marshaller->marshalInt(commandId, mode, ostream) ;
     size += marshaller->marshalBoolean(responseRequired, mode, ostream) ; 
-
-    return size ;
-}
-
-/*
- * 
- */
-void BaseCommand::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> istream) throw(IOException)
-{
+
+    return size ;
+}
+
+/*
+ * 
+ */
+void BaseCommand::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> istream) throw(IOException)
+{
     commandId = marshaller->unmarshalInt(mode, istream) ;
     responseRequired = marshaller->unmarshalBoolean(mode, istream) ; 
-}
-
-/*
- * 
- */
-bool BaseCommand::operator== (BaseCommand& that)
-{
-    if( BaseDataStructure::getDataStructureType() == ((BaseDataStructure)that).getDataStructureType() &&
-        this->commandId == that.commandId )
-    {
-        return true ;
-    }
-    return false ;
-}
-
-/*
- * 
- */
-p<string> BaseCommand::toString()
-{
-    p<string> str = new string() ;
-    char      buffer[10] ;
-    
-    str->assign( BaseDataStructure::getDataStructureTypeAsString( BaseDataStructure::getDataStructureType() )->c_str() ) ;
-
-    if( str->length() == 0 )
-        str->assign("") ;
-
-    str->append(": id = ") ;
-	sprintf(buffer, "%d", commandId) ;
-    str->append( buffer ) ;
-
-    return str ;
-}
+}
+
+/*
+ * 
+ */
+bool BaseCommand::operator== (BaseCommand& that)
+{
+    if( BaseDataStructure::getDataStructureType() == ((BaseDataStructure)that).getDataStructureType() &&
+        this->commandId == that.commandId )
+    {
+        return true ;
+    }
+    return false ;
+}
+
+/*
+ * 
+ */
+p<string> BaseCommand::toString()
+{
+    p<string> str = new string() ;
+    char      buffer[10] ;
+    
+    str->assign( BaseDataStructure::getDataStructureTypeAsString( BaseDataStructure::getDataStructureType() )->c_str() ) ;
+
+    if( str->length() == 0 )
+        str->assign("") ;
+
+    str->append(": id = ") ;
+	sprintf(buffer, "%d", commandId) ;
+    str->append( buffer ) ;
+
+    return str ;
+}

Propchange: incubator/activemq/trunk/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message