<commit_before>{-# LANGUAGE ScopedTypeVariables #-}

{- |
Module           : $Header$
Description      :
Stability        : stable
Point-of-contact : jstanley

A quick-n-dirty reader for JAR files.  MANY keep-it-simple concessions have
been made regarding the zip structure of jars (e.g. no ZIP64, Deflate-type
compression only, etc., etc.).  Please don't mistake this module for any kind
of fully-fledged unzip implementation!

Info on the zip file format can be found at:
http://www.pkware.com/documents/casestudies/APPNOTE.TXT
-}
module Language.JVM.JarReader
  ( JarReader
  , addJar
  , dumpJarReader
  , loadClassFromJar
  , newJarReader
  ) where

import Control.Applicative
import Control.Arrow
import Control.Monad
import Data.Binary.Get
import Data.Bits
import Data.ByteString.Lazy       (ByteString, isSuffixOf, hGet)
import Data.ByteString.Lazy.Char8 (pack, unpack)
import Data.Map                   (Map)
import Data.Word
import System.IO

import qualified Codec.Compression.Zlib.Raw as Zlib
import qualified Control.Exception          as CE
import qualified Data.List                  as L
import qualified Data.ByteString.Lazy       as LBS
import qualified Data.Map                   as M

import Language.JVM.Parser

-- import Debug.Trace
<commit_msg>Export constructors of JarReader.<commit_after>{-# LANGUAGE ScopedTypeVariables #-}

{- |
Module           : $Header$
Description      :
Stability        : stable
Point-of-contact : jstanley

A quick-n-dirty reader for JAR files.  MANY keep-it-simple concessions have
been made regarding the zip structure of jars (e.g. no ZIP64, Deflate-type
compression only, etc., etc.).  Please don't mistake this module for any kind
of fully-fledged unzip implementation!

Info on the zip file format can be found at:
http://www.pkware.com/documents/casestudies/APPNOTE.TXT
-}
module Language.JVM.JarReader
  ( JarReader(..)
  , addJar
  , dumpJarReader
  , loadClassFromJar
  , newJarReader
  ) where

import Control.Applicative
import Control.Arrow
import Control.Monad
import Data.Binary.Get
import Data.Bits
import Data.ByteString.Lazy       (ByteString, isSuffixOf, hGet)
import Data.ByteString.Lazy.Char8 (pack, unpack)
import Data.Map                   (Map)
import Data.Word
import System.IO

import qualified Codec.Compression.Zlib.Raw as Zlib
import qualified Control.Exception          as CE
import qualified Data.List                  as L
import qualified Data.ByteString.Lazy       as LBS
import qualified Data.Map                   as M

import Language.JVM.Parser

-- import Debug.Trace

{'fraction_non_alphanumeric': 0.07623143080531665, 'fraction_numerical': 0.0023455824863174357, 'mean_word_length': 3.0944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1980752', 'n_tokens_mistral': 789, 'n_tokens_neox': 766, 'n_words': 247}