Code

Add new rearranged /dom directory
[inkscape.git] / src / dom / work / testzip.cpp
1 /**\r
2  * Phoebe DOM Implementation.\r
3  *\r
4  * This is a C++ approximation of the W3C DOM model, which follows\r
5  * fairly closely the specifications in the various .idl files, copies of\r
6  * which are provided for reference.  Most important is this one:\r
7  *\r
8  * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html\r
9  *\r
10  * Authors:\r
11  *   Bob Jamison\r
12  *\r
13  * Copyright (C) 2006 Bob Jamison\r
14  *\r
15  *  This library is free software; you can redistribute it and/or\r
16  *  modify it under the terms of the GNU Lesser General Public\r
17  *  License as published by the Free Software Foundation; either\r
18  *  version 2.1 of the License, or (at your option) any later version.\r
19  *\r
20  *  This library is distributed in the hope that it will be useful,\r
21  *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
22  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
23  *  Lesser General Public License for more details.\r
24  *\r
25  *  You should have received a copy of the GNU Lesser General Public\r
26  *  License along with this library; if not, write to the Free Software\r
27  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
28  */\r
29 \r
30 #include <stdio.h>\r
31 \r
32 \r
33 #include "io/uristream.h"\r
34 #include "util/ziptool.h"\r
35 \r
36 \r
37 \r
38 bool doTest()\r
39 {\r
40     org::w3c::dom::io::UriInputStream ins("file:work/test.odg");\r
41 \r
42     std::vector<unsigned char>inbuf;\r
43 \r
44     while (true)\r
45         {\r
46         int ch = ins.get();\r
47         if (ch < 0)\r
48             break;\r
49         inbuf.push_back(ch);\r
50         }\r
51     ZipFile zf;\r
52     if (!zf.readBuffer(inbuf))\r
53         {\r
54         return false;\r
55         }\r
56     return true;\r
57 }\r
58 \r
59 \r
60 int main(int argc, char **argv)\r
61 {\r
62     doTest();\r
63 }\r
64 \r
65 \r