XQuilla/include/xqilla/functions/FunctionReplace.hpp

49 lines
1.3 KiB
C++
Raw Normal View History

2020-02-17 22:05:20 +01:00
/*
* Copyright (c) 2001-2006
* DecisionSoft Limited. All rights reserved.
* Copyright (c) 2004-2006
* Progress Software Corporation. All rights reserved.
* Copyright (c) 2004-2006
* Oracle. All rights reserved.
*
* See the file LICENSE for redistribution information.
*
2020-02-17 22:11:31 +01:00
* $Id: FunctionReplace.hpp,v 1.9 2007/02/07 12:13:05 jpcs Exp $
2020-02-17 22:05:20 +01:00
*/
#ifndef _FUNCTIONREPLACE_HPP
#define _FUNCTIONREPLACE_HPP
#include <xqilla/ast/ConstantFoldingFunction.hpp>
/**
* Returns the string that is obtained by replacing all non-overlapping substrings of $input
* that match the given $pattern with an occurrence of the $replacement string.
*
* xf:replace(string? $input, string $pattern, string $replacement) => string?
* xf:replace(string? $input, string $pattern, string $replacement,
* string $flags) => string?
*/
class XQILLA_API FunctionReplace : public ConstantFoldingFunction
{
public:
static const XMLCh name[];
static const unsigned int minArgs;
static const unsigned int maxArgs;
/**
* Constructor.
*/
FunctionReplace(const VectorOfASTNodes &args, XPath2MemoryManager* memMgr);
/**
* Returns $input with non-overlapping matches to $pattern
* replaced by $replacement
*/
2020-02-17 22:11:31 +01:00
Sequence createSequence(DynamicContext* context, int flags=0) const;
2020-02-17 22:05:20 +01:00
};
#endif // _FUNCTIONREPLACE_HPP