diff options
| author | 2014-07-30 23:43:09 -0400 | |
|---|---|---|
| committer | 2014-07-30 23:43:09 -0400 | |
| commit | 4349d22cc8abf5ec74075dde1b45c5f2f8679bbf (patch) | |
| tree | 6200f39f3539e2def5010078200592141498be33 /src/cuchaz/enigma/gui/GuiController.java | |
| parent | forgot to apply copyright notices (diff) | |
| download | enigma-fork-4349d22cc8abf5ec74075dde1b45c5f2f8679bbf.tar.gz enigma-fork-4349d22cc8abf5ec74075dde1b45c5f2f8679bbf.tar.xz enigma-fork-4349d22cc8abf5ec74075dde1b45c5f2f8679bbf.zip | |
switched to line-by-line mergable, human-readable file format for mappings
Diffstat (limited to '')
| -rw-r--r-- | src/cuchaz/enigma/gui/GuiController.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cuchaz/enigma/gui/GuiController.java b/src/cuchaz/enigma/gui/GuiController.java index 5df2d43..fb22b96 100644 --- a/src/cuchaz/enigma/gui/GuiController.java +++ b/src/cuchaz/enigma/gui/GuiController.java | |||
| @@ -11,8 +11,8 @@ | |||
| 11 | package cuchaz.enigma.gui; | 11 | package cuchaz.enigma.gui; |
| 12 | 12 | ||
| 13 | import java.io.File; | 13 | import java.io.File; |
| 14 | import java.io.FileInputStream; | 14 | import java.io.FileReader; |
| 15 | import java.io.FileOutputStream; | 15 | import java.io.FileWriter; |
| 16 | import java.io.IOException; | 16 | import java.io.IOException; |
| 17 | 17 | ||
| 18 | import cuchaz.enigma.ClassFile; | 18 | import cuchaz.enigma.ClassFile; |
| @@ -22,7 +22,8 @@ import cuchaz.enigma.analysis.SourceIndex; | |||
| 22 | import cuchaz.enigma.mapping.ClassEntry; | 22 | import cuchaz.enigma.mapping.ClassEntry; |
| 23 | import cuchaz.enigma.mapping.Entry; | 23 | import cuchaz.enigma.mapping.Entry; |
| 24 | import cuchaz.enigma.mapping.EntryPair; | 24 | import cuchaz.enigma.mapping.EntryPair; |
| 25 | import cuchaz.enigma.mapping.TranslationMappings; | 25 | import cuchaz.enigma.mapping.MappingsReader; |
| 26 | import cuchaz.enigma.mapping.MappingsWriter; | ||
| 26 | 27 | ||
| 27 | public class GuiController | 28 | public class GuiController |
| 28 | { | 29 | { |
| @@ -56,17 +57,19 @@ public class GuiController | |||
| 56 | public void openMappings( File file ) | 57 | public void openMappings( File file ) |
| 57 | throws IOException | 58 | throws IOException |
| 58 | { | 59 | { |
| 59 | FileInputStream in = new FileInputStream( file ); | 60 | FileReader in = new FileReader( file ); |
| 60 | m_deobfuscator.setMappings( TranslationMappings.newFromStream( in ) ); | 61 | m_deobfuscator.setMappings( new MappingsReader().read( in ) ); |
| 61 | in.close(); | 62 | in.close(); |
| 63 | // TEMP | ||
| 64 | System.out.println( m_deobfuscator.getMappings() ); | ||
| 62 | refreshOpenFiles(); | 65 | refreshOpenFiles(); |
| 63 | } | 66 | } |
| 64 | 67 | ||
| 65 | public void saveMappings( File file ) | 68 | public void saveMappings( File file ) |
| 66 | throws IOException | 69 | throws IOException |
| 67 | { | 70 | { |
| 68 | FileOutputStream out = new FileOutputStream( file ); | 71 | FileWriter out = new FileWriter( file ); |
| 69 | m_deobfuscator.getMappings().write( out ); | 72 | new MappingsWriter().write( out, m_deobfuscator.getMappings() ); |
| 70 | out.close(); | 73 | out.close(); |
| 71 | } | 74 | } |
| 72 | 75 | ||