#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Json.Enums
(
NodeType(..) ,
ParserError(..) ,
catchParserError ,
handleParserError ,
PathError(..) ,
catchPathError ,
handlePathError ,
ReaderError(..) ,
catchReaderError ,
handleReaderError ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
data ReaderError =
ReaderErrorNoArray
| ReaderErrorInvalidIndex
| ReaderErrorNoObject
| ReaderErrorInvalidMember
| ReaderErrorInvalidNode
| ReaderErrorNoValue
| ReaderErrorInvalidType
| AnotherReaderError Int
deriving (Int -> ReaderError -> ShowS
[ReaderError] -> ShowS
ReaderError -> String
(Int -> ReaderError -> ShowS)
-> (ReaderError -> String)
-> ([ReaderError] -> ShowS)
-> Show ReaderError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReaderError] -> ShowS
$cshowList :: [ReaderError] -> ShowS
show :: ReaderError -> String
$cshow :: ReaderError -> String
showsPrec :: Int -> ReaderError -> ShowS
$cshowsPrec :: Int -> ReaderError -> ShowS
Show, ReaderError -> ReaderError -> Bool
(ReaderError -> ReaderError -> Bool)
-> (ReaderError -> ReaderError -> Bool) -> Eq ReaderError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReaderError -> ReaderError -> Bool
$c/= :: ReaderError -> ReaderError -> Bool
== :: ReaderError -> ReaderError -> Bool
$c== :: ReaderError -> ReaderError -> Bool
Eq)
instance P.Enum ReaderError where
fromEnum :: ReaderError -> Int
fromEnum ReaderError
ReaderErrorNoArray = Int
0
fromEnum ReaderError
ReaderErrorInvalidIndex = Int
1
fromEnum ReaderError
ReaderErrorNoObject = Int
2
fromEnum ReaderError
ReaderErrorInvalidMember = Int
3
fromEnum ReaderError
ReaderErrorInvalidNode = Int
4
fromEnum ReaderError
ReaderErrorNoValue = Int
5
fromEnum ReaderError
ReaderErrorInvalidType = Int
6
fromEnum (AnotherReaderError Int
k) = Int
k
toEnum :: Int -> ReaderError
toEnum Int
0 = ReaderError
ReaderErrorNoArray
toEnum Int
1 = ReaderError
ReaderErrorInvalidIndex
toEnum Int
2 = ReaderError
ReaderErrorNoObject
toEnum Int
3 = ReaderError
ReaderErrorInvalidMember
toEnum Int
4 = ReaderError
ReaderErrorInvalidNode
toEnum Int
5 = ReaderError
ReaderErrorNoValue
toEnum Int
6 = ReaderError
ReaderErrorInvalidType
toEnum Int
k = Int -> ReaderError
AnotherReaderError Int
k
instance P.Ord ReaderError where
compare :: ReaderError -> ReaderError -> Ordering
compare ReaderError
a ReaderError
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (ReaderError -> Int
forall a. Enum a => a -> Int
P.fromEnum ReaderError
a) (ReaderError -> Int
forall a. Enum a => a -> Int
P.fromEnum ReaderError
b)
instance GErrorClass ReaderError where
gerrorClassDomain :: ReaderError -> Text
gerrorClassDomain ReaderError
_ = Text
"json-reader-error-quark"
catchReaderError ::
IO a ->
(ReaderError -> GErrorMessage -> IO a) ->
IO a
catchReaderError :: forall a. IO a -> (ReaderError -> Text -> IO a) -> IO a
catchReaderError = IO a -> (ReaderError -> Text -> IO a) -> IO a
forall err a.
GErrorClass err =>
IO a -> (err -> Text -> IO a) -> IO a
catchGErrorJustDomain
handleReaderError ::
(ReaderError -> GErrorMessage -> IO a) ->
IO a ->
IO a
handleReaderError :: forall a. (ReaderError -> Text -> IO a) -> IO a -> IO a
handleReaderError = (ReaderError -> Text -> IO a) -> IO a -> IO a
forall err a.
GErrorClass err =>
(err -> Text -> IO a) -> IO a -> IO a
handleGErrorJustDomain
type instance O.ParentTypes ReaderError = '[]
instance O.HasParentTypes ReaderError
foreign import ccall "json_reader_error_get_type" c_json_reader_error_get_type ::
IO GType
instance B.Types.TypedObject ReaderError where
glibType :: IO GType
glibType = IO GType
c_json_reader_error_get_type
instance B.Types.BoxedEnum ReaderError
data PathError =
PathErrorQuery
| AnotherPathError Int
deriving (Int -> PathError -> ShowS
[PathError] -> ShowS
PathError -> String
(Int -> PathError -> ShowS)
-> (PathError -> String)
-> ([PathError] -> ShowS)
-> Show PathError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PathError] -> ShowS
$cshowList :: [PathError] -> ShowS
show :: PathError -> String
$cshow :: PathError -> String
showsPrec :: Int -> PathError -> ShowS
$cshowsPrec :: Int -> PathError -> ShowS
Show, PathError -> PathError -> Bool
(PathError -> PathError -> Bool)
-> (PathError -> PathError -> Bool) -> Eq PathError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PathError -> PathError -> Bool
$c/= :: PathError -> PathError -> Bool
== :: PathError -> PathError -> Bool
$c== :: PathError -> PathError -> Bool
Eq)
instance P.Enum PathError where
fromEnum :: PathError -> Int
fromEnum PathError
PathErrorQuery = Int
0
fromEnum (AnotherPathError Int
k) = Int
k
toEnum :: Int -> PathError
toEnum Int
0 = PathError
PathErrorQuery
toEnum Int
k = Int -> PathError
AnotherPathError Int
k
instance P.Ord PathError where
compare :: PathError -> PathError -> Ordering
compare PathError
a PathError
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (PathError -> Int
forall a. Enum a => a -> Int
P.fromEnum PathError
a) (PathError -> Int
forall a. Enum a => a -> Int
P.fromEnum PathError
b)
instance GErrorClass PathError where
gerrorClassDomain :: PathError -> Text
gerrorClassDomain PathError
_ = Text
"json-path-error-quark"
catchPathError ::
IO a ->
(PathError -> GErrorMessage -> IO a) ->
IO a
catchPathError :: forall a. IO a -> (PathError -> Text -> IO a) -> IO a
catchPathError = IO a -> (PathError -> Text -> IO a) -> IO a
forall err a.
GErrorClass err =>
IO a -> (err -> Text -> IO a) -> IO a
catchGErrorJustDomain
handlePathError ::
(PathError -> GErrorMessage -> IO a) ->
IO a ->
IO a
handlePathError :: forall a. (PathError -> Text -> IO a) -> IO a -> IO a
handlePathError = (PathError -> Text -> IO a) -> IO a -> IO a
forall err a.
GErrorClass err =>
(err -> Text -> IO a) -> IO a -> IO a
handleGErrorJustDomain
type instance O.ParentTypes PathError = '[]
instance O.HasParentTypes PathError
foreign import ccall "json_path_error_get_type" c_json_path_error_get_type ::
IO GType
instance B.Types.TypedObject PathError where
glibType :: IO GType
glibType = IO GType
c_json_path_error_get_type
instance B.Types.BoxedEnum PathError
data ParserError =
ParserErrorParse
| ParserErrorTrailingComma
| ParserErrorMissingComma
| ParserErrorMissingColon
| ParserErrorInvalidBareword
| ParserErrorEmptyMemberName
| ParserErrorInvalidData
| ParserErrorUnknown
| AnotherParserError Int
deriving (Int -> ParserError -> ShowS
[ParserError] -> ShowS
ParserError -> String
(Int -> ParserError -> ShowS)
-> (ParserError -> String)
-> ([ParserError] -> ShowS)
-> Show ParserError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParserError] -> ShowS
$cshowList :: [ParserError] -> ShowS
show :: ParserError -> String
$cshow :: ParserError -> String
showsPrec :: Int -> ParserError -> ShowS
$cshowsPrec :: Int -> ParserError -> ShowS
Show, ParserError -> ParserError -> Bool
(ParserError -> ParserError -> Bool)
-> (ParserError -> ParserError -> Bool) -> Eq ParserError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParserError -> ParserError -> Bool
$c/= :: ParserError -> ParserError -> Bool
== :: ParserError -> ParserError -> Bool
$c== :: ParserError -> ParserError -> Bool
Eq)
instance P.Enum ParserError where
fromEnum :: ParserError -> Int
fromEnum ParserError
ParserErrorParse = Int
0
fromEnum ParserError
ParserErrorTrailingComma = Int
1
fromEnum ParserError
ParserErrorMissingComma = Int
2
fromEnum ParserError
ParserErrorMissingColon = Int
3
fromEnum ParserError
ParserErrorInvalidBareword = Int
4
fromEnum ParserError
ParserErrorEmptyMemberName = Int
5
fromEnum ParserError
ParserErrorInvalidData = Int
6
fromEnum ParserError
ParserErrorUnknown = Int
7
fromEnum (AnotherParserError Int
k) = Int
k
toEnum :: Int -> ParserError
toEnum Int
0 = ParserError
ParserErrorParse
toEnum Int
1 = ParserError
ParserErrorTrailingComma
toEnum Int
2 = ParserError
ParserErrorMissingComma
toEnum Int
3 = ParserError
ParserErrorMissingColon
toEnum Int
4 = ParserError
ParserErrorInvalidBareword
toEnum Int
5 = ParserError
ParserErrorEmptyMemberName
toEnum Int
6 = ParserError
ParserErrorInvalidData
toEnum Int
7 = ParserError
ParserErrorUnknown
toEnum Int
k = Int -> ParserError
AnotherParserError Int
k
instance P.Ord ParserError where
compare :: ParserError -> ParserError -> Ordering
compare ParserError
a ParserError
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (ParserError -> Int
forall a. Enum a => a -> Int
P.fromEnum ParserError
a) (ParserError -> Int
forall a. Enum a => a -> Int
P.fromEnum ParserError
b)
instance GErrorClass ParserError where
gerrorClassDomain :: ParserError -> Text
gerrorClassDomain ParserError
_ = Text
"json-parser-error-quark"
catchParserError ::
IO a ->
(ParserError -> GErrorMessage -> IO a) ->
IO a
catchParserError :: forall a. IO a -> (ParserError -> Text -> IO a) -> IO a
catchParserError = IO a -> (ParserError -> Text -> IO a) -> IO a
forall err a.
GErrorClass err =>
IO a -> (err -> Text -> IO a) -> IO a
catchGErrorJustDomain
handleParserError ::
(ParserError -> GErrorMessage -> IO a) ->
IO a ->
IO a
handleParserError :: forall a. (ParserError -> Text -> IO a) -> IO a -> IO a
handleParserError = (ParserError -> Text -> IO a) -> IO a -> IO a
forall err a.
GErrorClass err =>
(err -> Text -> IO a) -> IO a -> IO a
handleGErrorJustDomain
type instance O.ParentTypes ParserError = '[]
instance O.HasParentTypes ParserError
foreign import ccall "json_parser_error_get_type" c_json_parser_error_get_type ::
IO GType
instance B.Types.TypedObject ParserError where
glibType :: IO GType
glibType = IO GType
c_json_parser_error_get_type
instance B.Types.BoxedEnum ParserError
data NodeType =
NodeTypeObject
| NodeTypeArray
| NodeTypeValue
| NodeTypeNull
| AnotherNodeType Int
deriving (Int -> NodeType -> ShowS
[NodeType] -> ShowS
NodeType -> String
(Int -> NodeType -> ShowS)
-> (NodeType -> String) -> ([NodeType] -> ShowS) -> Show NodeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeType] -> ShowS
$cshowList :: [NodeType] -> ShowS
show :: NodeType -> String
$cshow :: NodeType -> String
showsPrec :: Int -> NodeType -> ShowS
$cshowsPrec :: Int -> NodeType -> ShowS
Show, NodeType -> NodeType -> Bool
(NodeType -> NodeType -> Bool)
-> (NodeType -> NodeType -> Bool) -> Eq NodeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeType -> NodeType -> Bool
$c/= :: NodeType -> NodeType -> Bool
== :: NodeType -> NodeType -> Bool
$c== :: NodeType -> NodeType -> Bool
Eq)
instance P.Enum NodeType where
fromEnum :: NodeType -> Int
fromEnum NodeType
NodeTypeObject = Int
0
fromEnum NodeType
NodeTypeArray = Int
1
fromEnum NodeType
NodeTypeValue = Int
2
fromEnum NodeType
NodeTypeNull = Int
3
fromEnum (AnotherNodeType Int
k) = Int
k
toEnum :: Int -> NodeType
toEnum Int
0 = NodeType
NodeTypeObject
toEnum Int
1 = NodeType
NodeTypeArray
toEnum Int
2 = NodeType
NodeTypeValue
toEnum Int
3 = NodeType
NodeTypeNull
toEnum Int
k = Int -> NodeType
AnotherNodeType Int
k
instance P.Ord NodeType where
compare :: NodeType -> NodeType -> Ordering
compare NodeType
a NodeType
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (NodeType -> Int
forall a. Enum a => a -> Int
P.fromEnum NodeType
a) (NodeType -> Int
forall a. Enum a => a -> Int
P.fromEnum NodeType
b)
type instance O.ParentTypes NodeType = '[]
instance O.HasParentTypes NodeType
foreign import ccall "json_node_type_get_type" c_json_node_type_get_type ::
IO GType
instance B.Types.TypedObject NodeType where
glibType :: IO GType
glibType = IO GType
c_json_node_type_get_type
instance B.Types.BoxedEnum NodeType