C# Класс MongoDB.Bson.IO.BsonWriter

Represents a BSON writer for some external format (see subclasses).
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

BsonWriter() защищенный Метод

Initializes a new instance of the BsonWriter class.
protected BsonWriter ( BsonWriterSettings settings ) : System
settings BsonWriterSettings The writer settings.
Результат System

CheckElementName() защищенный Метод

Checks that the element name is valid.
protected CheckElementName ( string name ) : void
name string The element name to be checked.
Результат void

Close() публичный абстрактный Метод

Closes the writer.
public abstract Close ( ) : void
Результат void

Create() публичный статический Метод

Creates a BsonWriter to a BsonBuffer.
public static Create ( BsonBinaryWriterSettings settings ) : BsonWriter
settings BsonBinaryWriterSettings Optional BsonBinaryWriterSettings.
Результат BsonWriter

Create() публичный статический Метод

Creates a BsonWriter to a BsonBuffer.
public static Create ( MongoDB.Bson.IO.BsonBuffer buffer ) : BsonWriter
buffer MongoDB.Bson.IO.BsonBuffer A BsonBuffer.
Результат BsonWriter

Create() публичный статический Метод

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.
Результат BsonWriter

Create() публичный статический Метод

Creates a BsonWriter to a BsonDocument.
public static Create ( BsonDocument document ) : BsonWriter
document BsonDocument A BsonDocument.
Результат BsonWriter

Create() публичный статический Метод

Creates a BsonWriter to a BsonDocument.
public static Create ( BsonDocument document, BsonDocumentWriterSettings settings ) : BsonWriter
document BsonDocument A BsonDocument.
settings BsonDocumentWriterSettings The settings.
Результат BsonWriter

Create() публичный статический Метод

Creates a BsonWriter to a BSON Stream.
public static Create ( Stream stream ) : BsonWriter
stream Stream A Stream.
Результат BsonWriter

Create() публичный статический Метод

Creates a BsonWriter to a BSON Stream.
public static Create ( Stream stream, BsonBinaryWriterSettings settings ) : BsonWriter
stream Stream A Stream.
settings BsonBinaryWriterSettings Optional BsonBinaryWriterSettings.
Результат BsonWriter

Create() публичный статический Метод

Creates a BsonWriter to a JSON TextWriter.
public static Create ( TextWriter writer ) : BsonWriter
writer System.IO.TextWriter A TextWriter.
Результат BsonWriter

Create() публичный статический Метод

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.
Результат BsonWriter

Dispose() публичный Метод

Disposes of any resources used by the writer.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Disposes of any resources used by the writer.
protected Dispose ( bool disposing ) : void
disposing bool True if called from Dispose.
Результат void

Flush() публичный абстрактный Метод

Flushes any pending data to the output destination.
public abstract Flush ( ) : void
Результат void

ThrowInvalidContextType() защищенный Метод

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.
Результат void

ThrowInvalidState() защищенный Метод

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.
Результат void

WriteBinaryData() публичный абстрактный Метод

Writes BSON binary data to the writer.
public abstract WriteBinaryData ( BsonBinaryData binaryData ) : void
binaryData BsonBinaryData The binary data.
Результат void

WriteBinaryData() публичный Метод

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.
Результат void

WriteBoolean() публичный абстрактный Метод

Writes a BSON Boolean to the writer.
public abstract WriteBoolean ( bool value ) : void
value bool The Boolean value.
Результат void

WriteBoolean() публичный Метод

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.
Результат void

WriteBytes() публичный абстрактный Метод

Writes BSON binary data to the writer.
public abstract WriteBytes ( byte bytes ) : void
bytes byte The bytes.
Результат void

WriteBytes() публичный Метод

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.
Результат void

WriteDateTime() публичный абстрактный Метод

Writes a BSON DateTime to the writer.
public abstract WriteDateTime ( long value ) : void
value long The number of milliseconds since the Unix epoch.
Результат void

WriteDateTime() публичный Метод

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.
Результат void

WriteDouble() публичный абстрактный Метод

Writes a BSON Double to the writer.
public abstract WriteDouble ( double value ) : void
value double The Double value.
Результат void

WriteDouble() публичный Метод

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.
Результат void

WriteEndArray() публичный Метод

Writes the end of a BSON array to the writer.
public WriteEndArray ( ) : void
Результат void

WriteEndDocument() публичный Метод

Writes the end of a BSON document to the writer.
public WriteEndDocument ( ) : void
Результат void

WriteInt32() публичный абстрактный Метод

Writes a BSON Int32 to the writer.
public abstract WriteInt32 ( int value ) : void
value int The Int32 value.
Результат void

WriteInt32() публичный Метод

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.
Результат void

WriteInt64() публичный абстрактный Метод

Writes a BSON Int64 to the writer.
public abstract WriteInt64 ( long value ) : void
value long The Int64 value.
Результат void

WriteInt64() публичный Метод

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.
Результат void

WriteJavaScript() публичный абстрактный Метод

Writes a BSON JavaScript to the writer.
public abstract WriteJavaScript ( string code ) : void
code string The JavaScript code.
Результат void

WriteJavaScript() публичный Метод

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.
Результат void

WriteJavaScriptWithScope() публичный абстрактный Метод

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.
Результат void

WriteJavaScriptWithScope() публичный Метод

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.
Результат void

WriteMaxKey() публичный абстрактный Метод

Writes a BSON MaxKey to the writer.
public abstract WriteMaxKey ( ) : void
Результат void

WriteMaxKey() публичный Метод

Writes a BSON MaxKey element to the writer.
public WriteMaxKey ( string name ) : void
name string The name of the element.
Результат void

WriteMinKey() публичный абстрактный Метод

Writes a BSON MinKey to the writer.
public abstract WriteMinKey ( ) : void
Результат void

WriteMinKey() публичный Метод

Writes a BSON MinKey element to the writer.
public WriteMinKey ( string name ) : void
name string The name of the element.
Результат void

WriteName() публичный Метод

Writes the name of an element to the writer.
public WriteName ( string name ) : void
name string The name of the element.
Результат void

WriteNull() публичный абстрактный Метод

Writes a BSON null to the writer.
public abstract WriteNull ( ) : void
Результат void

WriteNull() публичный Метод

Writes a BSON null element to the writer.
public WriteNull ( string name ) : void
name string The name of the element.
Результат void

WriteObjectId() публичный абстрактный Метод

Writes a BSON ObjectId to the writer.
public abstract WriteObjectId ( ObjectId objectId ) : void
objectId ObjectId The ObjectId.
Результат void

WriteObjectId() публичный Метод

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.
Результат void

WriteRawBsonArray() публичный Метод

Writes a raw BSON array.
public WriteRawBsonArray ( IByteBuffer slice ) : void
slice IByteBuffer The byte buffer containing the raw BSON array.
Результат void

WriteRawBsonArray() публичный Метод

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.
Результат void

WriteRawBsonDocument() публичный Метод

Writes a raw BSON document.
public WriteRawBsonDocument ( IByteBuffer slice ) : void
slice IByteBuffer The byte buffer containing the raw BSON document.
Результат void

WriteRawBsonDocument() публичный Метод

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.
Результат void

WriteRegularExpression() публичный абстрактный Метод

Writes a BSON regular expression to the writer.
public abstract WriteRegularExpression ( BsonRegularExpression regex ) : void
regex BsonRegularExpression A BsonRegularExpression.
Результат void

WriteRegularExpression() публичный Метод

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.
Результат void

WriteStartArray() публичный Метод

Writes the start of a BSON array to the writer.
public WriteStartArray ( ) : void
Результат void

WriteStartArray() публичный Метод

Writes the start of a BSON array element to the writer.
public WriteStartArray ( string name ) : void
name string The name of the element.
Результат void

WriteStartDocument() публичный Метод

Writes the start of a BSON document to the writer.
public WriteStartDocument ( ) : void
Результат void

WriteStartDocument() публичный Метод

Writes the start of a BSON document element to the writer.
public WriteStartDocument ( string name ) : void
name string The name of the element.
Результат void

WriteString() публичный абстрактный Метод

Writes a BSON String to the writer.
public abstract WriteString ( string value ) : void
value string The String value.
Результат void

WriteString() публичный Метод

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.
Результат void

WriteSymbol() публичный абстрактный Метод

Writes a BSON Symbol to the writer.
public abstract WriteSymbol ( string value ) : void
value string The symbol.
Результат void

WriteSymbol() публичный Метод

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.
Результат void

WriteTimestamp() публичный абстрактный Метод

Writes a BSON timestamp to the writer.
public abstract WriteTimestamp ( long value ) : void
value long The combined timestamp/increment value.
Результат void

WriteTimestamp() публичный Метод

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.
Результат void

WriteUndefined() публичный абстрактный Метод

Writes a BSON undefined to the writer.
public abstract WriteUndefined ( ) : void
Результат void

WriteUndefined() публичный Метод

Writes a BSON undefined element to the writer.
public WriteUndefined ( string name ) : void
name string The name of the element.
Результат void