Some documentation.
[hs-java.git] / Java / JAR / Archive.hs
index 035f1e1d5b4ec31085e0b1d6a9676bb0d64dddcf..d84be49c35034b2b05d7c19e13bb7b3df8f627c3 100644 (file)
@@ -1,4 +1,4 @@
-
+-- | This module defines functions to read Java JAR files.
 module Java.JAR.Archive where
 
 import Control.Monad.Trans
@@ -12,17 +12,20 @@ import Java.ClassPath.Common
 import JVM.ClassFile
 import JVM.Converter
 
+-- | Read all entires from JAR file
 readJAR :: FilePath -> IO [Tree CPEntry]
 readJAR jarfile = do
   files <- Zip.withArchive [] jarfile $ Zip.fileNames []
   return $ mapF (NotLoadedJAR jarfile) (buildTree files)
 
+-- | Read one class from JAR file
 readFromJAR :: FilePath -> FilePath -> IO (Class Direct)
 readFromJAR jarfile path = do
   content <- Zip.withArchive [] jarfile $ Zip.fileContents [] path
   let bstr = B.pack content
   return $ classFile2Direct (decode bstr)
 
+-- | Add given JAR file to ClassPath
 addJAR :: FilePath -> ClassPath ()
 addJAR jarfile = do
   classes <- liftIO $ readJAR jarfile