00001 /* 00002 * Copyright 2006-2008 The FLWOR Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 #ifndef XQP_STATIC_CONTEXT_API_H 00017 #define XQP_STATIC_CONTEXT_API_H 00018 00019 #include <zorba/config.h> 00020 #include <zorba/api_shared_types.h> 00021 #include <zorba/zorba_string.h> 00022 #include <zorba/typeident.h> 00023 #include <zorba/static_context_consts.h> 00024 #include <zorba/options.h> // for compiler hints class 00025 #include <vector> 00026 #include <zorba/function.h> 00027 #include <zorba/annotation.h> 00028 #include <zorba/smart_ptr.h> 00029 #ifndef ZORBA_NO_FULL_TEXT 00030 #include <zorba/thesaurus.h> 00031 #endif /* ZORBA_NO_FULL_TEXT */ 00032 00033 namespace zorba { 00034 00035 /** \brief Instances of the class StaticContext contain the information that is available 00036 * at the time the query is compiled. 00037 * 00038 * This class contains the information that is defined in the %XQuery specification 00039 * (see http://www.w3.org/TR/xquery/#static_context). 00040 * 00041 * A StaticContext can be created by calling Zorba::createStaticContext and then be passed 00042 * to the Zorba::compileQuery or XQuery::compile functions. 00043 * If no static context has been passed to any of these functions, a default static context 00044 * is used. It can be accessed by calling XQuery::getStaticContext on a compiled XQuery object. 00045 * 00046 * Note: This class is reference counted. When writing multi-threaded clients, 00047 * it is the responibility of the client code to synchronize assignments to the 00048 * SmartPtr holding this object. 00049 */ 00050 class ZORBA_DLL_PUBLIC StaticContext : public SmartObject 00051 { 00052 public: 00053 /** \brief Destructor 00054 */ 00055 virtual ~StaticContext() {} 00056 00057 /** \brief Loads the declarations and definitions of a given XQuery prolog into 00058 * this static context. 00059 * 00060 * This function compiles the prolog passed as first parameter and loads 00061 * all declarations and definitions into this static context. 00062 * 00063 * The static context extended by this prolog can then be used for creating 00064 * a compiling a new query. 00065 * 00066 * A StaticException is raised if the prolog could not be compiled or 00067 * if the prolog does not contain valid declarations (e.g. duplicate declarations). 00068 */ 00069 virtual void 00070 loadProlog(const String&, const Zorba_CompilerHints_t &hints) = 0; 00071 00072 /** \brief Create a child static context, i.e. a context with the same information, 00073 * of the given static context. 00074 * 00075 * A child static context carries the same context as it's parent but 00076 * can override any information. 00077 */ 00078 virtual StaticContext_t 00079 createChildContext() const = 0; 00080 00081 /** \brief Add a pair (prefix, URI) to the statically known namespaces that 00082 * are available during query compilation. 00083 * 00084 * See http://www.w3.org/TR/xquery/#static_context. 00085 * 00086 * @param aPrefix the prefix String. 00087 * @param aURI the URI String. 00088 * @return true if the pair was added to the set of statically known namespaces, 00089 * false otherwise. 00090 * @throw ZorbaException if an error occures. 00091 */ 00092 virtual bool 00093 addNamespace( const String& aPrefix, const String& aURI ) = 0; 00094 00095 /** \brief Get the namespace URI for a given prefix. 00096 * 00097 * @param aPrefix the prefix for which to retrieve the namespace URI. 00098 * @return String the URI for the given prefix or an empty String if no URI 00099 * could be found for the given prefix and an DiagnosticHandler has been 00100 * registered. 00101 * @throw ZorbaException if an error occured (e.g. no URI could be found for the given prefix). 00102 * 00103 * @deprecated This function is deprecated. Use getNamespaceBindings instead. 00104 */ 00105 virtual String 00106 getNamespaceURIByPrefix( const String& aPrefix ) const = 0; 00107 00108 /** 00109 * \brief Get the list of all namespace bindings (prefix, uri) 00110 * declared in this and its parent static contexts. 00111 * 00112 * @param aBindings the bindings are added to this list 00113 */ 00114 virtual void 00115 getNamespaceBindings( NsBindings& aBindings ) const = 0; 00116 00117 /** \brief Set the default element and type namespace 00118 * (see http://www.w3.org/TR/xquery/#static_context) 00119 * 00120 * @param aURI of the default element and type namespace URI. 00121 * @return true if the default element and type namespace URI has been set, false otherwise 00122 * if an DiagnosticHandler has been registered. 00123 * @throw ZorbaException if an error occured. 00124 */ 00125 virtual bool 00126 setDefaultElementAndTypeNamespace( const String& aURI ) = 0; 00127 00128 /** \brief Get the default element and type namespace URI. 00129 * 00130 * @return String the URI for the default element and type namespace. 00131 * @throw ZorbaException if an error occured. 00132 */ 00133 virtual String 00134 getDefaultElementAndTypeNamespace( ) const = 0; 00135 00136 /** \brief Set the default functionnamespace 00137 * (see http://www.w3.org/TR/xquery/#static_context) 00138 * 00139 * @param aURI of the default function namespace. 00140 * @return true if the default function namespace URI has been set, false otherwise 00141 * if an DiagnosticHandler has been registered. 00142 * @throw ZorbaException if an error occured. 00143 */ 00144 virtual bool 00145 setDefaultFunctionNamespace( const String& aURI ) = 0; 00146 00147 /** \brief Get the default function namespace. 00148 * 00149 * @return String the URI of the default function namespace. 00150 * DiagnosticHandler has been registered. 00151 * @throw ZorbaException if an error occured. 00152 */ 00153 virtual String 00154 getDefaultFunctionNamespace( ) const = 0; 00155 00156 /** \brief Adds a collation URI. 00157 * 00158 * The URI specifies the locale and collation strength of the collation that is added. 00159 * A valid collation URI must begin with %http://www.zorba-xquery.com/collations/. 00160 * This prefix is followed by a collation strength (i.e. PRIMARY, SECONDARY, TERTIARY, 00161 * QUATTERNARY, or IDENTICAL) followed by a '/'. 00162 * After the strength a lower-case two- or three-letter ISO-639 language code must follow. 00163 * The URI may end with an upper-case two-letter ISO-3166. 00164 * For example, %http://www.zorba-xquery.com/collations/PRIMARY/en/US 00165 * specifies an english language with US begin the country.. 00166 * 00167 * Internally, ICU is used for comparing strings. For detailed description see 00168 * http://www.icu-project.org/apiref/icu4c/classCollator.html 00169 * and http://www.icu-project.org/apiref/icu4c/classLocale.html 00170 * 00171 * @param aURI the URI of the collation. 00172 * @throw ZorbaException if an error occured (e.g. the URI was not a valid 00173 * collation URI). 00174 */ 00175 virtual void 00176 addCollation( const String& aURI ) = 0; 00177 00178 /** \brief Set the URI of the default collation. 00179 * (see http://www.w3.org/TR/xquery/#static_context) 00180 * 00181 * @param aURI URI of the default collation. 00182 * @throw ZorbaException if an error occured (e.g., the URI does not 00183 * identify a collation among the statically known collations. 00184 */ 00185 virtual void 00186 setDefaultCollation( const String& aURI ) = 0; 00187 00188 /** \brief Get the URI of the default collation 00189 * 00190 * @return String the URI of the default collation. 00191 */ 00192 virtual String 00193 getDefaultCollation() const = 0; 00194 00195 /** \brief Set the XQuery processing mode (version 1.0 or 3.0). 00196 * 00197 * 00198 * @param aMode the XQuery version. 00199 * @return true if the version was set, false otherwise. 00200 */ 00201 virtual bool 00202 setXQueryVersion( xquery_version_t aMode ) = 0; 00203 00204 /** \brief Get the XQuery processing mode (version 1.0 or 3.0). 00205 * 00206 * 00207 * @return xquery_version_t the XQuery version processing mode. 00208 */ 00209 virtual xquery_version_t 00210 getXQueryVersion( ) const = 0; 00211 00212 /** \brief Set the XPath 1.0 compatibility mode. 00213 * (see http://www.w3.org/TR/xquery/#static_context) 00214 * 00215 * @param aMode the XPath 1.0 compatibility mode. 00216 * @return true if the mode was set, false otherwise. 00217 */ 00218 virtual bool 00219 setXPath1_0CompatibMode( xpath1_0compatib_mode_t aMode ) = 0; 00220 00221 /** \brief Get the XPath 1.0 compatibility mode. 00222 * (see http://www.w3.org/TR/xquery/#static_context) 00223 * 00224 * @return xpath1_0compatib_mode_t the XPath 1.0 compatibility mode. 00225 */ 00226 virtual xpath1_0compatib_mode_t 00227 getXPath1_0CompatibMode( ) const = 0; 00228 00229 /** \brief Set the construction mode. 00230 * (see http://www.w3.org/TR/xquery/#static_context) 00231 * 00232 * @param aMode the construction mode. 00233 * @return true if the mode was set, false otherwise. 00234 */ 00235 virtual bool 00236 setConstructionMode( construction_mode_t aMode ) = 0; 00237 00238 /** \brief Get the construction mode. 00239 * (see http://www.w3.org/TR/xquery/#static_context) 00240 * 00241 * @return construction_mode_t the construction mode. 00242 */ 00243 virtual construction_mode_t 00244 getConstructionMode( ) const = 0; 00245 00246 /** \brief Set the ordering mode. 00247 * (see http://www.w3.org/TR/xquery/#static_context) 00248 * 00249 * @param aMode the ordering mode. 00250 * @return true if the mode was set, false otherwise. 00251 */ 00252 virtual bool 00253 setOrderingMode( ordering_mode_t aMode ) = 0; 00254 00255 /** \brief Get the ordering mode. 00256 * (see http://www.w3.org/TR/xquery/#static_context) 00257 * 00258 * @return ordering_mode_t the ordering mode. 00259 */ 00260 virtual ordering_mode_t 00261 getOrderingMode( ) const = 0; 00262 00263 /** \brief Set the default order for the empty sequence. 00264 * (see http://www.w3.org/TR/xquery/#static_context) 00265 * 00266 * @param aMode the default order for the empty sequence. 00267 * @return true if the mode was set, false otherwise. 00268 */ 00269 virtual bool 00270 setDefaultOrderForEmptySequences( order_empty_mode_t aMode ) = 0; 00271 00272 /** \brief Get the default order for the empty sequence. 00273 * (see http://www.w3.org/TR/xquery/#static_context) 00274 * 00275 * @return order_empty_mode_t the ordering mode. 00276 */ 00277 virtual order_empty_mode_t 00278 getDefaultOrderForEmptySequences( ) const = 0; 00279 00280 /** \brief Set the boundary space policy. 00281 * (see http://www.w3.org/TR/xquery/#static_context) 00282 * 00283 * @param aMode the boundary space policy. 00284 * @return true if the mode was set, false otherwise. 00285 */ 00286 virtual bool 00287 setBoundarySpacePolicy( boundary_space_mode_t aMode) = 0; 00288 00289 /** \brief Get the boundary space policy. 00290 * (see http://www.w3.org/TR/xquery/#static_context) 00291 * 00292 * @return boundary_space_mode_t the boundary space policy. 00293 */ 00294 virtual boundary_space_mode_t 00295 getBoundarySpacePolicy( ) const = 0; 00296 00297 /** \brief Set the copy namespace mode. 00298 * (see http://www.w3.org/TR/xquery/#static_context) 00299 * 00300 * @param aPreserve the preserve mode. 00301 * @param aInherit the inherit mode. 00302 * @return true if the mode was set, false otherwise. 00303 */ 00304 virtual bool 00305 setCopyNamespacesMode( preserve_mode_t aPreserve, 00306 inherit_mode_t aInherit ) = 0; 00307 00308 /** \brief Get the copy namespace mode. 00309 * (see http://www.w3.org/TR/xquery/#static_context) 00310 * 00311 * @return aPreserve the preserve mode. 00312 * @return aInherit the inherit mode. 00313 */ 00314 virtual void 00315 getCopyNamespacesMode( preserve_mode_t& aPreserve, 00316 inherit_mode_t& aInherit ) const = 0; 00317 00318 /** \brief Set the base URI. 00319 * (see http://www.w3.org/TR/xquery/#static_context) 00320 * 00321 * @param aBaseURI the base URI as String. 00322 * @return true if the base URI has been set, false otherwise. 00323 */ 00324 virtual bool 00325 setBaseURI( const String& aBaseURI ) = 0; 00326 00327 /** \brief Get the base URI. 00328 * 00329 * @return String the base URI. 00330 */ 00331 virtual String 00332 getBaseURI( ) const = 0; 00333 00334 /** \brief Get the revalidation mode. 00335 * 00336 * @return the revalidation mode. 00337 */ 00338 virtual validation_mode_t 00339 getRevalidationMode() const = 0; 00340 00341 /** \brief Set the revalidation mode. 00342 * 00343 * @param aMode the revalidation mode. 00344 */ 00345 virtual void 00346 setRevalidationMode(validation_mode_t aMode) = 0; 00347 00348 /** \brief Register a module providing access to external functions. 00349 * 00350 * Register a module that provides access to external functions. 00351 * The caller keeps the ownership of the Module and the StatelessExternalFunction 00352 * objects passed to this function. 00353 * 00354 * @param aModule the module object 00355 * @return true if the module has been set, false otherwise. 00356 */ 00357 virtual bool 00358 registerModule(ExternalModule* aModule) = 0; 00359 00360 /** 00361 * \brief Register a URI Mapper which will transform a given URI 00362 * into several alternate potential URIs. 00363 * 00364 * QQQ doc 00365 */ 00366 virtual void 00367 registerURIMapper(URIMapper* aMapper) = 0; 00368 00369 /** 00370 * \brief Register a URL Resolver which will transform a given 00371 * URL into a Resource. 00372 * 00373 * QQQ doc 00374 */ 00375 virtual void 00376 registerURLResolver(URLResolver* aResolver) = 0; 00377 00378 /** \brief Set the type of a statically known document 00379 */ 00380 virtual void 00381 setDocumentType(const String& aDocUri, TypeIdentifier_t type) = 0; 00382 00383 /** \brief Get the type of a statically known document 00384 */ 00385 virtual TypeIdentifier_t 00386 getDocumentType(const String& aDocUri) const = 0; 00387 00388 /** \brief Set the type of a statically known collection 00389 */ 00390 virtual void 00391 setCollectionType(const String& aCollectionUri, TypeIdentifier_t type) = 0; 00392 00393 /** \brief Get the type of a statically known collection 00394 */ 00395 virtual TypeIdentifier_t 00396 getCollectionType(const String& aCollectionUri) const = 0; 00397 00398 /** \brief Check if a function with the given name and arity are registered in the context. 00399 */ 00400 virtual bool 00401 containsFunction(const String& aFnNameUri, const String& aFnNameLocal, int arity) const = 0; 00402 00403 virtual void 00404 findFunctions(const Item& aQName, std::vector<Function_t>& aFunctions) const = 0; 00405 00406 virtual void 00407 disableFunction(const Function_t& aFunction) = 0; 00408 00409 virtual void 00410 disableFunction(const Item& aQName, int arity) = 0; 00411 00412 virtual void 00413 getFunctionAnnotations(const Item& aQName, int arity, std::vector<Annotation_t>& aAnnotations) const = 0; 00414 00415 /** \brief Get all functions declared in the given static context 00416 * 00417 * @return aFunctions all of the said functions 00418 */ 00419 virtual void 00420 getFunctions(std::vector<Function_t>& aFunctions) const = 0; 00421 00422 /** \brief Get all functions with a specified namespace and airty\ 00423 * declared in the given static context. 00424 * 00425 * @param aFnNameUri the namespace for the functions to return 00426 * @param arity the arity for the functions to return 00427 * @param aFunctions all of the said functions 00428 */ 00429 virtual void 00430 getFunctions( 00431 const String& aFnNameUri, 00432 uint32_t arity, 00433 std::vector<Function_t>& aFunctions) const = 0; 00434 00435 /** \brief Set the type of the context item. 00436 */ 00437 virtual void 00438 setContextItemStaticType(TypeIdentifier_t type) = 0; 00439 00440 /** \brief Fetch the type of the context item. 00441 */ 00442 virtual TypeIdentifier_t 00443 getContextItemStaticType() const = 0; 00444 00445 /** \brief Set the output stream that is used by the fn:trace function 00446 * 00447 * Sets the output stream that is used by the fn:trace function to the given output stream. 00448 * The default stream is std::cerr. 00449 * 00450 */ 00451 virtual void 00452 setTraceStream(std::ostream&) = 0; 00453 00454 /** \brief Resets the output stream that is used by the fn:trace function to std::cerr 00455 */ 00456 virtual void 00457 resetTraceStream() = 0; 00458 00459 /** \brief Get an option that was declared using the declare option syntax 00460 * 00461 * @param aQName The QName of the option to get. 00462 * @param aOptionValue The value of the option if found. 00463 * @return true if the option was found, false otherwise. 00464 */ 00465 virtual bool 00466 getOption( const Item& aQName, String& aOptionValue) const = 0; 00467 00468 /** \brief Declare an option (same as using declare option in XQuery) 00469 * 00470 * @param aQName The QName of the option to declare. 00471 * @param aOptionValue The value of the option to declare. 00472 */ 00473 virtual void 00474 declareOption( const Item& aQName, const String& aOptionValue) = 0; 00475 00476 /** 00477 * @brief Set the URI and library lookup paths (lists of filesystem 00478 * directories) for this static context. Note that calling this method 00479 * will override any values previously passed to StaticContext::setURIPath() 00480 * and StaticContext::setLibPath(). 00481 * @deprecated Use StaticContext::setURIPath() and StaticContext::setLibPath(). 00482 * 00483 * Convenience method which adds the listed directories to both the 00484 * URI path and Library path for this static context. 00485 */ 00486 virtual void 00487 setModulePaths( const std::vector<String>& aModulePaths ) = 0; 00488 00489 /** 00490 * @brief Return the union of the URI and library lookup paths (lists of 00491 * filesystem directories) for this static context. @deprecated Use 00492 * StaticContext::getURIPath() and StaticContext::getLibPath(). 00493 * @deprecated Use StaticContext::getURIPath() and StaticContext::getLibPath(). 00494 * 00495 * Returns any values set by StaticContext::setLibPath() and/or StaticContext::setURIPath() 00496 * on this static context. 00497 */ 00498 virtual void 00499 getModulePaths( std::vector<String>& aModulePaths ) const = 0; 00500 00501 /** 00502 * @brief Return the union of the URI and library lookup paths (lists of 00503 * filesystem directories) for this static context and all its parents. 00504 * @deprecated Use StaticContext::getFullURIPath() and StaticContext::getFullLibPath(). 00505 */ 00506 virtual void 00507 getFullModulePaths( std::vector<String>& aFullModulePaths ) const = 0; 00508 00509 /** \brief Resolves the given URI against the value of the base-uri 00510 * property from the static context. 00511 * 00512 * @param aRelativeUri The relative URI to be resolved. 00513 */ 00514 virtual String 00515 resolve(const String& aRelativeUri) const = 0; 00516 00517 /** \brief Resolves the given relative URI against the absolute base URI. 00518 * 00519 * @param aRelativeUri The relative URI to be resolved. 00520 * @param aBaseUri The absolute URI against which the resolving is performed. 00521 */ 00522 virtual String 00523 resolve(const String& aRelativeUri, const String& aBaseUri) const = 0; 00524 00525 /** \brief Validates this Item. 00526 * Note: works only on document and element nodes, otherwise returns false. 00527 * 00528 * @param rootElement the root of the tree beeing validated 00529 * @param validatedResult the result of the validation 00530 * @param validationMode Validation mode: default value is validate_strict 00531 * @return true if validation is correct, false if validation is disabled, throws errors if validation fails 00532 * @throw ZorbaException if any validation error occured 00533 */ 00534 virtual bool 00535 validate( 00536 const Item& rootElement, 00537 Item& validatedResult, 00538 validation_mode_t validationMode = validate_strict) const = 0; 00539 00540 /** \brief Validates this Item while loading the schema for targetNamespace 00541 * Note: works only on document or element nodes, otherwise returns false. 00542 * 00543 * @param rootElement the root of the tree beeing validated 00544 * @param validatedResult the result of the validation 00545 * @param targetNamespace the expected namespace of root of the tree beeing validated ??? 00546 * @param validationMode Validation mode: default value is validate_strict 00547 * @return true if validation is correct, false if validation is disabled, throws errors if validation fails 00548 * @throw ZorbaException if any validation error occured 00549 */ 00550 virtual bool 00551 validate( 00552 const Item& rootElement, 00553 Item& validatedResult, 00554 const String& targetNamespace, 00555 validation_mode_t validationMode = validate_strict) const = 0; 00556 00557 /** \brief Validates stringValue as XML simple content, i.e. the text value of attributes or 00558 * text only element content. 00559 * 00560 * @param stringValue the value to be validated 00561 * @param typeQName 00562 * @param resultList the result of the validation, a vector of atomic Items 00563 * @return true if validation is correct, false if validation is disabled, throws errors if validation fails 00564 * @throw ZorbaException if any validation error occured 00565 */ 00566 virtual bool 00567 validateSimpleContent( 00568 const String& stringValue, 00569 const Item& typeQName, 00570 std::vector<Item>& resultList) const= 0; 00571 00572 /** \brief Invokes the XQuery function with the given name and 00573 * the given parameters. 00574 * 00575 * Note that the function to be invoked needs to be declared in this static 00576 * context. In order to declare a function in the static context, the 00577 * loadProlog method of this class can be used. 00578 * 00579 * Also note that if the function to be invoked is an updating function, 00580 * its resulting pending update list is implicitly applied by this function. 00581 * 00582 * @param aQName the name of the function to be invoked 00583 * @param aArgs a vector of ItemSequences. One entry in the vector 00584 * corresponds to one argument that is passed to the function. 00585 * 00586 * @return The result of the function that is invoked. If the function 00587 * to be invoked is an updating function, the resulting item sequence 00588 * is empty. 00589 */ 00590 virtual ItemSequence_t 00591 invoke(const Item& aQName, const std::vector<ItemSequence_t>& aArgs) const = 0; 00592 00593 /** \brief Returns a CollectionManager responsible for all collections 00594 * which are statically declared in this static context. 00595 * 00596 * The collection manager provides a set of functions for managing 00597 * collections and their contents. 00598 * 00599 * @return The collection manager responsible for managing 00600 * collections of this context. 00601 * 00602 */ 00603 virtual StaticCollectionManager* 00604 getStaticCollectionManager() const = 0; 00605 00606 /** 00607 * @brief sets the audit event that will be populated during execution 00608 * 00609 * @param anEvent the audit event 00610 */ 00611 virtual void 00612 setAuditEvent(audit::Event* anEvent) = 0; 00613 00614 /** 00615 * @brief gets the audit event that is populated during execution 00616 * 00617 * @return the audit event 00618 */ 00619 virtual audit::Event* 00620 getAuditEvent() const = 0; 00621 00622 00623 /** \brief Returns the QName of all external variables within the 00624 * static context 00625 * 00626 * @param aVarsIter iterator to store the results. 00627 * @throw ZorbaException if an error occured. 00628 */ 00629 virtual void 00630 getExternalVariables(Iterator_t& aVarsIter) const = 0; 00631 00632 /** 00633 * @brief Set the URI lookup path (list of filesystem directories) for this 00634 * static context. 00635 * 00636 * Queries which resolve URIs (for instance, importing modules or schemas) 00637 * will look in these directories. 00638 */ 00639 virtual void 00640 setURIPath(const std::vector<String>& aURIPath) = 0; 00641 00642 /** 00643 * @brief Return the URI lookup path (list of filesystem directories) for 00644 * this static context. 00645 * 00646 * Returns any values set by StaticContext::setURIPath() on this static context. 00647 * To return the full URI lookup path for this static context and 00648 * all its parents (usually most useful), call StaticContext::getFullURIPath(). 00649 */ 00650 virtual void 00651 getURIPath(std::vector<String>& aURIPath) const = 0; 00652 00653 /** 00654 * @brief Return the URI lookup path (list of filesystem directories) for 00655 * this static context and all its parents. 00656 */ 00657 virtual void 00658 getFullURIPath(std::vector<String>& aURIPath) const = 0; 00659 00660 /** 00661 * @brief Set the library lookup path (list of filesystem directories) for 00662 * this static context. 00663 * 00664 * Queries which import modules that have external function 00665 * implementations will look for the implementation of those functions 00666 * (shared libraries) in these directories. 00667 */ 00668 virtual void 00669 setLibPath(const std::vector<String>& aLibPath) = 0; 00670 00671 /** 00672 * @brief Return the URI lookup path (list of filesystem directories) for 00673 * this static context. 00674 * 00675 * Returns any values set by StaticContext::setLibPath() on this static context. 00676 * To return the full library lookup path for this static context and 00677 * all its parents (usually most useful), call StaticContext::getFullLibPath(). 00678 */ 00679 virtual void 00680 getLibPath(std::vector<String>& aLibPath) const = 0; 00681 00682 /** 00683 * @brief Return the URI lookup path (list of filesystem directories) for 00684 * this static context and all its parents. 00685 */ 00686 virtual void 00687 getFullLibPath(std::vector<String>& aLibPath) const = 0; 00688 }; 00689 00690 } /* namespace zorba */ 00691 #endif 00692 /* vim:set et sw=2 ts=2: */