Skip to content

Commit 3d16ce0

Browse files
committed
only style changes
1 parent 95e7130 commit 3d16ce0

35 files changed

Lines changed: 190 additions & 111 deletions

‎MongoDB/include/Poco/MongoDB/BSONReader.h‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,19 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef MongoDB_BSONReader_INCLUDED
3940
#define MongoDB_BSONReader_INCLUDED
4041

42+
4143
#include "Poco/MongoDB/MongoDB.h"
4244
#include "Poco/BinaryReader.h"
4345

46+
4447
namespace Poco {
4548
namespace MongoDB {
4649

50+
4751
class MongoDB_API BSONReader
4852
/// Class for reading BSON from a Poco::BinaryReader
4953
{
@@ -85,14 +89,8 @@ inline std::string BSONReader::readCString()
8589
_reader >> c;
8690
if ( _reader.good() )
8791
{
88-
if (c == 0x00)
89-
{
90-
return val;
91-
}
92-
else
93-
{
94-
val += c;
95-
}
92+
if (c == 0x00) return val;
93+
else val += c;
9694
}
9795
}
9896
return val;

‎MongoDB/include/Poco/MongoDB/BSONWriter.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef MongoDB_BSONWriter_INCLUDED
3940
#define MongoDB_BSONWriter_INCLUDED
4041

42+
4143
#include "Poco/MongoDB/MongoDB.h"
4244
#include "Poco/BinaryWriter.h"
4345

46+
4447
namespace Poco {
4548
namespace MongoDB {
4649

@@ -82,6 +85,7 @@ inline void BSONWriter::writeCString(const std::string& value)
8285
_writer << (unsigned char) 0x00;
8386
}
8487

88+
8589
} } // namespace Poco::MongoDB
8690

8791

‎MongoDB/include/Poco/MongoDB/Binary.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,24 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef MongoDB_Binary_INCLUDED
3940
#define MongoDB_Binary_INCLUDED
4041

42+
4143
#include "Poco/MongoDB/MongoDB.h"
4244
#include "Poco/MongoDB/Element.h"
4345
#include "Poco/Base64Encoder.h"
4446
#include "Poco/Buffer.h"
4547
#include "Poco/StreamCopier.h"
4648
#include "Poco/MemoryStream.h"
47-
4849
#include <sstream>
4950

51+
5052
namespace Poco {
5153
namespace MongoDB {
5254

55+
5356
class MongoDB_API Binary
5457
/// Implements BSON Binary. It's a wrapper around a Poco::Buffer<unsigned char>.
5558
{
@@ -130,6 +133,7 @@ inline void BSONReader::read<Binary::Ptr>(Binary::Ptr& to)
130133
_reader.readRaw((char*) to->buffer().begin(), size);
131134
}
132135

136+
133137
template<>
134138
inline void BSONWriter::write<Binary::Ptr>(Binary::Ptr& from)
135139
{
@@ -140,4 +144,5 @@ inline void BSONWriter::write<Binary::Ptr>(Binary::Ptr& from)
140144

141145
} } // namespace Poco::MongoDB
142146

147+
143148
#endif // MongoDB_Binary_INCLUDED

‎MongoDB/include/Poco/MongoDB/Database.h‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,14 @@ class MongoDB_API Database
9090
Poco::SharedPtr<Poco::MongoDB::UpdateRequest> createUpdateRequest(const std::string& collectionName) const;
9191
/// Creates an UpdateRequest. The collectionname must not contain the database name!
9292

93-
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);
93+
Poco::MongoDB::Document::Ptr ensureIndex(Connection& connection,
94+
const std::string& collection,
95+
const std::string& indexName,
96+
Poco::MongoDB::Document::Ptr keys,
97+
bool unique = false,
98+
bool background = false,
99+
int version = 0,
100+
int ttl = 0);
94101
/// Creates an index. The document returned is the result of a getLastError call.
95102
/// For more info look at the ensureIndex information on the MongoDB website.
96103

@@ -114,25 +121,29 @@ inline Poco::SharedPtr<Poco::MongoDB::QueryRequest> Database::createCommand() co
114121
}
115122

116123

117-
inline Poco::SharedPtr<Poco::MongoDB::DeleteRequest> Database::createDeleteRequest(const std::string& collectionName) const
124+
inline Poco::SharedPtr<Poco::MongoDB::DeleteRequest>
125+
Database::createDeleteRequest(const std::string& collectionName) const
118126
{
119127
return new Poco::MongoDB::DeleteRequest(_dbname + '.' + collectionName);
120128
}
121129

122130

123-
inline Poco::SharedPtr<Poco::MongoDB::InsertRequest> Database::createInsertRequest(const std::string& collectionName) const
131+
inline Poco::SharedPtr<Poco::MongoDB::InsertRequest>
132+
Database::createInsertRequest(const std::string& collectionName) const
124133
{
125134
return new Poco::MongoDB::InsertRequest(_dbname + '.' + collectionName);
126135
}
127136

128137

129-
inline Poco::SharedPtr<Poco::MongoDB::QueryRequest> Database::createQueryRequest(const std::string& collectionName) const
138+
inline Poco::SharedPtr<Poco::MongoDB::QueryRequest>
139+
Database::createQueryRequest(const std::string& collectionName) const
130140
{
131141
return new Poco::MongoDB::QueryRequest(_dbname + '.' + collectionName);
132142
}
133143

134144

135-
inline Poco::SharedPtr<Poco::MongoDB::UpdateRequest> Database::createUpdateRequest(const std::string& collectionName) const
145+
inline Poco::SharedPtr<Poco::MongoDB::UpdateRequest>
146+
Database::createUpdateRequest(const std::string& collectionName) const
136147
{
137148
return new Poco::MongoDB::UpdateRequest(_dbname + '.' + collectionName);
138149
}

‎MongoDB/include/Poco/MongoDB/DeleteRequest.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class MongoDB_API DeleteRequest : public RequestMessage
9898
private:
9999
Flags _flags;
100100
std::string _fullCollectionName;
101-
Document _selector;
101+
Document _selector;
102102
};
103103

104104

@@ -119,6 +119,7 @@ inline Document& DeleteRequest::selector()
119119
return _selector;
120120
}
121121

122+
122123
} } // namespace Poco::MongoDB
123124

124125

‎MongoDB/include/Poco/MongoDB/Document.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class ElementFindByName
6767
std::string _name;
6868
};
6969

70+
7071
class MongoDB_API Document
7172
/// Represents a BSON document
7273
{
@@ -270,6 +271,7 @@ inline void BSONReader::read<Document::Ptr>(Document::Ptr& to)
270271
to->read(_reader);
271272
}
272273

274+
273275
template<>
274276
inline void BSONWriter::write<Document::Ptr>(Document::Ptr& from)
275277
{

‎MongoDB/include/Poco/MongoDB/Element.h‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef MongoDB_Element_INCLUDED
3940
#define MongoDB_Element_INCLUDED
4041

41-
#include <string>
42-
#include <sstream>
43-
#include <iomanip>
44-
#include <set>
4542

4643
#include "Poco/BinaryReader.h"
4744
#include "Poco/BinaryWriter.h"
@@ -53,6 +50,11 @@
5350
#include "Poco/MongoDB/MongoDB.h"
5451
#include "Poco/MongoDB/BSONReader.h"
5552
#include "Poco/MongoDB/BSONWriter.h"
53+
#include <string>
54+
#include <sstream>
55+
#include <iomanip>
56+
#include <set>
57+
5658

5759
namespace Poco {
5860
namespace MongoDB {
@@ -129,7 +131,7 @@ struct ElementTraits<double>
129131

130132
// BSON UTF-8 string
131133
// spec: int32 (byte*) "\x00"
132-
// int32 is the number bytes in byte* + 1 (for trailing "\x00"
134+
// int32 is the number bytes in byte* + 1 (for trailing "\x00")
133135
template<>
134136
struct ElementTraits<std::string>
135137
{
@@ -226,6 +228,7 @@ inline void BSONReader::read<bool>(bool& to)
226228
to = b != 0;
227229
}
228230

231+
229232
template<>
230233
inline void BSONWriter::write<bool>(bool& from)
231234
{

‎MongoDB/include/Poco/MongoDB/GetMoreRequest.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef MongoDB_GetMoreRequest_INCLUDED
3940
#define MongoDB_GetMoreRequest_INCLUDED
4041

‎MongoDB/include/Poco/MongoDB/KillCursorsRequest.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef MongoDB_KillCursorsRequest_INCLUDED
3940
#define MongoDB_KillCursorsRequest_INCLUDED
4041

‎MongoDB/include/Poco/MongoDB/Message.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
// DEALINGS IN THE SOFTWARE.
3636
//
3737

38+
3839
#ifndef MongoDB_Message_INCLUDED
3940
#define MongoDB_Message_INCLUDED
4041

0 commit comments

Comments
 (0)