C# Class MongoDB.Bson.IO.BsonWriter

Represents a BSON writer for some external format (see subclasses).
Inheritance: IDisposable
Afficher le fichier Open project: egametang/Egametang Class Usage Examples

Méthodes publiques

Méthode Description
Close ( ) : void

Closes the writer.

Create ( BsonBinaryWriterSettings settings ) : BsonWriter

Creates a BsonWriter to a BsonBuffer.

Create ( MongoDB.Bson.IO.BsonBuffer buffer ) : BsonWriter

Creates a BsonWriter to a BsonBuffer.

Create ( MongoDB.Bson.IO.BsonBuffer buffer, BsonBinaryWriterSettings settings ) : BsonWriter

Creates a BsonWriter to a BsonBuffer.

Create ( BsonDocument document ) : BsonWriter

Creates a BsonWriter to a BsonDocument.

Create ( BsonDocument document, BsonDocumentWriterSettings settings ) : BsonWriter

Creates a BsonWriter to a BsonDocument.

Create ( Stream stream ) : BsonWriter

Creates a BsonWriter to a BSON Stream.

Create ( Stream stream, BsonBinaryWriterSettings settings ) : BsonWriter

Creates a BsonWriter to a BSON Stream.

Create ( TextWriter writer ) : BsonWriter

Creates a BsonWriter to a JSON TextWriter.

Create ( TextWriter writer, JsonWriterSettings settings ) : BsonWriter

Creates a BsonWriter to a JSON TextWriter.

Dispose ( ) : void

Disposes of any resources used by the writer.

Flush ( ) : void

Flushes any pending data to the output destination.

WriteBinaryData ( BsonBinaryData binaryData ) : void

Writes BSON binary data to the writer.

WriteBinaryData ( string name, BsonBinaryData binaryData ) : void

Writes a BSON binary data element to the writer.

WriteBoolean ( bool value ) : void

Writes a BSON Boolean to the writer.

WriteBoolean ( string name, bool value ) : void

Writes a BSON Boolean element to the writer.

WriteBytes ( byte bytes ) : void

Writes BSON binary data to the writer.

WriteBytes ( string name, byte bytes ) : void

Writes a BSON binary data element to the writer.

WriteDateTime ( long value ) : void

Writes a BSON DateTime to the writer.

WriteDateTime ( string name, long value ) : void

Writes a BSON DateTime element to the writer.

WriteDouble ( double value ) : void

Writes a BSON Double to the writer.

WriteDouble ( string name, double value ) : void

Writes a BSON Double element to the writer.

WriteEndArray ( ) : void

Writes the end of a BSON array to the writer.

WriteEndDocument ( ) : void

Writes the end of a BSON document to the writer.

WriteInt32 ( int value ) : void

Writes a BSON Int32 to the writer.

WriteInt32 ( string name, int value ) : void

Writes a BSON Int32 element to the writer.

WriteInt64 ( long value ) : void

Writes a BSON Int64 to the writer.

WriteInt64 ( string name, long value ) : void

Writes a BSON Int64 element to the writer.

WriteJavaScript ( string code ) : void

Writes a BSON JavaScript to the writer.

WriteJavaScript ( string name, string code ) : void

Writes a BSON JavaScript element to the writer.

WriteJavaScriptWithScope ( string code ) : void

Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).

WriteJavaScriptWithScope ( string name, string code ) : void

Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).

WriteMaxKey ( ) : void

Writes a BSON MaxKey to the writer.

WriteMaxKey ( string name ) : void

Writes a BSON MaxKey element to the writer.

WriteMinKey ( ) : void

Writes a BSON MinKey to the writer.

WriteMinKey ( string name ) : void

Writes a BSON MinKey element to the writer.

WriteName ( string name ) : void

Writes the name of an element to the writer.

WriteNull ( ) : void

Writes a BSON null to the writer.

WriteNull ( string name ) : void

Writes a BSON null element to the writer.

WriteObjectId ( ObjectId objectId ) : void

Writes a BSON ObjectId to the writer.

WriteObjectId ( string name, ObjectId objectId ) : void

Writes a BSON ObjectId element to the writer.

WriteRawBsonArray ( IByteBuffer slice ) : void

Writes a raw BSON array.

WriteRawBsonArray ( string name, IByteBuffer slice ) : void

Writes a raw BSON array.

WriteRawBsonDocument ( IByteBuffer slice ) : void

Writes a raw BSON document.

WriteRawBsonDocument ( string name, IByteBuffer slice ) : void

Writes a raw BSON document.

WriteRegularExpression ( BsonRegularExpression regex ) : void

Writes a BSON regular expression to the writer.

WriteRegularExpression ( string name, BsonRegularExpression regex ) : void

Writes a BSON regular expression element to the writer.

WriteStartArray ( ) : void

Writes the start of a BSON array to the writer.

WriteStartArray ( string name ) : void

Writes the start of a BSON array element to the writer.

WriteStartDocument ( ) : void

Writes the start of a BSON document to the writer.

WriteStartDocument ( string name ) : void

Writes the start of a BSON document element to the writer.

WriteString ( string value ) : void

Writes a BSON String to the writer.

WriteString ( string name, string value ) : void

Writes a BSON String element to the writer.

WriteSymbol ( string value ) : void

Writes a BSON Symbol to the writer.

WriteSymbol ( string name, string value ) : void

Writes a BSON Symbol element to the writer.

WriteTimestamp ( long value ) : void

Writes a BSON timestamp to the writer.

WriteTimestamp ( string name, long value ) : void

Writes a BSON timestamp element to the writer.

WriteUndefined ( ) : void

Writes a BSON undefined to the writer.

WriteUndefined ( string name ) : void

Writes a BSON undefined element to the writer.

Méthodes protégées

Méthode Description
BsonWriter ( BsonWriterSettings settings ) : System

Initializes a new instance of the BsonWriter class.

CheckElementName ( string name ) : void

Checks that the element name is valid.

Dispose ( bool disposing ) : void

Disposes of any resources used by the writer.

ThrowInvalidContextType ( string methodName, ContextType actualContextType ) : void

Throws an InvalidOperationException when the method called is not valid for the current ContextType.

ThrowInvalidState ( string methodName ) : void

Throws an InvalidOperationException when the method called is not valid for the current state.

Private Methods

Méthode Description
WriteBinaryData ( byte bytes, BsonBinarySubType subType ) : void
WriteBinaryData ( byte bytes, BsonBinarySubType subType, GuidRepresentation guidRepresentation ) : void
WriteBinaryData ( string name, byte bytes, BsonBinarySubType subType ) : void
WriteBinaryData ( string name, byte bytes, BsonBinarySubType subType, GuidRepresentation guidRepresentation ) : void
WriteObjectId ( int timestamp, int machine, short pid, int increment ) : void
WriteObjectId ( string name, int timestamp, int machine, short pid, int increment ) : void
WriteRegularExpression ( string pattern, string options ) : void
WriteRegularExpression ( string name, string pattern, string options ) : void

Method Details

BsonWriter() protected méthode

Initializes a new instance of the BsonWriter class.
protected BsonWriter ( BsonWriterSettings settings ) : System
settings BsonWriterSettings The writer settings.
Résultat System

CheckElementName() protected méthode

Checks that the element name is valid.
protected CheckElementName ( string name ) : void
name string The element name to be checked.
Résultat void

Close() public abstract méthode

Closes the writer.
public abstract Close ( ) : void
Résultat void

Create() public static méthode

Creates a BsonWriter to a BsonBuffer.
public static Create ( BsonBinaryWriterSettings settings ) : BsonWriter
settings BsonBinaryWriterSettings Optional BsonBinaryWriterSettings.
Résultat BsonWriter

Create() public static méthode

Creates a BsonWriter to a BsonBuffer.
public static Create ( MongoDB.Bson.IO.BsonBuffer buffer ) : BsonWriter
buffer MongoDB.Bson.IO.BsonBuffer A BsonBuffer.
Résultat BsonWriter

Create() public static méthode

Creates a BsonWriter to a BsonBuffer.
public static Create ( MongoDB.Bson.IO.BsonBuffer buffer, BsonBinaryWriterSettings settings ) : BsonWriter
buffer MongoDB.Bson.IO.BsonBuffer A BsonBuffer.
settings BsonBinaryWriterSettings Optional BsonBinaryWriterSettings.
Résultat BsonWriter

Create() public static méthode

Creates a BsonWriter to a BsonDocument.
public static Create ( BsonDocument document ) : BsonWriter
document BsonDocument A BsonDocument.
Résultat BsonWriter

Create() public static méthode

Creates a BsonWriter to a BsonDocument.
public static Create ( BsonDocument document, BsonDocumentWriterSettings settings ) : BsonWriter
document BsonDocument A BsonDocument.
settings BsonDocumentWriterSettings The settings.
Résultat BsonWriter

Create() public static méthode

Creates a BsonWriter to a BSON Stream.
public static Create ( Stream stream ) : BsonWriter
stream Stream A Stream.
Résultat BsonWriter

Create() public static méthode

Creates a BsonWriter to a BSON Stream.
public static Create ( Stream stream, BsonBinaryWriterSettings settings ) : BsonWriter
stream Stream A Stream.
settings BsonBinaryWriterSettings Optional BsonBinaryWriterSettings.
Résultat BsonWriter

Create() public static méthode

Creates a BsonWriter to a JSON TextWriter.
public static Create ( TextWriter writer ) : BsonWriter
writer System.IO.TextWriter A TextWriter.
Résultat BsonWriter

Create() public static méthode

Creates a BsonWriter to a JSON TextWriter.
public static Create ( TextWriter writer, JsonWriterSettings settings ) : BsonWriter
writer System.IO.TextWriter A TextWriter.
settings JsonWriterSettings Optional JsonWriterSettings.
Résultat BsonWriter

Dispose() public méthode

Disposes of any resources used by the writer.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Disposes of any resources used by the writer.
protected Dispose ( bool disposing ) : void
disposing bool True if called from Dispose.
Résultat void

Flush() public abstract méthode

Flushes any pending data to the output destination.
public abstract Flush ( ) : void
Résultat void

ThrowInvalidContextType() protected méthode

Throws an InvalidOperationException when the method called is not valid for the current ContextType.
protected ThrowInvalidContextType ( string methodName, ContextType actualContextType ) : void
methodName string The name of the method.
actualContextType ContextType The actual ContextType.
Résultat void

ThrowInvalidState() protected méthode

Throws an InvalidOperationException when the method called is not valid for the current state.
protected ThrowInvalidState ( string methodName ) : void
methodName string The name of the method.
Résultat void

WriteBinaryData() public abstract méthode

Writes BSON binary data to the writer.
public abstract WriteBinaryData ( BsonBinaryData binaryData ) : void
binaryData BsonBinaryData The binary data.
Résultat void

WriteBinaryData() public méthode

Writes a BSON binary data element to the writer.
public WriteBinaryData ( string name, BsonBinaryData binaryData ) : void
name string The name of the element.
binaryData BsonBinaryData The binary data.
Résultat void

WriteBoolean() public abstract méthode

Writes a BSON Boolean to the writer.
public abstract WriteBoolean ( bool value ) : void
value bool The Boolean value.
Résultat void

WriteBoolean() public méthode

Writes a BSON Boolean element to the writer.
public WriteBoolean ( string name, bool value ) : void
name string The name of the element.
value bool The Boolean value.
Résultat void

WriteBytes() public abstract méthode

Writes BSON binary data to the writer.
public abstract WriteBytes ( byte bytes ) : void
bytes byte The bytes.
Résultat void

WriteBytes() public méthode

Writes a BSON binary data element to the writer.
public WriteBytes ( string name, byte bytes ) : void
name string The name of the element.
bytes byte The bytes.
Résultat void

WriteDateTime() public abstract méthode

Writes a BSON DateTime to the writer.
public abstract WriteDateTime ( long value ) : void
value long The number of milliseconds since the Unix epoch.
Résultat void

WriteDateTime() public méthode

Writes a BSON DateTime element to the writer.
public WriteDateTime ( string name, long value ) : void
name string The name of the element.
value long The number of milliseconds since the Unix epoch.
Résultat void

WriteDouble() public abstract méthode

Writes a BSON Double to the writer.
public abstract WriteDouble ( double value ) : void
value double The Double value.
Résultat void

WriteDouble() public méthode

Writes a BSON Double element to the writer.
public WriteDouble ( string name, double value ) : void
name string The name of the element.
value double The Double value.
Résultat void

WriteEndArray() public méthode

Writes the end of a BSON array to the writer.
public WriteEndArray ( ) : void
Résultat void

WriteEndDocument() public méthode

Writes the end of a BSON document to the writer.
public WriteEndDocument ( ) : void
Résultat void

WriteInt32() public abstract méthode

Writes a BSON Int32 to the writer.
public abstract WriteInt32 ( int value ) : void
value int The Int32 value.
Résultat void

WriteInt32() public méthode

Writes a BSON Int32 element to the writer.
public WriteInt32 ( string name, int value ) : void
name string The name of the element.
value int The Int32 value.
Résultat void

WriteInt64() public abstract méthode

Writes a BSON Int64 to the writer.
public abstract WriteInt64 ( long value ) : void
value long The Int64 value.
Résultat void

WriteInt64() public méthode

Writes a BSON Int64 element to the writer.
public WriteInt64 ( string name, long value ) : void
name string The name of the element.
value long The Int64 value.
Résultat void

WriteJavaScript() public abstract méthode

Writes a BSON JavaScript to the writer.
public abstract WriteJavaScript ( string code ) : void
code string The JavaScript code.
Résultat void

WriteJavaScript() public méthode

Writes a BSON JavaScript element to the writer.
public WriteJavaScript ( string name, string code ) : void
name string The name of the element.
code string The JavaScript code.
Résultat void

WriteJavaScriptWithScope() public abstract méthode

Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
public abstract WriteJavaScriptWithScope ( string code ) : void
code string The JavaScript code.
Résultat void

WriteJavaScriptWithScope() public méthode

Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).
public WriteJavaScriptWithScope ( string name, string code ) : void
name string The name of the element.
code string The JavaScript code.
Résultat void

WriteMaxKey() public abstract méthode

Writes a BSON MaxKey to the writer.
public abstract WriteMaxKey ( ) : void
Résultat void

WriteMaxKey() public méthode

Writes a BSON MaxKey element to the writer.
public WriteMaxKey ( string name ) : void
name string The name of the element.
Résultat void

WriteMinKey() public abstract méthode

Writes a BSON MinKey to the writer.
public abstract WriteMinKey ( ) : void
Résultat void

WriteMinKey() public méthode

Writes a BSON MinKey element to the writer.
public WriteMinKey ( string name ) : void
name string The name of the element.
Résultat void

WriteName() public méthode

Writes the name of an element to the writer.
public WriteName ( string name ) : void
name string The name of the element.
Résultat void

WriteNull() public abstract méthode

Writes a BSON null to the writer.
public abstract WriteNull ( ) : void
Résultat void

WriteNull() public méthode

Writes a BSON null element to the writer.
public WriteNull ( string name ) : void
name string The name of the element.
Résultat void

WriteObjectId() public abstract méthode

Writes a BSON ObjectId to the writer.
public abstract WriteObjectId ( ObjectId objectId ) : void
objectId ObjectId The ObjectId.
Résultat void

WriteObjectId() public méthode

Writes a BSON ObjectId element to the writer.
public WriteObjectId ( string name, ObjectId objectId ) : void
name string The name of the element.
objectId ObjectId The ObjectId.
Résultat void

WriteRawBsonArray() public méthode

Writes a raw BSON array.
public WriteRawBsonArray ( IByteBuffer slice ) : void
slice IByteBuffer The byte buffer containing the raw BSON array.
Résultat void

WriteRawBsonArray() public méthode

Writes a raw BSON array.
public WriteRawBsonArray ( string name, IByteBuffer slice ) : void
name string The name.
slice IByteBuffer The byte buffer containing the raw BSON array.
Résultat void

WriteRawBsonDocument() public méthode

Writes a raw BSON document.
public WriteRawBsonDocument ( IByteBuffer slice ) : void
slice IByteBuffer The byte buffer containing the raw BSON document.
Résultat void

WriteRawBsonDocument() public méthode

Writes a raw BSON document.
public WriteRawBsonDocument ( string name, IByteBuffer slice ) : void
name string The name.
slice IByteBuffer The byte buffer containing the raw BSON document.
Résultat void

WriteRegularExpression() public abstract méthode

Writes a BSON regular expression to the writer.
public abstract WriteRegularExpression ( BsonRegularExpression regex ) : void
regex BsonRegularExpression A BsonRegularExpression.
Résultat void

WriteRegularExpression() public méthode

Writes a BSON regular expression element to the writer.
public WriteRegularExpression ( string name, BsonRegularExpression regex ) : void
name string The name of the element.
regex BsonRegularExpression A BsonRegularExpression.
Résultat void

WriteStartArray() public méthode

Writes the start of a BSON array to the writer.
public WriteStartArray ( ) : void
Résultat void

WriteStartArray() public méthode

Writes the start of a BSON array element to the writer.
public WriteStartArray ( string name ) : void
name string The name of the element.
Résultat void

WriteStartDocument() public méthode

Writes the start of a BSON document to the writer.
public WriteStartDocument ( ) : void
Résultat void

WriteStartDocument() public méthode

Writes the start of a BSON document element to the writer.
public WriteStartDocument ( string name ) : void
name string The name of the element.
Résultat void

WriteString() public abstract méthode

Writes a BSON String to the writer.
public abstract WriteString ( string value ) : void
value string The String value.
Résultat void

WriteString() public méthode

Writes a BSON String element to the writer.
public WriteString ( string name, string value ) : void
name string The name of the element.
value string The String value.
Résultat void

WriteSymbol() public abstract méthode

Writes a BSON Symbol to the writer.
public abstract WriteSymbol ( string value ) : void
value string The symbol.
Résultat void

WriteSymbol() public méthode

Writes a BSON Symbol element to the writer.
public WriteSymbol ( string name, string value ) : void
name string The name of the element.
value string The symbol.
Résultat void

WriteTimestamp() public abstract méthode

Writes a BSON timestamp to the writer.
public abstract WriteTimestamp ( long value ) : void
value long The combined timestamp/increment value.
Résultat void

WriteTimestamp() public méthode

Writes a BSON timestamp element to the writer.
public WriteTimestamp ( string name, long value ) : void
name string The name of the element.
value long The combined timestamp/increment value.
Résultat void

WriteUndefined() public abstract méthode

Writes a BSON undefined to the writer.
public abstract WriteUndefined ( ) : void
Résultat void

WriteUndefined() public méthode

Writes a BSON undefined element to the writer.
public WriteUndefined ( string name ) : void
name string The name of the element.
Résultat void