Browse Source

only style changes

aleks-f 13 years ago
parent
commit
3d16ce00a2
35 changed files with 190 additions and 111 deletions
  1. 6 8
      MongoDB/include/Poco/MongoDB/BSONReader.h
  2. 4 0
      MongoDB/include/Poco/MongoDB/BSONWriter.h
  3. 6 1
      MongoDB/include/Poco/MongoDB/Binary.h
  4. 16 5
      MongoDB/include/Poco/MongoDB/Database.h
  5. 2 1
      MongoDB/include/Poco/MongoDB/DeleteRequest.h
  6. 2 0
      MongoDB/include/Poco/MongoDB/Document.h
  7. 8 5
      MongoDB/include/Poco/MongoDB/Element.h
  8. 1 0
      MongoDB/include/Poco/MongoDB/GetMoreRequest.h
  9. 1 0
      MongoDB/include/Poco/MongoDB/KillCursorsRequest.h
  10. 1 0
      MongoDB/include/Poco/MongoDB/Message.h
  11. 3 3
      MongoDB/include/Poco/MongoDB/MessageHeader.h
  12. 2 0
      MongoDB/include/Poco/MongoDB/ObjectId.h
  13. 1 0
      MongoDB/include/Poco/MongoDB/ResponseMessage.h
  14. 2 1
      MongoDB/include/Poco/MongoDB/UpdateRequest.h
  15. 4 1
      MongoDB/src/Array.cpp
  16. 2 0
      MongoDB/src/Binary.cpp
  17. 11 5
      MongoDB/src/Connection.cpp
  18. 5 5
      MongoDB/src/Cursor.cpp
  19. 5 4
      MongoDB/src/Database.cpp
  20. 6 5
      MongoDB/src/DeleteRequest.cpp
  21. 7 7
      MongoDB/src/Document.cpp
  22. 6 4
      MongoDB/src/Element.cpp
  23. 7 5
      MongoDB/src/GetMoreRequest.cpp
  24. 8 5
      MongoDB/src/InsertRequest.cpp
  25. 5 0
      MongoDB/src/JavaScriptCode.cpp
  26. 7 5
      MongoDB/src/KillCursorsRequest.cpp
  27. 7 5
      MongoDB/src/Message.cpp
  28. 11 6
      MongoDB/src/MessageHeader.cpp
  29. 5 5
      MongoDB/src/ObjectId.cpp
  30. 6 5
      MongoDB/src/QueryRequest.cpp
  31. 3 1
      MongoDB/src/RegularExpression.cpp
  32. 7 4
      MongoDB/src/ReplicaSet.cpp
  33. 7 5
      MongoDB/src/RequestMessage.cpp
  34. 8 5
      MongoDB/src/ResponseMessage.cpp
  35. 8 5
      MongoDB/src/UpdateRequest.cpp

+ 6 - 8
MongoDB/include/Poco/MongoDB/BSONReader.h

@@ -35,15 +35,19 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_BSONReader_INCLUDED
 #define MongoDB_BSONReader_INCLUDED
 
+
 #include "Poco/MongoDB/MongoDB.h"
 #include "Poco/BinaryReader.h"
 
+
 namespace Poco {
 namespace MongoDB {
 
+
 class MongoDB_API BSONReader
 	/// Class for reading BSON from a Poco::BinaryReader
 {
@@ -85,14 +89,8 @@ inline std::string BSONReader::readCString()
 		_reader >> c;
 		if ( _reader.good() )
 		{
-			if (c == 0x00)
-			{
-				return val;
-			}
-			else
-			{
-				val += c;
-			}
+			if (c == 0x00) return val;
+			else val += c;
 		}
 	}
 	return val;

+ 4 - 0
MongoDB/include/Poco/MongoDB/BSONWriter.h

@@ -35,12 +35,15 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_BSONWriter_INCLUDED
 #define MongoDB_BSONWriter_INCLUDED
 
+
 #include "Poco/MongoDB/MongoDB.h"
 #include "Poco/BinaryWriter.h"
 
+
 namespace Poco {
 namespace MongoDB {
 
@@ -82,6 +85,7 @@ inline void BSONWriter::writeCString(const std::string& value)
 	_writer << (unsigned char) 0x00;
 }
 
+
 } } // namespace Poco::MongoDB
 
 

+ 6 - 1
MongoDB/include/Poco/MongoDB/Binary.h

@@ -35,21 +35,24 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_Binary_INCLUDED
 #define MongoDB_Binary_INCLUDED
 
+
 #include "Poco/MongoDB/MongoDB.h"
 #include "Poco/MongoDB/Element.h"
 #include "Poco/Base64Encoder.h"
 #include "Poco/Buffer.h"
 #include "Poco/StreamCopier.h"
 #include "Poco/MemoryStream.h"
-
 #include <sstream>
 
+
 namespace Poco {
 namespace MongoDB {
 
+
 class MongoDB_API Binary
 	/// Implements BSON Binary. It's a wrapper around a Poco::Buffer<unsigned char>.
 {
@@ -130,6 +133,7 @@ inline void BSONReader::read<Binary::Ptr>(Binary::Ptr& to)
 	_reader.readRaw((char*) to->buffer().begin(), size);
 }
 
+
 template<>
 inline void BSONWriter::write<Binary::Ptr>(Binary::Ptr& from)
 {
@@ -140,4 +144,5 @@ inline void BSONWriter::write<Binary::Ptr>(Binary::Ptr& from)
 
 } } // namespace Poco::MongoDB
 
+
 #endif // MongoDB_Binary_INCLUDED

+ 16 - 5
MongoDB/include/Poco/MongoDB/Database.h

@@ -90,7 +90,14 @@ public:
 	Poco::SharedPtr<Poco::MongoDB::UpdateRequest> createUpdateRequest(const std::string& collectionName) const;
 		/// Creates an UpdateRequest. The collectionname must not contain the database name!
 
-	Poco::MongoDB::Document::Ptr ensureIndex(Connection& connection, const std::string& collection, const std::string& indexName, Poco::MongoDB::Document::Ptr keys, bool unique = false, bool background = false, int version = 0, int ttl = 0);
+	Poco::MongoDB::Document::Ptr ensureIndex(Connection& connection,
+		const std::string& collection,
+		const std::string& indexName,
+		Poco::MongoDB::Document::Ptr keys,
+		bool unique = false,
+		bool background = false,
+		int version = 0,
+		int ttl = 0);
 		/// Creates an index. The document returned is the result of a getLastError call.
 		/// For more info look at the ensureIndex information on the MongoDB website.
 
@@ -114,25 +121,29 @@ inline Poco::SharedPtr<Poco::MongoDB::QueryRequest> Database::createCommand() co
 }
 
 
-inline Poco::SharedPtr<Poco::MongoDB::DeleteRequest> Database::createDeleteRequest(const std::string& collectionName) const
+inline Poco::SharedPtr<Poco::MongoDB::DeleteRequest>
+Database::createDeleteRequest(const std::string& collectionName) const
 {
 	return new Poco::MongoDB::DeleteRequest(_dbname + '.' + collectionName);
 }
 
 
-inline Poco::SharedPtr<Poco::MongoDB::InsertRequest> Database::createInsertRequest(const std::string& collectionName) const
+inline Poco::SharedPtr<Poco::MongoDB::InsertRequest>
+Database::createInsertRequest(const std::string& collectionName) const
 {
 	return new Poco::MongoDB::InsertRequest(_dbname + '.' + collectionName);
 }
 
 
-inline Poco::SharedPtr<Poco::MongoDB::QueryRequest> Database::createQueryRequest(const std::string& collectionName) const
+inline Poco::SharedPtr<Poco::MongoDB::QueryRequest>
+Database::createQueryRequest(const std::string& collectionName) const
 {
 	return new Poco::MongoDB::QueryRequest(_dbname + '.' + collectionName);
 }
 
 
-inline Poco::SharedPtr<Poco::MongoDB::UpdateRequest> Database::createUpdateRequest(const std::string& collectionName) const
+inline Poco::SharedPtr<Poco::MongoDB::UpdateRequest>
+Database::createUpdateRequest(const std::string& collectionName) const
 {
 	return new Poco::MongoDB::UpdateRequest(_dbname + '.' + collectionName);
 }

+ 2 - 1
MongoDB/include/Poco/MongoDB/DeleteRequest.h

@@ -98,7 +98,7 @@ protected:
 private:
 	Flags       _flags;
 	std::string _fullCollectionName;
-	Document _selector;
+	Document    _selector;
 };
 
 
@@ -119,6 +119,7 @@ inline Document& DeleteRequest::selector()
 	return _selector;
 }
 
+
 } } // namespace Poco::MongoDB
 
 

+ 2 - 0
MongoDB/include/Poco/MongoDB/Document.h

@@ -67,6 +67,7 @@ private:
 	std::string _name;
 };
 
+
 class MongoDB_API Document
 	/// Represents a BSON document
 {
@@ -270,6 +271,7 @@ inline void BSONReader::read<Document::Ptr>(Document::Ptr& to)
 	to->read(_reader);
 }
 
+
 template<>
 inline void BSONWriter::write<Document::Ptr>(Document::Ptr& from)
 {

+ 8 - 5
MongoDB/include/Poco/MongoDB/Element.h

@@ -35,13 +35,10 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_Element_INCLUDED
 #define MongoDB_Element_INCLUDED
 
-#include <string>
-#include <sstream>
-#include <iomanip>
-#include <set>
 
 #include "Poco/BinaryReader.h"
 #include "Poco/BinaryWriter.h"
@@ -53,6 +50,11 @@
 #include "Poco/MongoDB/MongoDB.h"
 #include "Poco/MongoDB/BSONReader.h"
 #include "Poco/MongoDB/BSONWriter.h"
+#include <string>
+#include <sstream>
+#include <iomanip>
+#include <set>
+
 
 namespace Poco {
 namespace MongoDB {
@@ -129,7 +131,7 @@ struct ElementTraits<double>
 
 // BSON UTF-8 string
 // spec: int32 (byte*) "\x00"
-// int32 is the number bytes in byte* + 1 (for trailing "\x00"
+// int32 is the number bytes in byte* + 1 (for trailing "\x00")
 template<>
 struct ElementTraits<std::string>
 {
@@ -226,6 +228,7 @@ inline void BSONReader::read<bool>(bool& to)
 	to = b != 0;
 }
 
+
 template<>
 inline void BSONWriter::write<bool>(bool& from)
 {

+ 1 - 0
MongoDB/include/Poco/MongoDB/GetMoreRequest.h

@@ -35,6 +35,7 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_GetMoreRequest_INCLUDED
 #define MongoDB_GetMoreRequest_INCLUDED
 

+ 1 - 0
MongoDB/include/Poco/MongoDB/KillCursorsRequest.h

@@ -35,6 +35,7 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_KillCursorsRequest_INCLUDED
 #define MongoDB_KillCursorsRequest_INCLUDED
 

+ 1 - 0
MongoDB/include/Poco/MongoDB/Message.h

@@ -35,6 +35,7 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_Message_INCLUDED
 #define MongoDB_Message_INCLUDED
 

+ 3 - 3
MongoDB/include/Poco/MongoDB/MessageHeader.h

@@ -35,6 +35,7 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_MessageHeader_INCLUDED
 #define MongoDB_MessageHeader_INCLUDED
 
@@ -43,9 +44,6 @@
 #include "Poco/MongoDB/MessageHeader.h"
 
 
-#define MSG_HEADER_SIZE	16
-
-
 namespace Poco {
 namespace MongoDB {
 
@@ -55,6 +53,8 @@ class MongoDB_API MessageHeader
 	/// or response of MongoDB
 {
 public:
+	static const unsigned int MSG_HEADER_SIZE = 16;
+
 	typedef enum
 	{
 		  Reply = 1

+ 2 - 0
MongoDB/include/Poco/MongoDB/ObjectId.h

@@ -35,6 +35,7 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #ifndef MongoDB_ObjectId_INCLUDED
 #define MongoDB_ObjectId_INCLUDED
 
@@ -47,6 +48,7 @@
 namespace Poco {
 namespace MongoDB {
 
+
 class MongoDB_API ObjectId
 	/// ObjectId is a 12-byte BSON type, constructed using:
 	///

+ 1 - 0
MongoDB/include/Poco/MongoDB/ResponseMessage.h

@@ -119,6 +119,7 @@ inline bool ResponseMessage::hasDocuments() const
 	return _documents.size() > 0;
 }
 
+
 } } // namespace Poco::MongoDB
 
 

+ 2 - 1
MongoDB/include/Poco/MongoDB/UpdateRequest.h

@@ -88,7 +88,7 @@ public:
 
 	void flags(Flags flags);
 		/// Sets the flags
-		
+
 protected:
 	void buildRequest(BinaryWriter& writer);
 
@@ -124,4 +124,5 @@ inline Document& UpdateRequest::update()
 
 } } // namespace Poco::MongoDB
 
+
 #endif //MongoDB_UpdateRequest_INCLUDED

+ 4 - 1
MongoDB/src/Array.cpp

@@ -34,13 +34,16 @@
 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 //
-#include <sstream>
+
 
 #include "Poco/MongoDB/Array.h"
+#include <sstream>
+
 
 namespace Poco {
 namespace MongoDB {
 
+
 Array::Array() : Document()
 {
 }

+ 2 - 0
MongoDB/src/Binary.cpp

@@ -35,8 +35,10 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/Binary.h"
 
+
 namespace Poco {
 namespace MongoDB {
 

+ 11 - 5
MongoDB/src/Connection.cpp

@@ -34,15 +34,16 @@
 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 //
-#include <iostream>
+
 
 #include "Poco/Net/SocketStream.h"
 #include "Poco/MongoDB/Connection.h"
+#include <iostream>
+
+
+namespace Poco {
+namespace MongoDB {
 
-namespace Poco
-{
-namespace MongoDB
-{
 
 Connection::Connection() : _address(), _socket()
 {
@@ -54,6 +55,7 @@ Connection::Connection(const std::string& hostAndPort) : _address(hostAndPort),
 	connect();
 }
 
+
 Connection::Connection(const std::string& host, int port) : _address(host, port), _socket()
 {
 	connect();
@@ -90,6 +92,7 @@ void Connection::connect(const std::string& hostAndPort)
 	connect();
 }
 
+
 void Connection::connect(const std::string& host, int port)
 {
 	_address = Net::SocketAddress(host, port);
@@ -103,17 +106,20 @@ void Connection::connect(const Net::SocketAddress& addrs)
 	connect();
 }
 
+
 void Connection::disconnect()
 {
 	_socket.close();
 }
 
+
 void Connection::sendRequest(RequestMessage& request)
 {
 	Net::SocketOutputStream sos(_socket);
 	request.send(sos);
 }
 
+
 void Connection::sendRequest(RequestMessage& request, ResponseMessage& response)
 {
 	sendRequest(request);

+ 5 - 5
MongoDB/src/Cursor.cpp

@@ -35,14 +35,14 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/Cursor.h"
 #include "Poco/MongoDB/GetMoreRequest.h"
 #include "Poco/MongoDB/KillCursorsRequest.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 Cursor::Cursor(const std::string& db, const std::string& collection, QueryRequest::Flags flags)
@@ -91,5 +91,5 @@ void Cursor::kill(Connection& connection)
 	_response.clear();
 }
 
-} } // Namespace Poco::MongoDB
 
+} } // Namespace Poco::MongoDB

+ 5 - 4
MongoDB/src/Database.cpp

@@ -35,12 +35,12 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/Database.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 Database::Database( const std::string& db) : _dbname(db)
@@ -126,6 +126,7 @@ Document::Ptr Database::getLastErrorDoc(Connection& connection) const
 	return errorDoc;
 }
 
+
 std::string Database::getLastError(Connection& connection) const
 {
 	Document::Ptr errorDoc = getLastErrorDoc(connection);

+ 6 - 5
MongoDB/src/DeleteRequest.cpp

@@ -35,12 +35,12 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/DeleteRequest.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 DeleteRequest::DeleteRequest(const std::string& collectionName, DeleteRequest::Flags flags) 
@@ -65,6 +65,7 @@ DeleteRequest::~DeleteRequest()
 {
 }
 
+
 void DeleteRequest::buildRequest(BinaryWriter& writer)
 {
 	writer << 0; // 0 - reserved for future use
@@ -74,4 +75,4 @@ void DeleteRequest::buildRequest(BinaryWriter& writer)
 }
 
 
-}} // Namespace MongoDB
+} } // namespace Poco::MongoDB

+ 7 - 7
MongoDB/src/Document.cpp

@@ -35,7 +35,6 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
-#include <sstream>
 
 #include "Poco/MongoDB/Document.h"
 #include "Poco/MongoDB/Binary.h"
@@ -43,17 +42,18 @@
 #include "Poco/MongoDB/Array.h"
 #include "Poco/MongoDB/RegularExpression.h"
 #include "Poco/MongoDB/JavaScriptCode.h"
+#include <sstream>
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 Document::Document()
 {
 }
 
+
 Document::~Document()
 {
 }
@@ -198,14 +198,14 @@ void Document::write(BinaryWriter& writer)
 		Poco::BinaryWriter tempWriter(sstream);
 		for(ElementSet::iterator it = _elements.begin(); it != _elements.end(); ++it)
 		{
-			tempWriter << (unsigned char) (*it)->type();
+			tempWriter << static_cast<unsigned char>((*it)->type());
 			BSONWriter(tempWriter).writeCString((*it)->name());
 			Element::Ptr element = *it;
 			element->write(tempWriter);
 		}
 		tempWriter.flush();
 		
-		Poco::Int32 len = 5 + sstream.tellp(); /* 5 = sizeof(len) + 0-byte */
+		Poco::Int32 len = static_cast<Poco::Int32>(5 + sstream.tellp()); /* 5 = sizeof(len) + 0-byte */
 		writer << len;
 		writer.writeRaw(sstream.str());
 	}

+ 6 - 4
MongoDB/src/Element.cpp

@@ -35,17 +35,19 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/Element.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
+
 
 Element::Element(const std::string& name) : _name(name)
 {
 }
 
+
 Element::~Element() 
 {
 }

+ 7 - 5
MongoDB/src/GetMoreRequest.cpp

@@ -35,13 +35,13 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/GetMoreRequest.h"
 #include "Poco/MongoDB/Element.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 GetMoreRequest::GetMoreRequest(const std::string& collectionName, Int64 cursorID) 
@@ -52,10 +52,12 @@ GetMoreRequest::GetMoreRequest(const std::string& collectionName, Int64 cursorID
 {
 }
 
+
 GetMoreRequest::~GetMoreRequest()
 {
 }
 
+
 void GetMoreRequest::buildRequest(BinaryWriter& writer)
 {
 	writer << 0; // 0 - reserved for future use
@@ -65,4 +67,4 @@ void GetMoreRequest::buildRequest(BinaryWriter& writer)
 }
 
 
-}} // Namespace MongoDB
+} } // namespace Poco::MongoDB

+ 8 - 5
MongoDB/src/InsertRequest.cpp

@@ -35,12 +35,12 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/InsertRequest.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 InsertRequest::InsertRequest(const std::string& collectionName, Flags flags) 
@@ -50,10 +50,12 @@ InsertRequest::InsertRequest(const std::string& collectionName, Flags flags)
 {
 }
 
+
 InsertRequest::~InsertRequest()
 {
 }
 
+
 void InsertRequest::buildRequest(BinaryWriter& writer)
 {
 	//TODO: throw exception when no document is added
@@ -67,4 +69,5 @@ void InsertRequest::buildRequest(BinaryWriter& writer)
 	}
 }
 
-}} // Namespace MongoDB
+
+} } // namespace Poco::MongoDB

+ 5 - 0
MongoDB/src/JavaScriptCode.cpp

@@ -34,8 +34,11 @@
 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 //
+
+
 #include "Poco/MongoDB/JavaScriptCode.h"
 
+
 namespace Poco {
 namespace MongoDB {
 
@@ -45,8 +48,10 @@ JavaScriptCode::JavaScriptCode()
 
 }
 
+
 JavaScriptCode::~JavaScriptCode()
 {
 }
 
+
 } } // namespace Poco::MongoDB

+ 7 - 5
MongoDB/src/KillCursorsRequest.cpp

@@ -35,12 +35,12 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/KillCursorsRequest.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 KillCursorsRequest::KillCursorsRequest() 
@@ -48,10 +48,12 @@ KillCursorsRequest::KillCursorsRequest()
 {
 }
 
+
 KillCursorsRequest::~KillCursorsRequest()
 {
 }
 
+
 void KillCursorsRequest::buildRequest(BinaryWriter& writer)
 {
 	writer << 0; // 0 - reserved for future use
@@ -63,4 +65,4 @@ void KillCursorsRequest::buildRequest(BinaryWriter& writer)
 }
 
 
-}} // Namespace MongoDB
+} } // namespace Poco::MongoDB

+ 7 - 5
MongoDB/src/Message.cpp

@@ -35,20 +35,22 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/Message.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 Message::Message(MessageHeader::OpCode opcode) : _header(opcode)
 {
 }
 
+
 Message::~Message()
 {
 }
 
-}} // Namespace MongoDB
+
+} } // namespace Poco::MongoDB

+ 11 - 6
MongoDB/src/MessageHeader.cpp

@@ -34,25 +34,28 @@
 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 //
-#include "Poco/MongoDB/Message.h"
 
+
+#include "Poco/MongoDB/Message.h"
 #include "Poco/Exception.h"
 #include "Poco/Net/SocketStream.h"
 #include "Poco/StreamCopier.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
+
 
 MessageHeader::MessageHeader(OpCode opCode) : _messageLength(0), _requestID(0), _responseTo(0), _opCode(opCode)
 {
 }
 
+
 MessageHeader::~MessageHeader()
 {
 }
 
+
 void MessageHeader::read(BinaryReader& reader)
 {
 	reader >> _messageLength;
@@ -69,6 +72,7 @@ void MessageHeader::read(BinaryReader& reader)
 	}
 }
 
+
 void MessageHeader::write(BinaryWriter& writer)
 {
 	writer << _messageLength;
@@ -77,4 +81,5 @@ void MessageHeader::write(BinaryWriter& writer)
 	writer << (Int32) _opCode;
 }
 
-}} // Namespace MongoDB
+
+} } // namespace Poco::MongoDB

+ 5 - 5
MongoDB/src/ObjectId.cpp

@@ -35,14 +35,14 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
-#include "Poco/MongoDB/ObjectId.h"
 
+#include "Poco/MongoDB/ObjectId.h"
 #include "Poco/Format.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
+
 
 ObjectId::ObjectId()
 {

+ 6 - 5
MongoDB/src/QueryRequest.cpp

@@ -35,12 +35,12 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/QueryRequest.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 QueryRequest::QueryRequest(const std::string& collectionName, QueryRequest::Flags flags) 
@@ -59,6 +59,7 @@ QueryRequest::~QueryRequest()
 {
 }
 
+
 void QueryRequest::buildRequest(BinaryWriter& writer)
 {
 	writer << _flags;
@@ -74,4 +75,4 @@ void QueryRequest::buildRequest(BinaryWriter& writer)
 }
 
 
-}} // Namespace MongoDB
+} } // namespace Poco::MongoDB

+ 3 - 1
MongoDB/src/RegularExpression.cpp

@@ -35,9 +35,10 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
-#include <sstream>
 
 #include "Poco/MongoDB/RegularExpression.h"
+#include <sstream>
+
 
 namespace Poco {
 namespace MongoDB {
@@ -88,4 +89,5 @@ SharedPtr<Poco::RegularExpression> RegularExpression::createRE() const
 	return new Poco::RegularExpression(_pattern, options);
 }
 
+
 } } // namespace Poco::MongoDB

+ 7 - 4
MongoDB/src/ReplicaSet.cpp

@@ -34,19 +34,21 @@
 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 //
+
+
 #include "Poco/MongoDB/ReplicaSet.h"
 #include "Poco/MongoDB/QueryRequest.h"
 #include "Poco/MongoDB/ResponseMessage.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+namespace Poco {
+namespace MongoDB {
+
 
 ReplicaSet::ReplicaSet(const std::vector<Net::SocketAddress> &addresses) : _addresses(addresses)
 {
 }
 
+
 ReplicaSet::~ReplicaSet()
 {
 }
@@ -68,6 +70,7 @@ Connection::Ptr ReplicaSet::findMaster()
 	return master;
 }
 
+
 Connection::Ptr ReplicaSet::isMaster(const Net::SocketAddress& address)
 {
 	Connection::Ptr conn = new Connection();

+ 7 - 5
MongoDB/src/RequestMessage.cpp

@@ -35,20 +35,21 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/RequestMessage.h"
 #include "Poco/Net/SocketStream.h"
 #include "Poco/StreamCopier.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 RequestMessage::RequestMessage(MessageHeader::OpCode opcode) : Message(opcode)
 {
 }
 
+
 RequestMessage::~RequestMessage()
 {
 }
@@ -69,4 +70,5 @@ void RequestMessage::send(std::ostream& ostr)
 	ostr.flush();
 }
 
-}} // Namespace MongoDB
+
+} } // namespace Poco::MongoDB

+ 8 - 5
MongoDB/src/ResponseMessage.cpp

@@ -35,18 +35,20 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/ResponseMessage.h"
 #include "Poco/Net/SocketStream.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
+
 
 ResponseMessage::ResponseMessage() : Message(MessageHeader::Reply), _responseFlags(0), _cursorID(0), _startingFrom(0), _numberReturned(0)
 {
 }
 
+
 ResponseMessage::~ResponseMessage()
 {
 }
@@ -83,4 +85,5 @@ void ResponseMessage::read(std::istream& istr)
 	}
 }
 
-}} // Namespace MongoDB
+
+} } // namespace Poco::MongoDB

+ 8 - 5
MongoDB/src/UpdateRequest.cpp

@@ -35,12 +35,12 @@
 // DEALINGS IN THE SOFTWARE.
 //
 
+
 #include "Poco/MongoDB/UpdateRequest.h"
 
-namespace Poco
-{
-namespace MongoDB
-{
+
+namespace Poco {
+namespace MongoDB {
 
 
 UpdateRequest::UpdateRequest(const std::string& collectionName, UpdateRequest::Flags flags) 
@@ -52,10 +52,12 @@ UpdateRequest::UpdateRequest(const std::string& collectionName, UpdateRequest::F
 {
 }
 
+
 UpdateRequest::~UpdateRequest()
 {
 }
 
+
 void UpdateRequest::buildRequest(BinaryWriter& writer)
 {
 	writer << 0; // 0 - reserved for future use
@@ -65,4 +67,5 @@ void UpdateRequest::buildRequest(BinaryWriter& writer)
 	_update.write(writer);
 }
 
-}} // Namespace MongoDB
+
+} } // namespace Poco::MongoDB