StringOutputAdapter

StringOutputAdapter class

Represents an output adapter that collects output as a String.

public class StringOutputAdapter : OutputAdapter

Constructors

Name Description
StringOutputAdapter(OutputFormat) Initializes a new instance of the StringOutputAdapter class.

Properties

Name Description
OutputFormat { get; } Gets the output format.

Methods

Name Description
GetResult() Gets the resulting string.

Remarks

Learn more

Examples

The example demonstrates a typical usage of the class.

string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";

Index index = new Index(indexFolder); // Creating an index in the specified folder

index.Add(documentsFolder); // Indexing documents from the specified folder

DocumentInfo[] documents = index.GetIndexedDocuments(); // Getting information on indexed documents

StringOutputAdapter adapter = new StringOutputAdapter(OutputFormat.Html); // Creating a string output adapter
index.GetDocumentText(documents[0], adapter); // Generating a document text into the adapter
String result = adapter.GetResult(); // Getting a result

See Also