2 * The contents of this file are subject to the Mozilla Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/MPL/
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
12 * The Original Code is the Sablotron XSLT Processor.
14 * The Initial Developer of the Original Code is Ginger Alliance Ltd.
15 * Portions created by Ginger Alliance are Copyright (C) 2000-2002
16 * Ginger Alliance Ltd. All Rights Reserved.
20 * Alternatively, the contents of this file may be used under the
21 * terms of the GNU General Public License Version 2 or later (the
22 * "GPL"), in which case the provisions of the GPL are applicable
23 * instead of those above. If you wish to allow use of your
24 * version of this file only under the terms of the GPL and not to
25 * allow others to use your version of this file under the MPL,
26 * indicate your decision by deleting the provisions above and
27 * replace them with the notice and other provisions required by
28 * the GPL. If you do not delete the provisions above, a recipient
29 * may use your version of this file under either the MPL or the
33 /*****************************************************************
35 Sablotron XSLT processor project
37 This module does the work related to retrieving data in answer to
39 *****************************************************************/
51 possible URI schemes for a DataLine
53 - arg for access to named buffers
54 - other scheme to by handled by an extension (a SchemeHandler)
58 URI_FILE, URI_ARG, URI_EXTENSION, URI_NONE
61 /*****************************************************************
64 merges a (possibly relative) URI reference with a base URI.
70 *****************************************************************/
73 URIScheme makeAbsoluteURI(Sit S, const char* uri,
74 const char* base, Str& absolute);
75 URIScheme uri2SchemePath(Sit S, const char *absolute, Str& scheme, Str& rest);
79 possible access modes for a DataLine
84 DLMODE_NONE, DLMODE_READ, DLMODE_WRITE, DLMODE_CLOSED
87 /*****************************************************************
89 a class associated to any data source or destination at a given URI;
90 - can be open for reading or for writing
91 - 'Processor' class has a list of open DataLines
92 together with the associated trees (serving as a cache)
93 *****************************************************************/
102 // opens the resource at _uri for reading/writing based on _mode:
103 eFlag open(Sit S, const char *_uri, DLAccessMode _mode,
104 StrStrList* argList_, Bool ignoreErr = FALSE);
106 // sends data to the resource
107 eFlag save(Sit S, const char *data, int len);
108 int get(Sit S, char *where, int maxcount);
109 DynBlock* getOutBuffer();
113 eFlag setURIAndClose(Sit S, const char *_uri);
119 SchemeHandler *handler;
126 void report(Sit S, MsgType type, MsgCode code, const Str& arg1, const Str& arg2);