Skip to content
Permalink
Browse files

Documentation improvements

  • Loading branch information
nyalldawson committed May 19, 2020
1 parent c13c416 commit f49067cf274b7a269acc5c0b6fe330b43de579a9
@@ -2,7 +2,7 @@
{
"name": "from_base64",
"type": "function",
"description": "Decodes a provided string in Base64 into readable string.",
"description": "Decodes a string in the Base64 encoding into a binary value.",
"arguments": [
{"arg":"string", "description": "the string to decode"}],
"examples": [ { "expression":"from_base64('UUdJUw==')", "returns":"'QGIS'"}
@@ -2,9 +2,9 @@
{
"name": "to_base64",
"type": "function",
"description": "Encodes a provided string using Base64.",
"description": "Encodes a binary value into a string, using the Base64 encoding.",
"arguments": [
{"arg":"string", "description": "the string to encode"}],
{"arg":"value", "description": "the binary value to encode"}],
"examples": [ { "expression":"to_base64('QGIS')", "returns":"'UUdJUw=='"}
]
}
@@ -5624,7 +5624,7 @@ static QVariant fcnHashSha256( const QVariantList &values, const QgsExpressionCo
return fcnHash( QgsExpressionUtils::getStringValue( values.at( 0 ), parent ), QCryptographicHash::Sha256 );
}

static QVariant fcnToBase64( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
static QVariant fcnToBase64( const QVariantList &values, const QgsExpressionContext *, QgsExpression *, const QgsExpressionNodeFunction * )
{
const QByteArray input = values.at( 0 ).toByteArray();
return QVariant( QString( input.toBase64() ) );
@@ -5968,7 +5968,7 @@ const QList<QgsExpressionFunction *> &QgsExpression::Functions()
fcnHashSha256, QStringLiteral( "Conversions" ) )

//base64
<< new QgsStaticExpressionFunction( QStringLiteral( "to_base64" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "string" ) ),
<< new QgsStaticExpressionFunction( QStringLiteral( "to_base64" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "value" ) ),
fcnToBase64, QStringLiteral( "Conversions" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "from_base64" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "string" ) ),
fcnFromBase64, QStringLiteral( "Conversions" ) )

0 comments on commit f49067c

Please sign in to comment.
You can’t perform that action at this time.