Skip to content

Commit

Permalink
Documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 20, 2020
1 parent c13c416 commit f49067c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/function_help/json/from_base64
Expand Up @@ -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'"}
Expand Down
4 changes: 2 additions & 2 deletions resources/function_help/json/to_base64
Expand Up @@ -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=='"}
]
}
4 changes: 2 additions & 2 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -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() ) );
Expand Down Expand Up @@ -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" ) )
Expand Down

0 comments on commit f49067c

Please sign in to comment.