activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1393808 [3/3] - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/
Date Wed, 03 Oct 2012 23:10:48 GMT
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.cpp?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.cpp Wed Oct  3 23:10:47
2012
@@ -38,11 +38,8 @@ Reader::~Reader() {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Reader::mark( int readAheadLimit DECAF_UNUSED ) {
-
-    throw IOException(
-        __FILE__, __LINE__,
-        "Default implementation of Reader, mark not supported." );
+void Reader::mark(int readAheadLimit DECAF_UNUSED) {
+    throw IOException(__FILE__, __LINE__, "Default implementation of Reader, mark not supported.");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -52,175 +49,171 @@ bool Reader::ready() const {
 
 ////////////////////////////////////////////////////////////////////////////////
 void Reader::reset() {
-
-    throw IOException(
-        __FILE__, __LINE__,
-        "Default implementation of Reader, reset not supported." );
+    throw IOException(__FILE__, __LINE__, "Default implementation of Reader, reset not supported.");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-long long Reader::skip( long long count ) {
+long long Reader::skip(long long count) {
 
-    try{
+    try {
 
         long long skipped = 0;
-        int toRead = count < 512 ? (int)count : 512;
+        int toRead = count < 512 ? (int) count : 512;
 
-        std::vector<char> charsSkipped( toRead );
+        std::vector<char> charsSkipped(toRead);
 
-        while( skipped < count ) {
+        while (skipped < count) {
 
-            int read = this->doReadArrayBounded( &charsSkipped[0], (int)charsSkipped.size(),
0, toRead );
+            int read = this->doReadArrayBounded(&charsSkipped[0], (int) charsSkipped.size(),
0, toRead);
 
-            if( read == -1 ) {
+            if (read == -1) {
                 return skipped;
             }
 
             skipped += read;
 
-            if( read < toRead ) {
+            if (read < toRead) {
                 return skipped;
             }
 
-            if( count - skipped < (long long)toRead ) {
-                toRead = (int)( count - skipped );
+            if (count - skipped < (long long) toRead) {
+                toRead = (int) (count - skipped);
             }
         }
 
         return skipped;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int Reader::read( std::vector<char>& buffer ) {
+int Reader::read(std::vector<char>& buffer) {
 
-    try{
-        return this->doReadVector( buffer );
+    try {
+        return this->doReadVector(buffer);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int Reader::read( char* buffer, int length ) {
+int Reader::read(char* buffer, int length) {
 
-    try{
-        return this->doReadArray( buffer, length );
+    try {
+        return this->doReadArray(buffer, length);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int Reader::read( char* buffer, int size, int offset, int length ) {
+int Reader::read(char* buffer, int size, int offset, int length) {
 
-    try{
-        return this->doReadArrayBounded( buffer, size, offset, length );
+    try {
+        return this->doReadArrayBounded(buffer, size, offset, length);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int Reader::read() {
 
-    try{
+    try {
         return this->doReadChar();
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int Reader::read( decaf::nio::CharBuffer* charBuffer ) {
+int Reader::read(decaf::nio::CharBuffer* charBuffer) {
 
-    try{
+    try {
         // Error checking is done in the Impl.
-        return this->doReadCharBuffer( charBuffer );
+        return this->doReadCharBuffer(charBuffer);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCH_RETHROW( ReadOnlyBufferException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCH_RETHROW(ReadOnlyBufferException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int Reader::doReadVector( std::vector<char>& buffer ) {
+int Reader::doReadVector(std::vector<char>& buffer) {
 
-    try{
+    try {
 
-        if( buffer.size() == 0 ) {
+        if (buffer.size() == 0) {
             return -1;
         }
 
-        return this->doReadArrayBounded( &buffer[0], (int)buffer.size(), 0, (int)buffer.size()
);
+        return this->doReadArrayBounded(&buffer[0], (int) buffer.size(), 0, (int)
buffer.size());
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int Reader::doReadArray( char* buffer, int length ) {
+int Reader::doReadArray(char* buffer, int length) {
 
-    try{
+    try {
 
-        if( length == 0 ) {
+        if (length == 0) {
             return 0;
         }
 
-        return this->doReadArrayBounded( buffer, length, 0, length );
+        return this->doReadArrayBounded(buffer, length, 0, length);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int Reader::doReadChar() {
 
-    try{
+    try {
 
         char buffer;
 
-        if( this->doReadArrayBounded( &buffer, 1, 0, 1 ) == -1 ) {
+        if (this->doReadArrayBounded(&buffer, 1, 0, 1) == -1) {
             return -1;
         }
 
         return buffer;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int Reader::doReadCharBuffer( decaf::nio::CharBuffer* charBuffer ) {
+int Reader::doReadCharBuffer(decaf::nio::CharBuffer* charBuffer) {
 
-    try{
+    if (charBuffer == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "Pointer to CharBuffer cannot be NULL.");
+    }
 
-        if( charBuffer == NULL ) {
-            throw NullPointerException(
-                __FILE__, __LINE__, "Pointer to CharBuffer cannot be NULL." );
-        }
+    try {
 
-        if( charBuffer->length() == 0 ) {
+        if (charBuffer->length() == 0) {
             return 0;
         }
 
-        int length = (int)charBuffer->length();
+        int length = (int) charBuffer->length();
 
-        std::vector<char> buffer( length );
+        std::vector<char> buffer(length);
 
-        length = Math::min( length, this->doReadVector( buffer ) );
+        length = Math::min(length, this->doReadVector(buffer));
 
-        if( length > 0 ) {
-            charBuffer->put( &buffer[0], (int)buffer.size() , 0, length );
+        if (length > 0) {
+            charBuffer->put(&buffer[0], (int) buffer.size(), 0, length);
         }
 
         return length;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCH_RETHROW( ReadOnlyBufferException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCH_RETHROW(ReadOnlyBufferException)
+    DECAF_CATCHALL_THROW(IOException)
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.h Wed Oct  3 23:10:47
2012
@@ -37,12 +37,11 @@ namespace io{
      *
      * @since 1.0
      */
-    class DECAF_API Reader : public virtual decaf::io::Closeable,
-                             public virtual decaf::lang::Readable {
+    class DECAF_API Reader: public virtual decaf::io::Closeable, public virtual decaf::lang::Readable
{
     private:
 
-        Reader( const Reader& );
-        Reader& operator= ( const Reader& );
+        Reader(const Reader&);
+        Reader& operator=(const Reader&);
 
     protected:
 
@@ -63,7 +62,7 @@ namespace io{
          *
          * @throw IOException if an I/O error occurs, or the stream does not support mark.
          */
-        virtual void mark( int readAheadLimit );
+        virtual void mark(int readAheadLimit);
 
         /**
          * Tells whether this stream supports the mark() operation. The default implementation
@@ -107,7 +106,7 @@ namespace io{
          *
          * @throw IOException if an I/O error occurs.
          */
-        virtual long long skip( long long count );
+        virtual long long skip(long long count);
 
         /**
          * Reads characters into an array. This method will block until some input is available,
@@ -120,7 +119,7 @@ namespace io{
          *
          * @throws IOException thrown if an I/O error occurs.
          */
-        virtual int read( std::vector<char>& buffer );
+        virtual int read(std::vector<char>& buffer);
 
         /**
          * Reads characters into an array, the method will attempt to read as much data as
the size
@@ -137,7 +136,7 @@ namespace io{
          * @throws IOException thrown if an I/O error occurs.
          * @throws NullPointerException if buffer is NULL.
          */
-        virtual int read( char* buffer, int size );
+        virtual int read(char* buffer, int size);
 
         /**
          * Reads characters into a portion of an array. This method will block until some
input
@@ -158,7 +157,7 @@ namespace io{
          * @throws NullPointerException if buffer is NULL.
          * @throws IndexOutOfBoundsException if the offset + length is greater than the array
size.
          */
-        virtual int read( char* buffer, int size, int offset, int length );
+        virtual int read(char* buffer, int size, int offset, int length);
 
         /**
          * Reads a single character. This method will block until a character is available,
@@ -174,7 +173,7 @@ namespace io{
          */
         virtual int read();
 
-        virtual int read( decaf::nio::CharBuffer* charBuffer );
+        virtual int read(decaf::nio::CharBuffer* charBuffer);
 
     protected:
 
@@ -185,7 +184,7 @@ namespace io{
          * All subclasses must override this method to provide the basic Reader
          * functionality.
          */
-        virtual int doReadArrayBounded( char* buffer, int size, int offset, int length )
= 0;
+        virtual int doReadArrayBounded(char* buffer, int size, int offset, int length) =
0;
 
     protected:
 
@@ -193,13 +192,13 @@ namespace io{
          * Override this method to customize the functionality of the method
          * read( std::vector<char>& buffer ).
          */
-        virtual int doReadVector( std::vector<char>& buffer );
+        virtual int doReadVector(std::vector<char>& buffer);
 
         /**
          * Override this method to customize the functionality of the method
          * read( char* buffer, std::size_t length ).
          */
-        virtual int doReadArray( char* buffer, int length );
+        virtual int doReadArray(char* buffer, int length);
 
         /**
          * Override this method to customize the functionality of the method
@@ -211,7 +210,7 @@ namespace io{
          * Override this method to customize the functionality of the method
          * read( CharBuffer* charBuffer ).
          */
-        virtual int doReadCharBuffer( decaf::nio::CharBuffer* charBuffer );
+        virtual int doReadCharBuffer(decaf::nio::CharBuffer* charBuffer);
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.cpp?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.cpp Wed Oct  3 23:10:47
2012
@@ -36,202 +36,200 @@ Writer::~Writer() {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::write( char v ) {
+void Writer::write(char v) {
 
     try {
-        this->doWriteChar( v );
+        this->doWriteChar(v);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::write( const std::vector<char>& buffer ) {
+void Writer::write(const std::vector<char>& buffer) {
 
     try {
-        this->doWriteVector( buffer );
+        this->doWriteVector(buffer);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::write( const char* buffer, int size ) {
+void Writer::write(const char* buffer, int size) {
 
     try {
-        this->doWriteArray( buffer, size );
+        this->doWriteArray(buffer, size);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::write( const char* buffer, int size, int offset, int length ) {
+void Writer::write(const char* buffer, int size, int offset, int length) {
 
     try {
-        this->doWriteArrayBounded( buffer, size, offset, length );
+        this->doWriteArrayBounded(buffer, size, offset, length);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::write( const std::string& str ) {
+void Writer::write(const std::string& str) {
 
     try {
-        this->doWriteString( str );
+        this->doWriteString(str);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::write( const std::string& str, int offset, int length ) {
+void Writer::write(const std::string& str, int offset, int length) {
 
     try {
 
-        if( ( offset + length ) > (int)str.length() ) {
-            throw IndexOutOfBoundsException(
-                __FILE__, __LINE__, "Given Offset + Length value greater than the String
length." );
+        if ((offset + length) > (int) str.length()) {
+            throw IndexOutOfBoundsException(__FILE__, __LINE__, "Given Offset + Length value
greater than the String length.");
         }
 
-        this->doWriteStringBounded( str.c_str(), offset, length );
+        this->doWriteStringBounded(str.c_str(), offset, length);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-Appendable& Writer::append( char value ) {
+Appendable& Writer::append(char value) {
 
     try {
-        return this->doAppendChar( value );
+        return this->doAppendChar(value);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-Appendable& Writer::append( const decaf::lang::CharSequence* csq ) {
+Appendable& Writer::append(const decaf::lang::CharSequence* csq) {
 
     try {
-        return this->doAppendCharSequence( csq );
+        return this->doAppendCharSequence(csq);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-Appendable& Writer::append( const decaf::lang::CharSequence* csq, int start, int end
) {
+Appendable& Writer::append(const decaf::lang::CharSequence* csq, int start, int end)
{
 
     try {
-        return this->doAppendCharSequenceStartEnd( csq, start, end );
+        return this->doAppendCharSequenceStartEnd(csq, start, end);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::doWriteChar( char v ) {
+void Writer::doWriteChar(char v) {
 
     try {
-        this->doWriteArrayBounded( (const char*)&v, 1, 0, 1 );
+        this->doWriteArrayBounded((const char*) &v, 1, 0, 1);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::doWriteVector( const std::vector<char>& buffer ) {
+void Writer::doWriteVector(const std::vector<char>& buffer) {
 
     try {
-        this->doWriteArrayBounded( &buffer[0], (int)buffer.size(), 0, (int)buffer.size()
);
+        this->doWriteArrayBounded(&buffer[0], (int) buffer.size(), 0, (int) buffer.size());
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::doWriteArray( const char* buffer, int size ) {
+void Writer::doWriteArray(const char* buffer, int size) {
 
     try {
-        this->doWriteArrayBounded( buffer, size, 0, size );
+        this->doWriteArrayBounded(buffer, size, 0, size);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::doWriteString( const std::string& str ) {
+void Writer::doWriteString(const std::string& str) {
 
     try {
-        this->doWriteArrayBounded( str.c_str(), (int)str.length(), 0, (int)str.length()
);
+        this->doWriteArrayBounded(str.c_str(), (int) str.length(), 0, (int) str.length());
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void Writer::doWriteStringBounded( const std::string& str, int offset, int length ) {
+void Writer::doWriteStringBounded(const std::string& str, int offset, int length) {
 
     try {
-        this->doWriteArrayBounded( str.c_str(), (int)str.length(), offset, length );
+        this->doWriteArrayBounded(str.c_str(), (int) str.length(), offset, length);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-decaf::lang::Appendable& Writer::doAppendChar( char value ) {
+decaf::lang::Appendable& Writer::doAppendChar(char value) {
 
     try {
-        this->doWriteChar( value );
+        this->doWriteChar(value);
         return *this;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-decaf::lang::Appendable& Writer::doAppendCharSequence( const decaf::lang::CharSequence*
csq ) {
+decaf::lang::Appendable& Writer::doAppendCharSequence(const decaf::lang::CharSequence*
csq) {
 
     try {
 
-        if( csq == NULL ) {
-            this->doWriteString( std::string( "null" ) );
+        if (csq == NULL) {
+            this->doWriteString(std::string("null"));
         } else {
-            this->doWriteString( csq->toString() );
+            this->doWriteString(csq->toString());
         }
 
         return *this;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-decaf::lang::Appendable& Writer::doAppendCharSequenceStartEnd( const decaf::lang::CharSequence*
csq,
-                                                               int start, int end ) {
+decaf::lang::Appendable& Writer::doAppendCharSequenceStartEnd(const decaf::lang::CharSequence*
csq, int start, int end) {
 
     try {
 
-        if( csq == NULL ) {
-            this->doWriteString( string( "null" ).substr( start, end - start ) );
+        if (csq == NULL) {
+            this->doWriteString(string("null").substr(start, end - start));
         } else {
-            std::auto_ptr<CharSequence> result( csq->subSequence( start, end ) );
-            this->doWriteString( result->toString() );
+            std::auto_ptr<CharSequence> result(csq->subSequence(start, end));
+            this->doWriteString(result->toString());
         }
 
         return *this;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCHALL_THROW(IOException)
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.h Wed Oct  3 23:10:47
2012
@@ -38,13 +38,11 @@ namespace io{
      *
      * @since 1.0
      */
-    class DECAF_API Writer : public decaf::io::Closeable,
-                             public decaf::io::Flushable,
-                             public decaf::lang::Appendable {
+    class DECAF_API Writer: public decaf::io::Closeable, public decaf::io::Flushable, public
decaf::lang::Appendable {
     private:
 
-        Writer( const Writer& );
-        Writer& operator= ( const Writer& );
+        Writer(const Writer&);
+        Writer& operator=(const Writer&);
 
     public:
 
@@ -60,7 +58,7 @@ namespace io{
          *
          * @throws IOException thrown if an error occurs.
          */
-        virtual void write( char v );
+        virtual void write(char v);
 
         /**
          * Writes an array of Chars
@@ -70,7 +68,7 @@ namespace io{
          *
          * @throws IOException thrown if an error occurs.
          */
-        virtual void write( const std::vector<char>& buffer );
+        virtual void write(const std::vector<char>& buffer);
 
         /**
          * Writes a byte array to the output stream.
@@ -83,7 +81,7 @@ namespace io{
          * @throws IOException if an I/O error occurs.
          * @throws NullPointerException if buffer is NULL.
          */
-        virtual void write( const char* buffer, int size );
+        virtual void write(const char* buffer, int size);
 
         /**
          * Writes a byte array to the output stream.
@@ -101,7 +99,7 @@ namespace io{
          * @throws NullPointerException if buffer is NULL.
          * @throws IndexOutOfBoundsException if offset + length > size of the buffer.
          */
-        virtual void write( const char* buffer, int size, int offset, int length );
+        virtual void write(const char* buffer, int size, int offset, int length);
 
         /**
          * Writes a string
@@ -111,7 +109,7 @@ namespace io{
          *
          * @throws IOException thrown if an error occurs.
          */
-        virtual void write( const std::string& str );
+        virtual void write(const std::string& str);
 
         /**
          * Writes a string
@@ -126,13 +124,13 @@ namespace io{
          * @throws IOException thrown if an error occurs.
          * @throws IndexOutOfBoundsException if offset+length is greater than the string
length.
          */
-        virtual void write( const std::string& str, int offset, int length );
+        virtual void write(const std::string& str, int offset, int length);
 
-        virtual decaf::lang::Appendable& append( char value );
+        virtual decaf::lang::Appendable& append(char value);
 
-        virtual decaf::lang::Appendable& append( const decaf::lang::CharSequence* csq
);
+        virtual decaf::lang::Appendable& append(const decaf::lang::CharSequence* csq);
 
-        virtual decaf::lang::Appendable& append( const decaf::lang::CharSequence* csq,
int start, int end );
+        virtual decaf::lang::Appendable& append(const decaf::lang::CharSequence* csq,
int start, int end);
 
     protected:
 
@@ -143,26 +141,25 @@ namespace io{
          * All subclasses must override this method to provide the basic Writer
          * functionality.
          */
-        virtual void doWriteArrayBounded( const char* buffer, int size, int offset, int length
) = 0;
+        virtual void doWriteArrayBounded(const char* buffer, int size, int offset, int length)
= 0;
 
     protected:
 
-        virtual void doWriteChar( char v );
+        virtual void doWriteChar(char v);
 
-        virtual void doWriteVector( const std::vector<char>& buffer );
+        virtual void doWriteVector(const std::vector<char>& buffer);
 
-        virtual void doWriteArray( const char* buffer, int size );
+        virtual void doWriteArray(const char* buffer, int size);
 
-        virtual void doWriteString( const std::string& str );
+        virtual void doWriteString(const std::string& str);
 
-        virtual void doWriteStringBounded( const std::string& str, int offset, int length
);
+        virtual void doWriteStringBounded(const std::string& str, int offset, int length);
 
-        virtual decaf::lang::Appendable& doAppendChar( char value );
+        virtual decaf::lang::Appendable& doAppendChar(char value);
 
-        virtual decaf::lang::Appendable& doAppendCharSequence( const decaf::lang::CharSequence*
csq );
+        virtual decaf::lang::Appendable& doAppendCharSequence(const decaf::lang::CharSequence*
csq);
 
-        virtual decaf::lang::Appendable& doAppendCharSequenceStartEnd( const decaf::lang::CharSequence*
csq,
-                                                                       int start, int end
);
+        virtual decaf::lang::Appendable& doAppendCharSequenceStartEnd(const decaf::lang::CharSequence*
csq, int start, int end);
 
     };
 



Mime
View raw message