Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | virukav@gmail.com |
Log files parsing primitives
- type LogState a = State [String] a
- type Field = String
- matchLine :: String -> LogState [Field]
- matchField :: Read a => String -> Int -> LogState a
- optLine :: String -> String -> LogState [Field]
- optString :: String -> String -> Int -> Int -> String -> LogState Field
- optField :: Read a => String -> String -> Int -> a -> LogState a
- string :: Int -> Int -> [Field] -> Field
- field :: Read a => Int -> [Field] -> a
- look :: String -> String -> LogState Bool
- lookAhead :: (String -> Bool) -> (String -> Bool) -> LogState Bool
- whileJust :: Monad m => m (Maybe a) -> m [a]
- goto :: [String] -> LogState [Field]
Documentation
optLine :: String -> String -> LogState [Field]Source
Get fields if the first substring matches otherwise return empty
optString :: String -> String -> Int -> Int -> String -> LogState FieldSource
Get string field if the first substring matches otherwise return a default value
optField :: Read a => String -> String -> Int -> a -> LogState aSource
Get field if the first substring matches otherwise return a default value
look :: String -> String -> LogState BoolSource
Look ahead for the first substring until the second substring