aboutsummaryrefslogtreecommitdiff
path: root/src/function/read_file.h
AgeCommit message (Collapse)Author
2014-05-02Changed external functions to enable global installationAdrian Kummerländer
* up until now all external functions were locally installed to a specific XalanTransformer instance contained within a TransformationGuard instance ** this had to change as I planned to add a "execute-transformation" function based on TransformationGuard which would have led to recursive self-instantiation ** global external functions have to be thread-safe * as global external function can not be provided with a reference to a transformation-specific FilesystemFacade instance, the working path is now determined using xalan::Locator ** currently using pointer arithmetics on XMLCh* to remove the "file://" prefix of the URI returned by locator->getSystemId(), may be unsafe * added compilation unit for PlattformGuard as it now contains function installation in addition to plattform lifetime management
2014-04-26Converted external read-file function output into a node setAdrian Kummerländer
* A call to _read-file_ now returns a _content_ and _status_ node ** this enables XSL transformations to easily react to io related errors * fixed bug in path resolution ** boost::filesystem _canonical_ method is throwing and exception when the given path does not exist, this pulled down the whole stack ** replaced call to _canonical_ with call to _absolute_ which does not have this requirement
2014-04-25Improved argument resolution and error handlingAdrian Kummerländer
* execute member method internal argument count checks are not needed when using between one and two arguments ** xalan automatically generates the appropriate message containing the getError message when only offered fixed argument execute member overloads * improved FunctionReadDirectory attribute element generation * added additional validations to FunctionReadFile and FunctionReadXMLFile * I plan to return errors inside a DOM tree alongside the function return values in the future
2014-04-21Extracted filesystem path resolution into InputXSLT::FilesystemContextAdrian Kummerländer
* this class provides methods for resolving paths relative to the contained base path * other filesystem interaction methods will also be implemented in this class ** for instance directory traversal
2014-04-20Switched filesystem interaction code to boost::filesystemAdrian Kummerländer
* while plain read access on files is doesn't require boost::filesystem it will greatly simplify the implementation of external directory traversal functions * it also improves the portability of relative path construction
2014-04-20Implemented support for modifying external function base pathAdrian Kummerländer
* one expects a read-file function to work relative to the directory the transformation is located and not to the executable's location ** from the perspective of the user the transformation is the application, not the actual executable * removed PlattformGuard struct from TransformerGuard (now TransformerFacade) * TransformerFacade is instatiated with the appropriate relative working path ** i.e. it will have to be instantiated for every directory containing one or more transformations
2014-04-19Further code style fixesAdrian Kummerländer
* .. in the face of the planned development of usable external functions using the current proof-of-concept coding * replaced usage of std::shared_ptr in FunctionReadXmlFile class with explicit implementation of default and copy constructor * separated implementation and interfaces