Permalink
Browse files

Move every class/type/enum to its own file.

Some minor cleanup (spaces and namespaces).
  • Loading branch information...
lanwin committed Feb 25, 2010
1 parent d19a95b commit db799de9d1acde3d1c9f8a9d5c41248b0f6d6c24
Showing with 204 additions and 269 deletions.
  1. +0 −3 MongoDB.GridFS/GridFile.cs
  2. +0 −3 MongoDB.GridFS/GridFileInfo.cs
  3. +0 −2 MongoDB.GridFS/GridFileStream.cs
  4. +1 −2 MongoDBDriver/AssemblyInfo.cs
  5. +0 −7 MongoDBDriver/Binary.cs
  6. +15 −26 MongoDBDriver/Bson/{Types.cs → BsonDataType.cs}
  7. +13 −0 MongoDBDriver/Bson/BsonType.cs
  8. +0 −5 MongoDBDriver/Code.cs
  9. +0 −3 MongoDBDriver/CodeWScope.cs
  10. +0 −5 MongoDBDriver/Collection.cs
  11. +1 −8 MongoDBDriver/CollectionMetaData.cs
  12. +0 −9 MongoDBDriver/Connection.cs
  13. +7 −0 MongoDBDriver/ConnectionState.cs
  14. +0 −3 MongoDBDriver/Cursor.cs
  15. +1 −2 MongoDBDriver/DatabaseMetaData.cs
  16. +0 −7 MongoDBDriver/ICursor.cs
  17. +0 −6 MongoDBDriver/IMongoCollection.cs
  18. +1 −7 MongoDBDriver/IO/DeleteMessage.cs
  19. +1 −5 MongoDBDriver/IO/GetMoreMessage.cs
  20. +1 −5 MongoDBDriver/IO/InsertMessage.cs
  21. +0 −3 MongoDBDriver/IO/KillCursorsMessage.cs
  22. +0 −3 MongoDBDriver/IO/Message.cs
  23. +1 −14 MongoDBDriver/IO/MessageHeader.cs
  24. +0 −6 MongoDBDriver/IO/MsgMessage.cs
  25. +14 −0 MongoDBDriver/IO/OpCode.cs
  26. +1 −6 MongoDBDriver/IO/QueryMessage.cs
  27. +0 −3 MongoDBDriver/IO/ReplyMessage.cs
  28. +0 −7 MongoDBDriver/IO/RequestMessage.cs
  29. +0 −7 MongoDBDriver/IO/UpdateMessage.cs
  30. +7 −0 MongoDBDriver/IndexOrder.cs
  31. +0 −1 MongoDBDriver/MapReduce.cs
  32. +0 −1 MongoDBDriver/MapReduceBuilder.cs
  33. +2 −7 MongoDBDriver/Mongo.cs
  34. +23 −0 MongoDBDriver/MongoCommException.cs
  35. +26 −0 MongoDBDriver/MongoCommandException.cs
  36. +14 −4 MongoDBDriver/MongoDB.Driver.csproj
  37. +12 −0 MongoDBDriver/MongoException.cs
  38. +0 −65 MongoDBDriver/MongoExceptions.cs
  39. +14 −0 MongoDBDriver/MongoMapReduceException.cs
  40. +16 −0 MongoDBDriver/MongoMaxKey.cs
  41. +16 −0 MongoDBDriver/MongoMinKey.cs
  42. +0 −30 MongoDBDriver/MongoMinMaxKey.cs
  43. +0 −3 MongoDBDriver/MongoRegex.cs
  44. +0 −1 MongoDBDriver/OidGenerator.cs
  45. +9 −0 MongoDBDriver/QueryOptions.cs
  46. +8 −0 MongoDBDriver/UpdateFlags.cs
  47. 0 MongoDBDriver/bin/Debug/MongoDB.Driver.dll.lastcodeanalysissucceeded
@@ -1,8 +1,5 @@
using System;
-using System.Text;
using System.IO;
-using System.Collections.Generic;
-
using MongoDB.Driver;
namespace MongoDB.GridFS
@@ -1,8 +1,5 @@
using System;
-using System.Collections.Generic;
using System.IO;
-using System.Text;
-
using MongoDB.Driver;
namespace MongoDB.GridFS
@@ -1,6 +1,4 @@
using System;
-using System.Collections;
-using System.Collections.Generic;
using System.IO;
using MongoDB.Driver;
@@ -1,6 +1,5 @@
using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
+using System.Reflection;
using System.Security.Permissions;
View
@@ -1,7 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace MongoDB.Driver
{
public class Binary{
@@ -32,8 +28,5 @@ public enum TypeCode:byte{
this.Bytes = value;
this.Subtype = TypeCode.General;
}
-
-
-
}
}
@@ -1,8 +1,5 @@
-
-using System;
-
-namespace MongoDB.Driver.Bson
-{
+namespace MongoDB.Driver.Bson
+{
public enum BsonDataType:sbyte
{
Number = 1,
@@ -18,31 +15,23 @@ public enum BsonDataType:sbyte
Null = 10, //VOID Mapped to Null in programming languages which have a Null value or type. Conceptually equivalent to Javascript null.
Regex = 11, //cstring cstring first ctring is regex expression, second cstring are regex options
Reference = 12, //int32 cstring byte[12] Deprecated. Please use a subobject instead
- //The int32 is the length in bytes of the cstring.
- //The cstring is the Namespace: full collection name.
- //The byte array is a 12 byte object id. See note on data_oid.
+ //The int32 is the length in bytes of the cstring.
+ //The cstring is the Namespace: full collection name.
+ //The byte array is a 12 byte object id. See note on data_oid.
Code = 13, //int32 cstring The int32 is the # bytes following (# of bytes in string + 1
- //for terminating NULL) and then the code as cstring. data_code should
- //be supported in BSON encoders/decoders, but has been deprecated in
- //favor of data_code_w_scope
+ //for terminating NULL) and then the code as cstring. data_code should
+ //be supported in BSON encoders/decoders, but has been deprecated in
+ //favor of data_code_w_scope
CodeWScope = 15, //int32 int32 cstring bson_object The first int32 is the total # of
- //bytes (size of cstring + size of bson_object + 8 for the two int32s).
- //The second int 32 is the size of the cstring (# of bytes in string + 1 for
- //terminating NULL). The cstring is the code. The bson_object is an object
- //mapping identifiers to values, representing the scope in which the code
- //should be evaluated.
+ //bytes (size of cstring + size of bson_object + 8 for the two int32s).
+ //The second int 32 is the size of the cstring (# of bytes in string + 1 for
+ //terminating NULL). The cstring is the code. The bson_object is an object
+ //mapping identifiers to values, representing the scope in which the code
+ //should be evaluated.
Integer = 16, //int32
Timestamp = 17, //int64 first 4 are a timestamp, next 4 are an incremented field
Long = 18, //int64 64 bit integer
MinKey = -1, //VOID //Special type that compares lower than all other types.
MaxKey = 127 //VOID //Special type that compares higher than all other types.
- }
-
- public interface BsonType{
- Int32 Size{get;}
- Byte TypeNum{get;}
- int Read(BsonReader reader);
- void Write(BsonWriter writer);
- Object ToNative();
- }
-}
+ }
+}
@@ -0,0 +1,13 @@
+
+using System;
+
+namespace MongoDB.Driver.Bson
+{
+ public interface BsonType{
+ Int32 Size{get;}
+ Byte TypeNum{get;}
+ int Read(BsonReader reader);
+ void Write(BsonWriter writer);
+ Object ToNative();
+ }
+}
View
@@ -1,10 +1,5 @@
-
-using System;
-
namespace MongoDB.Driver
{
-
-
public class Code
{
private string value;
@@ -1,10 +1,7 @@
-
using System;
namespace MongoDB.Driver
{
-
-
public class CodeWScope : Code
{
private Document scope;
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
-
-using MongoDB.Driver.Bson;
using MongoDB.Driver.IO;
namespace MongoDB.Driver
@@ -11,8 +9,6 @@ public class Collection : IMongoCollection
{
private static OidGenerator oidGenerator = new OidGenerator();
-
-
private Connection connection;
private string name;
@@ -38,7 +34,6 @@ public class Collection : IMongoCollection
return metaData;
}
}
-
public Collection(string name, Connection conn, string dbName)
{
@@ -1,15 +1,8 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Text;
namespace MongoDB.Driver
{
- public enum IndexOrder:int{
- Descending = -1,
- Ascending = 1
- }
-
/// <summary>
/// Lazily loaded meta data on the collection.
/// </summary>
@@ -1,20 +1,11 @@
using System;
-using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
-using System.Net;
using System.Net.Sockets;
-
-using MongoDB.Driver.Bson;
using MongoDB.Driver.IO;
namespace MongoDB.Driver
{
- public enum ConnectionState{
- Closed = 0,
- Opened = 1,
- }
-
/// <summary>
/// Description of Connection.
/// </summary>
@@ -0,0 +1,7 @@
+namespace MongoDB.Driver
+{
+ public enum ConnectionState{
+ Closed = 0,
+ Opened = 1,
+ }
+}
View
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
-
-using MongoDB.Driver.Bson;
using MongoDB.Driver.IO;
namespace MongoDB.Driver
{
-
public class Cursor : ICursor {
private Connection connection;
@@ -6,8 +6,7 @@ namespace MongoDB.Driver
/// Administration of metadata for a database.
/// </summary>
public class DatabaseMetaData
- {
-
+ {
private Connection connection;
private string name;
private Database db;
View
@@ -18,11 +18,4 @@ public interface ICursor : IDisposable {
bool Modifiable { get; }
IEnumerable<Document> Documents { get; }
}
-
- public enum QueryOptions:int{
- None = 0,
- TailableCursor = 2,
- SlaveOK = 4,
- NoCursorTimeout = 16
- }
}
@@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
-using System.Text;
namespace MongoDB.Driver
{
- public enum UpdateFlags:int
- {
- Upsert = 1,
- MultiUpdate = 2
- }
public interface IMongoCollection
{
string Name { get; }
@@ -1,15 +1,9 @@
/*
* User: scorder
- */
-using System;
-using System.IO;
-
-using MongoDB.Driver.Bson;
+ */using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
{
-
-
public class DeleteMessage : RequestMessage
{
//struct {
@@ -1,8 +1,4 @@
-using System;
-using System.IO;
-using System.Text;
-
-
+using System;
using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
@@ -1,8 +1,3 @@
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.IO;
-
using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
@@ -33,6 +28,7 @@ public class InsertMessage : RequestMessage
public InsertMessage(){
this.Header = new MessageHeader(OpCode.Insert);
}
+
protected override void WriteBody (BsonWriter writer){
writer.WriteValue(BsonDataType.Integer,0);
writer.WriteString(this.FullCollectionName);
@@ -1,6 +1,3 @@
-using System;
-using System.IO;
-
using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
@@ -1,10 +1,7 @@
-using System;
-using System.IO;
using System.Text;
namespace MongoDB.Driver.IO
{
-
public class Message
{
protected UTF8Encoding encoding = new UTF8Encoding();
@@ -5,20 +5,7 @@
using System;
namespace MongoDB.Driver.IO
-{
- public enum OpCode{
- Reply = 1, //Reply to a client request. responseTo is set
- Msg = 1000, //generic msg command followed by a string
- Update = 2001, //update document
- Insert = 2002, //insert new document
- GetByOID = 2003, //is this used?
- Query = 2004, //query a collection
- GetMore = 2005, //Get more data from a query. See Cursors
- Delete = 2006, //Delete documents
- KillCursors = 2007 //Tell database client is done with a cursor
- }
-
- /// <summary>
+{ /// <summary>
/// In general, each Message consists of a standard message header followed by request-specific data.
/// </summary>
public class MessageHeader
@@ -1,13 +1,7 @@
-using System;
-using System.IO;
-using System.Text;
-
using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
{
-
-
public class MsgMessage : RequestMessage
{
// struct {
View
@@ -0,0 +1,14 @@
+namespace MongoDB.Driver.IO
+{
+ public enum OpCode{
+ Reply = 1, //Reply to a client request. responseTo is set
+ Msg = 1000, //generic msg command followed by a string
+ Update = 2001, //update document
+ Insert = 2002, //insert new document
+ GetByOID = 2003, //is this used?
+ Query = 2004, //query a collection
+ GetMore = 2005, //Get more data from a query. See Cursors
+ Delete = 2006, //Delete documents
+ KillCursors = 2007 //Tell database client is done with a cursor
+ }
+}
@@ -1,8 +1,4 @@
-using System;
-using System.IO;
-using System.Text;
-
-
+using System;
using MongoDB.Driver.Bson;
namespace MongoDB.Driver.IO
@@ -19,7 +15,6 @@ public class QueryMessage : RequestMessage
// int32 numberToReturn; // number of documents to return in the first OP_REPLY
// BSON query ; // query object. See below for details.
// [ BSON returnFieldSelector; ] // OPTIONAL : selector indicating the fields to return. See below for details.
-
#region "Properties"
private QueryOptions options;
Oops, something went wrong.

0 comments on commit db799de

Please sign in to comment.