|
1 | 1 | """
|
2 | 2 | This module generates C++ code for Niflib from the NIF file format specification XML.
|
3 |
| -Created by Amorilia in 2006. |
4 |
| -@var native_types: A list of the types implemented manually in Niflib. Those are the types tagged by the niflibtype tag in the XML. |
5 |
| -@type native_types: ? |
6 |
| -@var basic_types: A list of the basic types (<basic> in XML). These are different from native types, since some of the structs can also be natively implemented in Niflib. |
7 |
| -@type basic_types: ? |
8 |
| -@var compound_types: A list of the struct types (<compound> in XML). |
9 |
| -@type compound_types: ? |
10 |
| -@var basic_names: A list of the basic type names. |
11 |
| -@type basic_names: ? |
12 |
| -@var compound_names: A list of the struct names. |
13 |
| -@type compound_names: ? |
14 |
| -@var block_types: A list of the NiObject-derived classes. |
15 |
| -@type block_types: ? |
16 |
| -@var ACTION_READ: Constant for use with CFile::stream. Causes it to generate Niflib's Read function. |
17 |
| -@type ACTION_READ: int |
| 3 | +
|
| 4 | +@author: Amorilia |
| 5 | +@author: Shon |
| 6 | +
|
| 7 | +@contact: http://niftools.sourceforge.net |
| 8 | +
|
| 9 | +@copyright: |
| 10 | +Copyright (c) 2005, NIF File Format Library and Tools. |
| 11 | +All rights reserved. |
| 12 | +
|
| 13 | +@license: |
| 14 | +Redistribution and use in source and binary forms, with or without |
| 15 | +modification, are permitted provided that the following conditions |
| 16 | +are met: |
| 17 | +
|
| 18 | + - Redistributions of source code must retain the above copyright |
| 19 | + notice, this list of conditions and the following disclaimer. |
| 20 | +
|
| 21 | + - Redistributions in binary form must reproduce the above |
| 22 | + copyright notice, this list of conditions and the following |
| 23 | + disclaimer in the documentation and/or other materials provided |
| 24 | + with the distribution. |
| 25 | +
|
| 26 | + - Neither the name of the NIF File Format Library and Tools |
| 27 | + project nor the names of its contributors may be used to endorse |
| 28 | + or promote products derived from this software without specific |
| 29 | + prior written permission. |
| 30 | +
|
| 31 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 34 | +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 35 | +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 36 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 37 | +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 38 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 39 | +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 40 | +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 41 | +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 42 | +POSSIBILITY OF SUCH DAMAGE. |
| 43 | +
|
| 44 | +@var native_types: Maps name of basic or compound type to name of type implemented manually in Niflib. |
| 45 | + These are the types tagged by the niflibtype tag in the XML. For example, |
| 46 | + if a (basic or compound) type with C{name="ferrari"} has C{niflibtype="car"} |
| 47 | + then C{native_types["ferrari"]} equals the string C{"car"}. |
| 48 | +@type native_types: C{dictionary} |
| 49 | +
|
| 50 | +@var basic_types: Maps name of basic type to L{Basic} instance. |
| 51 | +@type basic_types: C{dictionary} |
| 52 | +
|
| 53 | +@var compound_types: Maps name of compound type to a L{Compound} instance. |
| 54 | +@type compound_types: C{dictionary} |
| 55 | +
|
| 56 | +@var block_types: Maps name of the block name to a L{Block} instance. |
| 57 | +@type block_types: C{list} |
| 58 | +
|
| 59 | +@var basic_names: Sorted keys of L{basic_types}. |
| 60 | +@type basic_names: C{list} |
| 61 | +
|
| 62 | +@var compound_names: Sorted keys of L{compound_types}. |
| 63 | +@type compound_names: C{list} |
| 64 | +
|
| 65 | +@var block_names: Sorted keys of L{block_types}. |
| 66 | +@type block_names: C{list} |
| 67 | +
|
| 68 | +@var ACTION_READ: Constant for use with CFile::stream. Causes it to generate Niflib's Read function. |
| 69 | +@type ACTION_READ: C{int} |
| 70 | +
|
18 | 71 | @var ACTION_WRITE: Constant for use with CFile::stream. Causes it to generate Niflib's Write function.
|
19 |
| -@type ACTION_WRITE: int |
| 72 | +@type ACTION_WRITE: C{int} |
| 73 | +
|
20 | 74 | @var ACTION_OUT: Constant for use with CFile::stream. Causes it to generate Niflib's asString function.
|
21 |
| -@type ACTION_OUT: int |
| 75 | +@type ACTION_OUT: C{int} |
| 76 | +
|
22 | 77 | @var ACTION_FIXLINKS: Constant for use with CFile::stream. Causes it to generate Niflib's FixLinks function.
|
23 |
| -@type ACTION_FIXLINKS: int |
| 78 | +@type ACTION_FIXLINKS: C{int} |
| 79 | +
|
24 | 80 | @var ACTION_GETREFS: Constant for use with CFile::stream. Causes it to generate Niflib's GetRefs function.
|
25 |
| -@type ACTION_GETREFS: int |
| 81 | +@type ACTION_GETREFS: C{int} |
26 | 82 | """
|
27 | 83 |
|
28 | 84 | from xml.dom.minidom import *
|
|
0 commit comments