diff options
author | Adrian Kummerlaender | 2014-07-12 09:51:09 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2014-07-12 09:51:09 +0200 |
commit | 141725d681dd69f77e993c3d59d613d1ad7014f9 (patch) | |
tree | 018fc2ebea779dd4b9a01543f0512c3e24e0fce7 /src/function/transform.cc | |
parent | 2192896e08572419edf99c81c3a524f07e877a10 (diff) | |
download | InputXSLT-141725d681dd69f77e993c3d59d613d1ad7014f9.tar InputXSLT-141725d681dd69f77e993c3d59d613d1ad7014f9.tar.gz InputXSLT-141725d681dd69f77e993c3d59d613d1ad7014f9.tar.bz2 InputXSLT-141725d681dd69f77e993c3d59d613d1ad7014f9.tar.lz InputXSLT-141725d681dd69f77e993c3d59d613d1ad7014f9.tar.xz InputXSLT-141725d681dd69f77e993c3d59d613d1ad7014f9.tar.zst InputXSLT-141725d681dd69f77e993c3d59d613d1ad7014f9.zip |
Marked constructDocument member methods as const
* they don't modifiy the class state so there is no reason for them not being marked as const
** all calling methods are also const
** this enables us to remove the const_cast in FunctionBase
* modified external function implementations accordingly
* inlined handleError method in FunctionTransform as it is not needed in multiple places anymore
Diffstat (limited to 'src/function/transform.cc')
-rw-r--r-- | src/function/transform.cc | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/function/transform.cc b/src/function/transform.cc index 6cda7a7..7eab3fd 100644 --- a/src/function/transform.cc +++ b/src/function/transform.cc @@ -7,29 +7,12 @@ #include "support/dom/result_node_facade.h" #include "support/error/error_capacitor.h" -namespace { - -using InputXSLT::ErrorCapacitor; - -inline void handleErrors( - InputXSLT::ResultNodeFacade& result, - const ErrorCapacitor::error_cache& errors -) { - result.setAttribute("result", "error"); - - for ( auto&& error : errors ) { - result.setValueNode("error", error); - } -} - -} - namespace InputXSLT { DomDocumentCache::document_ptr FunctionTransform::constructDocument( xalan::XSLTInputSource inputSource, xalan::XSLTInputSource transformationSource -) { +) const { DomDocumentCache::document_ptr domDocument( DomDocumentCache::createDocument("content") ); @@ -52,7 +35,11 @@ DomDocumentCache::document_ptr FunctionTransform::constructDocument( result.setAttribute("result", "success"); } catch (const ErrorCapacitor::exception& exception) { - handleErrors(result, *exception); + result.setAttribute("result", "error"); + + for ( auto&& error : *exception ) { + result.setValueNode("error", error); + } } WarningCapacitor::warning_cache_ptr warnings( |