Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Waher.Content.ConversionState Class Reference

Contains the state of a content conversion process. More...

Public Member Functions

 ConversionState (string FromContentType, Stream From, string FromFileName, string LocalResourceName, string URL, string ToContentType, Stream To, Variables Session, ICodecProgress Progress, IResourceMap ResourceMap, TryGetLocalResourceFileName TryGetLocalResourceFileName, params string[] PossibleContentTypes)
 Contains the state of a content conversion process. More...
 
bool TryGetLocalResourceFileName (string Resource, string Host, out string FileName)
 Tries to get a file name for a resource, if local. More...
 

Properties

string FromContentType [get]
 Content type of the content to convert from. More...
 
Stream From [get]
 Stream pointing to binary representation of content. More...
 
string FromFileName [get, set]
 If the content is coming from a file, this parameter contains the name of that file. Otherwise, the parameter is the empty string. More...
 
string LocalResourceName [get, set]
 Local resource name of file, if accessed from a web server. More...
 
string URL [get]
 URL of resource, if accessed from a web server. More...
 
string ToContentType [get, set]
 Content type of the content to convert to. This value might be changed, in case the converter finds a better option. May get updated during the conversion process. More...
 
Stream To [get]
 Stream pointing to where binary representation of content is to be sent. More...
 
Variables Session [get]
 Session states. More...
 
ICodecProgress Progress [get]
 Optional interface for reporting progress during conversion. More...
 
IResourceMap ResourceMap [get]
 Optional resource map. More...
 
string[] PossibleContentTypes [get]
 Possible content types the converter is allowed to convert to. Can be null if there are no alternatives. More...
 
Exception Error [get, set]
 Error response, in case conversion should return an error. More...
 
bool HasError [get]
 If an error should be returned. More...
 

Detailed Description

Contains the state of a content conversion process.

Definition at line 20 of file ConversionState.cs.

Constructor & Destructor Documentation

◆ ConversionState()

Waher.Content.ConversionState.ConversionState ( string  FromContentType,
Stream  From,
string  FromFileName,
string  LocalResourceName,
string  URL,
string  ToContentType,
Stream  To,
Variables  Session,
ICodecProgress  Progress,
IResourceMap  ResourceMap,
TryGetLocalResourceFileName  TryGetLocalResourceFileName,
params string[]  PossibleContentTypes 
)

Contains the state of a content conversion process.

Parameters
FromContentTypeContent type of the content to convert from.
FromStream pointing to binary representation of content.
FromFileNameIf the content is coming from a file, this parameter contains the name of that file. Otherwise, the parameter is the empty string.
LocalResourceNameLocal resource name of file, if accessed from a web server.
URLURL of resource, if accessed from a web server.
ToContentTypeContent type of the content to convert to. This value might be changed, in case the converter finds a better option.
ToStream pointing to where binary representation of content is to be sent.
SessionSession states.
ProgressOptional interface for reporting progress during conversion.
ResourceMapOptional resource map.
TryGetLocalResourceFileNameCallback function to get a local file name from a resource.
PossibleContentTypesPossible content types the converter is allowed to convert to. Can be null if there are no alternatives.

Definition at line 42 of file ConversionState.cs.

Member Function Documentation

◆ TryGetLocalResourceFileName()

bool Waher.Content.ConversionState.TryGetLocalResourceFileName ( string  Resource,
string  Host,
out string  FileName 
)

Tries to get a file name for a resource, if local.

Parameters
ResourceResource
HostOptional host, if available.
FileNameFile name, if resource identified as a local resource.
Returns
If successful in identifying a local file name for the resource.

Definition at line 135 of file ConversionState.cs.

Property Documentation

◆ Error

Exception Waher.Content.ConversionState.Error
getset

Error response, in case conversion should return an error.

Definition at line 121 of file ConversionState.cs.

◆ From

Stream Waher.Content.ConversionState.From
get

Stream pointing to binary representation of content.

Definition at line 68 of file ConversionState.cs.

◆ FromContentType

string Waher.Content.ConversionState.FromContentType
get

Content type of the content to convert from.

Definition at line 63 of file ConversionState.cs.

◆ FromFileName

string Waher.Content.ConversionState.FromFileName
getset

If the content is coming from a file, this parameter contains the name of that file. Otherwise, the parameter is the empty string.

Definition at line 74 of file ConversionState.cs.

◆ HasError

bool Waher.Content.ConversionState.HasError
get

If an error should be returned.

Definition at line 126 of file ConversionState.cs.

◆ LocalResourceName

string Waher.Content.ConversionState.LocalResourceName
getset

Local resource name of file, if accessed from a web server.

Definition at line 79 of file ConversionState.cs.

◆ PossibleContentTypes

string [] Waher.Content.ConversionState.PossibleContentTypes
get

Possible content types the converter is allowed to convert to. Can be null if there are no alternatives.

Definition at line 116 of file ConversionState.cs.

◆ Progress

ICodecProgress Waher.Content.ConversionState.Progress
get

Optional interface for reporting progress during conversion.

Definition at line 105 of file ConversionState.cs.

◆ ResourceMap

IResourceMap Waher.Content.ConversionState.ResourceMap
get

Optional resource map.

Definition at line 110 of file ConversionState.cs.

◆ Session

Variables Waher.Content.ConversionState.Session
get

Session states.

Definition at line 100 of file ConversionState.cs.

◆ To

Stream Waher.Content.ConversionState.To
get

Stream pointing to where binary representation of content is to be sent.

Definition at line 95 of file ConversionState.cs.

◆ ToContentType

string Waher.Content.ConversionState.ToContentType
getset

Content type of the content to convert to. This value might be changed, in case the converter finds a better option. May get updated during the conversion process.

Definition at line 90 of file ConversionState.cs.

◆ URL

string Waher.Content.ConversionState.URL
get

URL of resource, if accessed from a web server.

Definition at line 84 of file ConversionState.cs.


The documentation for this class was generated from the following file: