aboutsummaryrefslogtreecommitdiff
path: root/src/support/filesystem_context.cc
AgeCommit message (Collapse)Author
2014-11-09Removed unnecessary `inline` declarationsAdrian Kummerlaender
* e.g. member functions defined in the class definition are implicitly marked `inline`
2014-10-11Changed FunctionBase FilesystemContext base to working directoryAdrian Kummerlaender
* this changes filesystem context resolution for external function execution to be relative to the working directory ** this was changed to enable module support in BuildXSLT *** ... which is in turn required as a foundation for extracting the detail transformations into a separate "StaticXSLT" application * added parameter-less FilesystemContext constructor which defaults to the working directory
2014-08-09Reduced FilesystemContext's determination to resolve into absolute pathsAdrian Kummerlaender
* FilesystemContext was returning absolute paths in nearly every situation ** even when a path relative to the current working directory might be easier on the eyes * new _soft_ base path resolution logic is implemented in a local "determineBasePath" method
2014-07-18Set SystemId for node based xalan::XSLTInputSource parametersAdrian Kummerlaender
* entities in transformations passed by DOM to FunctionGenerate or FunctionTransform require a valid system id as a FilesystemContext base to be resolved * added getBase member method to FilesystemContext
2014-06-17Added context awareness to XObjectValue casting logicAdrian Kummerlaender
* added support for defining boost::filesystem::path as a external function parameter ** boost::filesystem::path parameters are resolved against the appropriate FilesystemContext and IncludeEntityResolver instances * xalan::XSLTInputSource parameter source paths are also resolved * removed need for passing a reference FilesystemContext to "constructDocument" methods ** they now only accept the parameters of the external function implemented by them ** all path resolution logic is wrapped by the newly created XObjectValue class * converted XObjectValue namespace into class ** the "get" template method is now a template member method ** this was needed to enable value casting logic to access the appropriate FilesystemContext and IncludeEntityResolver instances * this commit marks the next step towards the goals defined in 741a70f
2014-06-09Added include path resolution to FilesystemContext constructorAdrian Kummerländer
* extracted system id handling into separate "resolve" method overload of "IncludeEntityResolver" class * paths to be resolved against the include path vector are enclosed by square brackets ** FilesystemContext for external functions was instantiated using the unmodified systemId provided by xalan::Locator ** this commit adds include path resolution to that step *** exceptions were thrown as the program tried to instantiate a FilesystemContext instance without resolving the square bracket syntax * changed FunctionTransform "target" attribute content to the target path filename instead of the full path
2014-05-24Prevented FilesystemContext from resolving absolute pathsAdrian Kummerländer
* there are situations where one may pass absolute paths to external functions which should not be resolved against the context path ** for example when reading files found by "read-directory" through its "full" value node * this could be checked by the external functions themself ** but as this check is required by all of them it is better implemented in the FilesystemContext
2014-05-23Changed iterate functor parameter to const referenceAdrian Kummerländer
* replaced ranged for loop with more appropriate std::for_each
2014-05-14Moved responsibility for argument conversion to FunctionBase descendantsAdrian Kummerländer
* external functions may expect arguments with a type different from boost::filesystem::path so they are only provided raw string values * moved xalan string conversion logic into separate compilation unit
2014-05-13Sorting FilesystemContext iteration resultsAdrian Kummerländer
* order of items in a directory was varying across platforms which hindered testability * they are now temporarily copied into a std::vector instance and then sorted using std::sort * updated "read_directory" test case reference file accordingly
2014-05-06Added basic external read file function test caseAdrian Kummerländer
* ... as a test of how well we are able to test DOM structures * required change of constructDocument visibility
2014-05-04Moved DOM document construction logic into local functionsAdrian Kummerländer
* this change makes the underlying similarity between all currently implemented external functions obvious * they more or less only differ in their document construction logic ** i.e. there is a possibility for a second layer of abstraction between the classes derived from xalan::Function and the actual functionality * added boost::filesystem::path taking overload of the _iterate_ member method to FilesystemGuard ** this overload functions as the _master_ overload that is called by all other overloads which merely perform type conversion and path resolution ** this overload doesn't perform path resolution
2014-05-04Changed FilesystemContext constructor to accept xalan::Locator*Adrian Kummerländer
* all instantiations of a FilesystemContext are currently based on information provided by a xalan::Locator instance provided to the external function execute member method * this change hides the stylesheet path extraction from the actual function implementation
2014-04-30Moved file reading functionality into local functionsAdrian Kummerländer
* it was moved into functions local to the respective compilation unit to improve readability ** splits DOM tree construction logic from the actual purpose of the external function
2014-04-28Adapted read-directory tree construction to match the other functionsAdrian Kummerländer
* throwing std::out_of_range exception from DomDocumentCache::get instead of returning nullptr in case of a problem * moved xalanToString method back into FilesystemContext compilation unit as is only needed there
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-26Implemented global DOM document cacheAdrian Kummerländer
* the plan to return XML-nodes from each external function requires a better way to manage the lifetime of many xerces DOM document instances and their support class instances ** this is why DomDocumentCache and DomDocumentCache::item were implemented ** based on std::map so we can easily access the result of old function calls * changed external read-directory function to return the children of the document node instead of the document node itself ** removes unnecessary cruft in function calls ** will make returning status codes alongside the function result more pleasing to the eye * updated test transformation to reflect new features
2014-04-24Expanded FunctionReadDirectory class to return files and directoriesAdrian Kummerländer
* they are marked appropriately by a _type_ attribute
2014-04-21Implemented basic external directory traversal functionAdrian Kummerländer
* _read-directory_ lists all files in a given directory ** currently text-only output, xml planned * improved FilesystemContext path resolution (relative path is fully resolved by boost::filesystem)
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