![Copy image Copy image](icons/copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
Explicit Operator
SwiPlCs interface ► SbsSW.SwiPlCs ► PlTerm ► ExplicitNarrowingExplicitExplicitExplicit(PlTerm to String)
Converts the Prolog argument into a string which implies Prolog atoms and strings
are converted to the represented text or throw a PlTypeException.
![](collapse_all.gif)
C# | Visual Basic | Visual C++ | F# |
public static explicit operator string ( PlTerm term )
Public Shared Narrowing Operator CType ( term As PlTerm ) As String
static explicit operator String^ ( PlTerm term )
F# does not support the declaration of new casting operators.
![](collapse_all.gif)
- term (PlTerm)
- A PlTerm that can be converted to a string
![](collapse_all.gif)
String
A C# string
A C# string
![](collapse_all.gif)
Converts the Prolog argument using PL_get_chars() using the flags CVT_ALL|CVT_WRITE|BUF_RING, which implies Prolog atoms and strings are converted to the represented text or throw a PlTypeException.
If the above call return 0 PL_get_chars is called a second time with the flags CVT_ALL|CVT_WRITE|BUF_RING|REP_UTF8.
All other data is handed to write/1.
![](collapse_all.gif)
Exception | Condition |
---|---|
PlTypeException | Throws a PlTypeException exception |
PreconditionException | Is thrown if the operator is used on an uninitialized PlTerm |
Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60605.0 (1.1.60605.0)