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
45 DefaultedStr(const char* defaultValue_, Bool singleChar_, XSL_ATT id_);
47 eFlag set(Sit S, const Str& value);
49 void report(Sit S, MsgType type, MsgCode code,
50 const Str &arg1, const Str &arg2) const;
60 // the DecimalFormat class made after java.text.DecimalFormat
61 // it's rather a 'format format' or meta-format
66 DecimalFormat(const EQName& name);
68 eFlag setItem(Sit S, XSL_ATT itemId, const Str& value);
69 const Str& getItem(XSL_ATT itemId);
70 eFlag format(Sit S, Number& num, const Str& fmt, Str& result);
71 const EQName& getname();
72 void report(Sit S, MsgType type, MsgCode code,
73 const Str &arg1, const Str &arg2) const;
87 DefaultedStr* findItem(XSL_ATT itemId);
88 XSL_ATT whichToken(const char* ptr, int len);
89 eFlag parseSubpattern(
90 Sit S, const char *&ptr, Bool negative,
91 Str& prefix, Str& suffix, int& factor,
92 int& iDigitsMin, int& fDigits, int& fDigitsMin, int& gSize);
94 Sit S, const Str &src, Bool negative,
95 Str& prefix, Str& suffix, int& factor,
96 int& iDigitsMin, int& fDigits, int& fDigitsMin, int& gSize);
99 class DecimalFormatList: public PList<DecimalFormat*>
104 ~DecimalFormatList();
105 eFlag add(Sit S, const EQName& name, DecimalFormat*& result);
106 eFlag format(Sit S, const EQName& name, Number& num, const Str& fmt, Str& result);
107 void report(Sit S, MsgType type, MsgCode code,
108 const Str &arg1, const Str &arg2) const;
110 int findNdx(const EQName& name);
113 #endif // DecimalHIncl