1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.ini4j;
17
18 import org.ini4j.spi.WinEscapeTool;
19
20 import java.io.File;
21 import java.io.IOException;
22 import java.io.InputStream;
23 import java.io.Reader;
24
25 import java.net.URL;
26
27 public class Wini extends Ini
28 {
29 private static final long serialVersionUID = -2781377824232440728L;
30 public static final char PATH_SEPARATOR = '\\';
31
32 public Wini()
33 {
34 Config cfg = Config.getGlobal().clone();
35
36 cfg.setEscape(false);
37 cfg.setEscapeNewline(false);
38 cfg.setGlobalSection(true);
39 cfg.setEmptyOption(true);
40 cfg.setMultiOption(false);
41 cfg.setPathSeparator(PATH_SEPARATOR);
42 setConfig(cfg);
43 }
44
45 public Wini(File input) throws IOException, InvalidFileFormatException
46 {
47 this();
48 setFile(input);
49 load();
50 }
51
52 public Wini(URL input) throws IOException, InvalidFileFormatException
53 {
54 this();
55 load(input);
56 }
57
58 public Wini(InputStream input) throws IOException, InvalidFileFormatException
59 {
60 this();
61 load(input);
62 }
63
64 public Wini(Reader input) throws IOException, InvalidFileFormatException
65 {
66 this();
67 load(input);
68 }
69
70 public String escape(String value)
71 {
72 return WinEscapeTool.getInstance().escape(value);
73 }
74
75 public String unescape(String value)
76 {
77 return WinEscapeTool.getInstance().unescape(value);
78 }
79 }