{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Structs.Cookie
(
Cookie(..) ,
newZeroCookie ,
#if defined(ENABLE_OVERLOADING)
ResolveCookieMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
CookieAppliesToUriMethodInfo ,
#endif
cookieAppliesToUri ,
#if defined(ENABLE_OVERLOADING)
CookieCopyMethodInfo ,
#endif
cookieCopy ,
#if defined(ENABLE_OVERLOADING)
CookieDomainMatchesMethodInfo ,
#endif
cookieDomainMatches ,
#if defined(ENABLE_OVERLOADING)
CookieEqualMethodInfo ,
#endif
cookieEqual ,
#if defined(ENABLE_OVERLOADING)
CookieFreeMethodInfo ,
#endif
cookieFree ,
#if defined(ENABLE_OVERLOADING)
CookieGetDomainMethodInfo ,
#endif
cookieGetDomain ,
#if defined(ENABLE_OVERLOADING)
CookieGetExpiresMethodInfo ,
#endif
cookieGetExpires ,
#if defined(ENABLE_OVERLOADING)
CookieGetHttpOnlyMethodInfo ,
#endif
cookieGetHttpOnly ,
#if defined(ENABLE_OVERLOADING)
CookieGetNameMethodInfo ,
#endif
cookieGetName ,
#if defined(ENABLE_OVERLOADING)
CookieGetPathMethodInfo ,
#endif
cookieGetPath ,
#if defined(ENABLE_OVERLOADING)
CookieGetSameSitePolicyMethodInfo ,
#endif
cookieGetSameSitePolicy ,
#if defined(ENABLE_OVERLOADING)
CookieGetSecureMethodInfo ,
#endif
cookieGetSecure ,
#if defined(ENABLE_OVERLOADING)
CookieGetValueMethodInfo ,
#endif
cookieGetValue ,
cookieNew ,
cookieParse ,
#if defined(ENABLE_OVERLOADING)
CookieSetDomainMethodInfo ,
#endif
cookieSetDomain ,
#if defined(ENABLE_OVERLOADING)
CookieSetExpiresMethodInfo ,
#endif
cookieSetExpires ,
#if defined(ENABLE_OVERLOADING)
CookieSetHttpOnlyMethodInfo ,
#endif
cookieSetHttpOnly ,
#if defined(ENABLE_OVERLOADING)
CookieSetMaxAgeMethodInfo ,
#endif
cookieSetMaxAge ,
#if defined(ENABLE_OVERLOADING)
CookieSetNameMethodInfo ,
#endif
cookieSetName ,
#if defined(ENABLE_OVERLOADING)
CookieSetPathMethodInfo ,
#endif
cookieSetPath ,
#if defined(ENABLE_OVERLOADING)
CookieSetSameSitePolicyMethodInfo ,
#endif
cookieSetSameSitePolicy ,
#if defined(ENABLE_OVERLOADING)
CookieSetSecureMethodInfo ,
#endif
cookieSetSecure ,
#if defined(ENABLE_OVERLOADING)
CookieSetValueMethodInfo ,
#endif
cookieSetValue ,
#if defined(ENABLE_OVERLOADING)
CookieToCookieHeaderMethodInfo ,
#endif
cookieToCookieHeader ,
#if defined(ENABLE_OVERLOADING)
CookieToSetCookieHeaderMethodInfo ,
#endif
cookieToSetCookieHeader ,
clearCookieDomain ,
#if defined(ENABLE_OVERLOADING)
cookie_domain ,
#endif
getCookieDomain ,
setCookieDomain ,
clearCookieExpires ,
#if defined(ENABLE_OVERLOADING)
cookie_expires ,
#endif
getCookieExpires ,
setCookieExpires ,
#if defined(ENABLE_OVERLOADING)
cookie_httpOnly ,
#endif
getCookieHttpOnly ,
setCookieHttpOnly ,
clearCookieName ,
#if defined(ENABLE_OVERLOADING)
cookie_name ,
#endif
getCookieName ,
setCookieName ,
clearCookiePath ,
#if defined(ENABLE_OVERLOADING)
cookie_path ,
#endif
getCookiePath ,
setCookiePath ,
#if defined(ENABLE_OVERLOADING)
cookie_secure ,
#endif
getCookieSecure ,
setCookieSecure ,
clearCookieValue ,
#if defined(ENABLE_OVERLOADING)
cookie_value ,
#endif
getCookieValue ,
setCookieValue ,
) 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.GHashTable as B.GHT
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
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
import {-# SOURCE #-} qualified GI.Soup.Structs.Date as Soup.Date
import {-# SOURCE #-} qualified GI.Soup.Structs.URI as Soup.URI
newtype Cookie = Cookie (SP.ManagedPtr Cookie)
deriving (Cookie -> Cookie -> Bool
(Cookie -> Cookie -> Bool)
-> (Cookie -> Cookie -> Bool) -> Eq Cookie
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Cookie -> Cookie -> Bool
== :: Cookie -> Cookie -> Bool
$c/= :: Cookie -> Cookie -> Bool
/= :: Cookie -> Cookie -> Bool
Eq)
instance SP.ManagedPtrNewtype Cookie where
toManagedPtr :: Cookie -> ManagedPtr Cookie
toManagedPtr (Cookie ManagedPtr Cookie
p) = ManagedPtr Cookie
p
foreign import ccall "soup_cookie_get_type" c_soup_cookie_get_type ::
IO GType
type instance O.ParentTypes Cookie = '[]
instance O.HasParentTypes Cookie
instance B.Types.TypedObject Cookie where
glibType :: IO GType
glibType = IO GType
c_soup_cookie_get_type
instance B.Types.GBoxed Cookie
instance B.GValue.IsGValue (Maybe Cookie) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_cookie_get_type
gvalueSet_ :: Ptr GValue -> Maybe Cookie -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Cookie
P.Nothing = Ptr GValue -> Ptr Cookie -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Cookie
forall a. Ptr a
FP.nullPtr :: FP.Ptr Cookie)
gvalueSet_ Ptr GValue
gv (P.Just Cookie
obj) = Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Cookie
obj (Ptr GValue -> Ptr Cookie -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Cookie)
gvalueGet_ Ptr GValue
gv = do
Ptr Cookie
ptr <- Ptr GValue -> IO (Ptr Cookie)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Cookie)
if Ptr Cookie
ptr Ptr Cookie -> Ptr Cookie -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Cookie
forall a. Ptr a
FP.nullPtr
then Cookie -> Maybe Cookie
forall a. a -> Maybe a
P.Just (Cookie -> Maybe Cookie) -> IO Cookie -> IO (Maybe Cookie)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Cookie -> Cookie) -> Ptr Cookie -> IO Cookie
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Cookie -> Cookie
Cookie Ptr Cookie
ptr
else Maybe Cookie -> IO (Maybe Cookie)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Cookie
forall a. Maybe a
P.Nothing
newZeroCookie :: MonadIO m => m Cookie
newZeroCookie :: forall (m :: * -> *). MonadIO m => m Cookie
newZeroCookie = IO Cookie -> m Cookie
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Cookie -> m Cookie) -> IO Cookie -> m Cookie
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr Cookie)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
48 IO (Ptr Cookie) -> (Ptr Cookie -> IO Cookie) -> IO Cookie
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Cookie -> Cookie) -> Ptr Cookie -> IO Cookie
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Cookie -> Cookie
Cookie
instance tag ~ 'AttrSet => Constructible Cookie tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr Cookie -> Cookie) -> [AttrOp Cookie tag] -> m Cookie
new ManagedPtr Cookie -> Cookie
_ [AttrOp Cookie tag]
attrs = do
Cookie
o <- m Cookie
forall (m :: * -> *). MonadIO m => m Cookie
newZeroCookie
Cookie -> [AttrOp Cookie 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Cookie
o [AttrOp Cookie tag]
[AttrOp Cookie 'AttrSet]
attrs
Cookie -> m Cookie
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return Cookie
o
getCookieName :: MonadIO m => Cookie -> m (Maybe T.Text)
getCookieName :: forall (m :: * -> *). MonadIO m => Cookie -> m (Maybe Text)
getCookieName Cookie
s = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setCookieName :: MonadIO m => Cookie -> CString -> m ()
setCookieName :: forall (m :: * -> *). MonadIO m => Cookie -> CString -> m ()
setCookieName Cookie
s CString
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
val :: CString)
clearCookieName :: MonadIO m => Cookie -> m ()
clearCookieName :: forall (m :: * -> *). MonadIO m => Cookie -> m ()
clearCookieName Cookie
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data CookieNameFieldInfo
instance AttrInfo CookieNameFieldInfo where
type AttrBaseTypeConstraint CookieNameFieldInfo = (~) Cookie
type AttrAllowedOps CookieNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint CookieNameFieldInfo = (~) CString
type AttrTransferTypeConstraint CookieNameFieldInfo = (~)CString
type AttrTransferType CookieNameFieldInfo = CString
type AttrGetType CookieNameFieldInfo = Maybe T.Text
type AttrLabel CookieNameFieldInfo = "name"
type AttrOrigin CookieNameFieldInfo = Cookie
attrGet = getCookieName
attrSet = setCookieName
attrConstruct = undefined
attrClear = clearCookieName
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.name"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#g:attr:name"
})
cookie_name :: AttrLabelProxy "name"
cookie_name = AttrLabelProxy
#endif
getCookieValue :: MonadIO m => Cookie -> m (Maybe T.Text)
getCookieValue :: forall (m :: * -> *). MonadIO m => Cookie -> m (Maybe Text)
getCookieValue Cookie
s = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setCookieValue :: MonadIO m => Cookie -> CString -> m ()
setCookieValue :: forall (m :: * -> *). MonadIO m => Cookie -> CString -> m ()
setCookieValue Cookie
s CString
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CString
val :: CString)
clearCookieValue :: MonadIO m => Cookie -> m ()
clearCookieValue :: forall (m :: * -> *). MonadIO m => Cookie -> m ()
clearCookieValue Cookie
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data CookieValueFieldInfo
instance AttrInfo CookieValueFieldInfo where
type AttrBaseTypeConstraint CookieValueFieldInfo = (~) Cookie
type AttrAllowedOps CookieValueFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint CookieValueFieldInfo = (~) CString
type AttrTransferTypeConstraint CookieValueFieldInfo = (~)CString
type AttrTransferType CookieValueFieldInfo = CString
type AttrGetType CookieValueFieldInfo = Maybe T.Text
type AttrLabel CookieValueFieldInfo = "value"
type AttrOrigin CookieValueFieldInfo = Cookie
attrGet = getCookieValue
attrSet = setCookieValue
attrConstruct = undefined
attrClear = clearCookieValue
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.value"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#g:attr:value"
})
cookie_value :: AttrLabelProxy "value"
cookie_value = AttrLabelProxy
#endif
getCookieDomain :: MonadIO m => Cookie -> m (Maybe T.Text)
getCookieDomain :: forall (m :: * -> *). MonadIO m => Cookie -> m (Maybe Text)
getCookieDomain Cookie
s = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setCookieDomain :: MonadIO m => Cookie -> CString -> m ()
setCookieDomain :: forall (m :: * -> *). MonadIO m => Cookie -> CString -> m ()
setCookieDomain Cookie
s CString
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (CString
val :: CString)
clearCookieDomain :: MonadIO m => Cookie -> m ()
clearCookieDomain :: forall (m :: * -> *). MonadIO m => Cookie -> m ()
clearCookieDomain Cookie
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data CookieDomainFieldInfo
instance AttrInfo CookieDomainFieldInfo where
type AttrBaseTypeConstraint CookieDomainFieldInfo = (~) Cookie
type AttrAllowedOps CookieDomainFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint CookieDomainFieldInfo = (~) CString
type AttrTransferTypeConstraint CookieDomainFieldInfo = (~)CString
type AttrTransferType CookieDomainFieldInfo = CString
type AttrGetType CookieDomainFieldInfo = Maybe T.Text
type AttrLabel CookieDomainFieldInfo = "domain"
type AttrOrigin CookieDomainFieldInfo = Cookie
attrGet = getCookieDomain
attrSet = setCookieDomain
attrConstruct = undefined
attrClear = clearCookieDomain
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.domain"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#g:attr:domain"
})
cookie_domain :: AttrLabelProxy "domain"
cookie_domain = AttrLabelProxy
#endif
getCookiePath :: MonadIO m => Cookie -> m (Maybe T.Text)
getCookiePath :: forall (m :: * -> *). MonadIO m => Cookie -> m (Maybe Text)
getCookiePath Cookie
s = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr Cookie -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setCookiePath :: MonadIO m => Cookie -> CString -> m ()
setCookiePath :: forall (m :: * -> *). MonadIO m => Cookie -> CString -> m ()
setCookiePath Cookie
s CString
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (CString
val :: CString)
clearCookiePath :: MonadIO m => Cookie -> m ()
clearCookiePath :: forall (m :: * -> *). MonadIO m => Cookie -> m ()
clearCookiePath Cookie
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data CookiePathFieldInfo
instance AttrInfo CookiePathFieldInfo where
type AttrBaseTypeConstraint CookiePathFieldInfo = (~) Cookie
type AttrAllowedOps CookiePathFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint CookiePathFieldInfo = (~) CString
type AttrTransferTypeConstraint CookiePathFieldInfo = (~)CString
type AttrTransferType CookiePathFieldInfo = CString
type AttrGetType CookiePathFieldInfo = Maybe T.Text
type AttrLabel CookiePathFieldInfo = "path"
type AttrOrigin CookiePathFieldInfo = Cookie
attrGet = getCookiePath
attrSet = setCookiePath
attrConstruct = undefined
attrClear = clearCookiePath
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.path"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#g:attr:path"
})
cookie_path :: AttrLabelProxy "path"
cookie_path = AttrLabelProxy
#endif
getCookieExpires :: MonadIO m => Cookie -> m (Maybe Soup.Date.Date)
getCookieExpires :: forall (m :: * -> *). MonadIO m => Cookie -> m (Maybe Date)
getCookieExpires Cookie
s = IO (Maybe Date) -> m (Maybe Date)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Date) -> m (Maybe Date))
-> IO (Maybe Date) -> m (Maybe Date)
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO (Maybe Date)) -> IO (Maybe Date)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO (Maybe Date)) -> IO (Maybe Date))
-> (Ptr Cookie -> IO (Maybe Date)) -> IO (Maybe Date)
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr Date
val <- Ptr (Ptr Date) -> IO (Ptr Date)
forall a. Storable a => Ptr a -> IO a
peek (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr (Ptr Date)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) :: IO (Ptr Soup.Date.Date)
Maybe Date
result <- Ptr Date -> (Ptr Date -> IO Date) -> IO (Maybe Date)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr Date
val ((Ptr Date -> IO Date) -> IO (Maybe Date))
-> (Ptr Date -> IO Date) -> IO (Maybe Date)
forall a b. (a -> b) -> a -> b
$ \Ptr Date
val' -> do
Date
val'' <- ((ManagedPtr Date -> Date) -> Ptr Date -> IO Date
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Date -> Date
Soup.Date.Date) Ptr Date
val'
Date -> IO Date
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Date
val''
Maybe Date -> IO (Maybe Date)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Date
result
setCookieExpires :: MonadIO m => Cookie -> Ptr Soup.Date.Date -> m ()
setCookieExpires :: forall (m :: * -> *). MonadIO m => Cookie -> Ptr Date -> m ()
setCookieExpires Cookie
s Ptr Date
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr (Ptr Date) -> Ptr Date -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr (Ptr Date)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (Ptr Date
val :: Ptr Soup.Date.Date)
clearCookieExpires :: MonadIO m => Cookie -> m ()
clearCookieExpires :: forall (m :: * -> *). MonadIO m => Cookie -> m ()
clearCookieExpires Cookie
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
Ptr (Ptr Date) -> Ptr Date -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr (Ptr Date)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (Ptr Date
forall a. Ptr a
FP.nullPtr :: Ptr Soup.Date.Date)
#if defined(ENABLE_OVERLOADING)
data CookieExpiresFieldInfo
instance AttrInfo CookieExpiresFieldInfo where
type AttrBaseTypeConstraint CookieExpiresFieldInfo = (~) Cookie
type AttrAllowedOps CookieExpiresFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint CookieExpiresFieldInfo = (~) (Ptr Soup.Date.Date)
type AttrTransferTypeConstraint CookieExpiresFieldInfo = (~)(Ptr Soup.Date.Date)
type AttrTransferType CookieExpiresFieldInfo = (Ptr Soup.Date.Date)
type AttrGetType CookieExpiresFieldInfo = Maybe Soup.Date.Date
type AttrLabel CookieExpiresFieldInfo = "expires"
type AttrOrigin CookieExpiresFieldInfo = Cookie
attrGet = getCookieExpires
attrSet = setCookieExpires
attrConstruct = undefined
attrClear = clearCookieExpires
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.expires"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#g:attr:expires"
})
cookie_expires :: AttrLabelProxy "expires"
cookie_expires = AttrLabelProxy
#endif
getCookieSecure :: MonadIO m => Cookie -> m Bool
getCookieSecure :: forall (m :: * -> *). MonadIO m => Cookie -> m Bool
getCookieSecure Cookie
s = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO Bool) -> IO Bool
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO Bool) -> IO Bool)
-> (Ptr Cookie -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
CInt
val <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) :: IO CInt
let val' :: Bool
val' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
val
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
val'
setCookieSecure :: MonadIO m => Cookie -> Bool -> m ()
setCookieSecure :: forall (m :: * -> *). MonadIO m => Cookie -> Bool -> m ()
setCookieSecure Cookie
s Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
let val' :: CInt
val' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
val
Ptr CInt -> CInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (CInt
val' :: CInt)
#if defined(ENABLE_OVERLOADING)
data CookieSecureFieldInfo
instance AttrInfo CookieSecureFieldInfo where
type AttrBaseTypeConstraint CookieSecureFieldInfo = (~) Cookie
type AttrAllowedOps CookieSecureFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint CookieSecureFieldInfo = (~) Bool
type AttrTransferTypeConstraint CookieSecureFieldInfo = (~)Bool
type AttrTransferType CookieSecureFieldInfo = Bool
type AttrGetType CookieSecureFieldInfo = Bool
type AttrLabel CookieSecureFieldInfo = "secure"
type AttrOrigin CookieSecureFieldInfo = Cookie
attrGet = getCookieSecure
attrSet = setCookieSecure
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.secure"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#g:attr:secure"
})
cookie_secure :: AttrLabelProxy "secure"
cookie_secure = AttrLabelProxy
#endif
getCookieHttpOnly :: MonadIO m => Cookie -> m Bool
getCookieHttpOnly :: forall (m :: * -> *). MonadIO m => Cookie -> m Bool
getCookieHttpOnly Cookie
s = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO Bool) -> IO Bool
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO Bool) -> IO Bool)
-> (Ptr Cookie -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
CInt
val <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44) :: IO CInt
let val' :: Bool
val' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
val
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
val'
setCookieHttpOnly :: MonadIO m => Cookie -> Bool -> m ()
setCookieHttpOnly :: forall (m :: * -> *). MonadIO m => Cookie -> Bool -> m ()
setCookieHttpOnly Cookie
s Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Cookie -> (Ptr Cookie -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Cookie
s ((Ptr Cookie -> IO ()) -> IO ()) -> (Ptr Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
ptr -> do
let val' :: CInt
val' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
val
Ptr CInt -> CInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Cookie
ptr Ptr Cookie -> Int -> Ptr CInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44) (CInt
val' :: CInt)
#if defined(ENABLE_OVERLOADING)
data CookieHttpOnlyFieldInfo
instance AttrInfo CookieHttpOnlyFieldInfo where
type AttrBaseTypeConstraint CookieHttpOnlyFieldInfo = (~) Cookie
type AttrAllowedOps CookieHttpOnlyFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint CookieHttpOnlyFieldInfo = (~) Bool
type AttrTransferTypeConstraint CookieHttpOnlyFieldInfo = (~)Bool
type AttrTransferType CookieHttpOnlyFieldInfo = Bool
type AttrGetType CookieHttpOnlyFieldInfo = Bool
type AttrLabel CookieHttpOnlyFieldInfo = "http_only"
type AttrOrigin CookieHttpOnlyFieldInfo = Cookie
attrGet = getCookieHttpOnly
attrSet = setCookieHttpOnly
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.httpOnly"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#g:attr:httpOnly"
})
cookie_httpOnly :: AttrLabelProxy "httpOnly"
cookie_httpOnly = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Cookie
type instance O.AttributeList Cookie = CookieAttributeList
type CookieAttributeList = ('[ '("name", CookieNameFieldInfo), '("value", CookieValueFieldInfo), '("domain", CookieDomainFieldInfo), '("path", CookiePathFieldInfo), '("expires", CookieExpiresFieldInfo), '("secure", CookieSecureFieldInfo), '("httpOnly", CookieHttpOnlyFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "soup_cookie_new" soup_cookie_new ::
CString ->
CString ->
CString ->
CString ->
Int32 ->
IO (Ptr Cookie)
cookieNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> T.Text
-> T.Text
-> Int32
-> m Cookie
cookieNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Text -> Text -> Text -> Int32 -> m Cookie
cookieNew Text
name Text
value Text
domain Text
path Int32
maxAge = IO Cookie -> m Cookie
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Cookie -> m Cookie) -> IO Cookie -> m Cookie
forall a b. (a -> b) -> a -> b
$ do
CString
name' <- Text -> IO CString
textToCString Text
name
CString
value' <- Text -> IO CString
textToCString Text
value
CString
domain' <- Text -> IO CString
textToCString Text
domain
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr Cookie
result <- CString
-> CString -> CString -> CString -> Int32 -> IO (Ptr Cookie)
soup_cookie_new CString
name' CString
value' CString
domain' CString
path' Int32
maxAge
Text -> Ptr Cookie -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieNew" Ptr Cookie
result
Cookie
result' <- ((ManagedPtr Cookie -> Cookie) -> Ptr Cookie -> IO Cookie
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Cookie -> Cookie
Cookie) Ptr Cookie
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
Cookie -> IO Cookie
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Cookie
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_cookie_applies_to_uri" soup_cookie_applies_to_uri ::
Ptr Cookie ->
Ptr Soup.URI.URI ->
IO CInt
cookieAppliesToUri ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> Soup.URI.URI
-> m Bool
cookieAppliesToUri :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> URI -> m Bool
cookieAppliesToUri Cookie
cookie URI
uri = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
Ptr URI
uri' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
uri
CInt
result <- Ptr Cookie -> Ptr URI -> IO CInt
soup_cookie_applies_to_uri Ptr Cookie
cookie' Ptr URI
uri'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
uri
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data CookieAppliesToUriMethodInfo
instance (signature ~ (Soup.URI.URI -> m Bool), MonadIO m) => O.OverloadedMethod CookieAppliesToUriMethodInfo Cookie signature where
overloadedMethod = cookieAppliesToUri
instance O.OverloadedMethodInfo CookieAppliesToUriMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieAppliesToUri",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieAppliesToUri"
})
#endif
foreign import ccall "soup_cookie_copy" soup_cookie_copy ::
Ptr Cookie ->
IO (Ptr Cookie)
cookieCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m Cookie
cookieCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> m Cookie
cookieCopy Cookie
cookie = IO Cookie -> m Cookie
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Cookie -> m Cookie) -> IO Cookie -> m Cookie
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
Ptr Cookie
result <- Ptr Cookie -> IO (Ptr Cookie)
soup_cookie_copy Ptr Cookie
cookie'
Text -> Ptr Cookie -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieCopy" Ptr Cookie
result
Cookie
result' <- ((ManagedPtr Cookie -> Cookie) -> Ptr Cookie -> IO Cookie
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Cookie -> Cookie
Cookie) Ptr Cookie
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Cookie -> IO Cookie
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Cookie
result'
#if defined(ENABLE_OVERLOADING)
data CookieCopyMethodInfo
instance (signature ~ (m Cookie), MonadIO m) => O.OverloadedMethod CookieCopyMethodInfo Cookie signature where
overloadedMethod = cookieCopy
instance O.OverloadedMethodInfo CookieCopyMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieCopy"
})
#endif
foreign import ccall "soup_cookie_domain_matches" soup_cookie_domain_matches ::
Ptr Cookie ->
CString ->
IO CInt
cookieDomainMatches ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> T.Text
-> m Bool
cookieDomainMatches :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Text -> m Bool
cookieDomainMatches Cookie
cookie Text
host = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
host' <- Text -> IO CString
textToCString Text
host
CInt
result <- Ptr Cookie -> CString -> IO CInt
soup_cookie_domain_matches Ptr Cookie
cookie' CString
host'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
host'
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data CookieDomainMatchesMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m) => O.OverloadedMethod CookieDomainMatchesMethodInfo Cookie signature where
overloadedMethod = cookieDomainMatches
instance O.OverloadedMethodInfo CookieDomainMatchesMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieDomainMatches",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieDomainMatches"
})
#endif
foreign import ccall "soup_cookie_equal" soup_cookie_equal ::
Ptr Cookie ->
Ptr Cookie ->
IO CInt
cookieEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> Cookie
-> m Bool
cookieEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Cookie -> m Bool
cookieEqual Cookie
cookie1 Cookie
cookie2 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie1' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie1
Ptr Cookie
cookie2' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie2
CInt
result <- Ptr Cookie -> Ptr Cookie -> IO CInt
soup_cookie_equal Ptr Cookie
cookie1' Ptr Cookie
cookie2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie1
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie2
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data CookieEqualMethodInfo
instance (signature ~ (Cookie -> m Bool), MonadIO m) => O.OverloadedMethod CookieEqualMethodInfo Cookie signature where
overloadedMethod = cookieEqual
instance O.OverloadedMethodInfo CookieEqualMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieEqual"
})
#endif
foreign import ccall "soup_cookie_free" soup_cookie_free ::
Ptr Cookie ->
IO ()
cookieFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m ()
cookieFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Cookie -> m ()
cookieFree Cookie
cookie = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
Ptr Cookie -> IO ()
soup_cookie_free Ptr Cookie
cookie'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod CookieFreeMethodInfo Cookie signature where
overloadedMethod = cookieFree
instance O.OverloadedMethodInfo CookieFreeMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieFree"
})
#endif
foreign import ccall "soup_cookie_get_domain" soup_cookie_get_domain ::
Ptr Cookie ->
IO CString
cookieGetDomain ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m T.Text
cookieGetDomain :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Cookie -> m Text
cookieGetDomain Cookie
cookie = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
result <- Ptr Cookie -> IO CString
soup_cookie_get_domain Ptr Cookie
cookie'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieGetDomain" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data CookieGetDomainMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod CookieGetDomainMethodInfo Cookie signature where
overloadedMethod = cookieGetDomain
instance O.OverloadedMethodInfo CookieGetDomainMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieGetDomain",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieGetDomain"
})
#endif
foreign import ccall "soup_cookie_get_expires" soup_cookie_get_expires ::
Ptr Cookie ->
IO (Ptr Soup.Date.Date)
cookieGetExpires ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m (Maybe Soup.Date.Date)
cookieGetExpires :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> m (Maybe Date)
cookieGetExpires Cookie
cookie = IO (Maybe Date) -> m (Maybe Date)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Date) -> m (Maybe Date))
-> IO (Maybe Date) -> m (Maybe Date)
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
Ptr Date
result <- Ptr Cookie -> IO (Ptr Date)
soup_cookie_get_expires Ptr Cookie
cookie'
Maybe Date
maybeResult <- Ptr Date -> (Ptr Date -> IO Date) -> IO (Maybe Date)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Date
result ((Ptr Date -> IO Date) -> IO (Maybe Date))
-> (Ptr Date -> IO Date) -> IO (Maybe Date)
forall a b. (a -> b) -> a -> b
$ \Ptr Date
result' -> do
Date
result'' <- ((ManagedPtr Date -> Date) -> Ptr Date -> IO Date
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Date -> Date
Soup.Date.Date) Ptr Date
result'
Date -> IO Date
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Date
result''
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Maybe Date -> IO (Maybe Date)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Date
maybeResult
#if defined(ENABLE_OVERLOADING)
data CookieGetExpiresMethodInfo
instance (signature ~ (m (Maybe Soup.Date.Date)), MonadIO m) => O.OverloadedMethod CookieGetExpiresMethodInfo Cookie signature where
overloadedMethod = cookieGetExpires
instance O.OverloadedMethodInfo CookieGetExpiresMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieGetExpires",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieGetExpires"
})
#endif
foreign import ccall "soup_cookie_get_http_only" soup_cookie_get_http_only ::
Ptr Cookie ->
IO CInt
cookieGetHttpOnly ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m Bool
cookieGetHttpOnly :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Cookie -> m Bool
cookieGetHttpOnly Cookie
cookie = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CInt
result <- Ptr Cookie -> IO CInt
soup_cookie_get_http_only Ptr Cookie
cookie'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data CookieGetHttpOnlyMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod CookieGetHttpOnlyMethodInfo Cookie signature where
overloadedMethod = cookieGetHttpOnly
instance O.OverloadedMethodInfo CookieGetHttpOnlyMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieGetHttpOnly",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieGetHttpOnly"
})
#endif
foreign import ccall "soup_cookie_get_name" soup_cookie_get_name ::
Ptr Cookie ->
IO CString
cookieGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m T.Text
cookieGetName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Cookie -> m Text
cookieGetName Cookie
cookie = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
result <- Ptr Cookie -> IO CString
soup_cookie_get_name Ptr Cookie
cookie'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data CookieGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod CookieGetNameMethodInfo Cookie signature where
overloadedMethod = cookieGetName
instance O.OverloadedMethodInfo CookieGetNameMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieGetName"
})
#endif
foreign import ccall "soup_cookie_get_path" soup_cookie_get_path ::
Ptr Cookie ->
IO CString
cookieGetPath ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m T.Text
cookieGetPath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Cookie -> m Text
cookieGetPath Cookie
cookie = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
result <- Ptr Cookie -> IO CString
soup_cookie_get_path Ptr Cookie
cookie'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieGetPath" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data CookieGetPathMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod CookieGetPathMethodInfo Cookie signature where
overloadedMethod = cookieGetPath
instance O.OverloadedMethodInfo CookieGetPathMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieGetPath",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieGetPath"
})
#endif
foreign import ccall "soup_cookie_get_same_site_policy" soup_cookie_get_same_site_policy ::
Ptr Cookie ->
IO CUInt
cookieGetSameSitePolicy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m Soup.Enums.SameSitePolicy
cookieGetSameSitePolicy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> m SameSitePolicy
cookieGetSameSitePolicy Cookie
cookie = IO SameSitePolicy -> m SameSitePolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SameSitePolicy -> m SameSitePolicy)
-> IO SameSitePolicy -> m SameSitePolicy
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CUInt
result <- Ptr Cookie -> IO CUInt
soup_cookie_get_same_site_policy Ptr Cookie
cookie'
let result' :: SameSitePolicy
result' = (Int -> SameSitePolicy
forall a. Enum a => Int -> a
toEnum (Int -> SameSitePolicy)
-> (CUInt -> Int) -> CUInt -> SameSitePolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
SameSitePolicy -> IO SameSitePolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SameSitePolicy
result'
#if defined(ENABLE_OVERLOADING)
data CookieGetSameSitePolicyMethodInfo
instance (signature ~ (m Soup.Enums.SameSitePolicy), MonadIO m) => O.OverloadedMethod CookieGetSameSitePolicyMethodInfo Cookie signature where
overloadedMethod = cookieGetSameSitePolicy
instance O.OverloadedMethodInfo CookieGetSameSitePolicyMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieGetSameSitePolicy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieGetSameSitePolicy"
})
#endif
foreign import ccall "soup_cookie_get_secure" soup_cookie_get_secure ::
Ptr Cookie ->
IO CInt
cookieGetSecure ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m Bool
cookieGetSecure :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Cookie -> m Bool
cookieGetSecure Cookie
cookie = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CInt
result <- Ptr Cookie -> IO CInt
soup_cookie_get_secure Ptr Cookie
cookie'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data CookieGetSecureMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod CookieGetSecureMethodInfo Cookie signature where
overloadedMethod = cookieGetSecure
instance O.OverloadedMethodInfo CookieGetSecureMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieGetSecure",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieGetSecure"
})
#endif
foreign import ccall "soup_cookie_get_value" soup_cookie_get_value ::
Ptr Cookie ->
IO CString
cookieGetValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m T.Text
cookieGetValue :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Cookie -> m Text
cookieGetValue Cookie
cookie = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
result <- Ptr Cookie -> IO CString
soup_cookie_get_value Ptr Cookie
cookie'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieGetValue" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data CookieGetValueMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod CookieGetValueMethodInfo Cookie signature where
overloadedMethod = cookieGetValue
instance O.OverloadedMethodInfo CookieGetValueMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieGetValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieGetValue"
})
#endif
foreign import ccall "soup_cookie_set_domain" soup_cookie_set_domain ::
Ptr Cookie ->
CString ->
IO ()
cookieSetDomain ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> T.Text
-> m ()
cookieSetDomain :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Text -> m ()
cookieSetDomain Cookie
cookie Text
domain = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
domain' <- Text -> IO CString
textToCString Text
domain
Ptr Cookie -> CString -> IO ()
soup_cookie_set_domain Ptr Cookie
cookie' CString
domain'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetDomainMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.OverloadedMethod CookieSetDomainMethodInfo Cookie signature where
overloadedMethod = cookieSetDomain
instance O.OverloadedMethodInfo CookieSetDomainMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetDomain",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetDomain"
})
#endif
foreign import ccall "soup_cookie_set_expires" soup_cookie_set_expires ::
Ptr Cookie ->
Ptr Soup.Date.Date ->
IO ()
cookieSetExpires ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> Soup.Date.Date
-> m ()
cookieSetExpires :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Date -> m ()
cookieSetExpires Cookie
cookie Date
expires = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
Ptr Date
expires' <- Date -> IO (Ptr Date)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Date
expires
Ptr Cookie -> Ptr Date -> IO ()
soup_cookie_set_expires Ptr Cookie
cookie' Ptr Date
expires'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Date -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Date
expires
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetExpiresMethodInfo
instance (signature ~ (Soup.Date.Date -> m ()), MonadIO m) => O.OverloadedMethod CookieSetExpiresMethodInfo Cookie signature where
overloadedMethod = cookieSetExpires
instance O.OverloadedMethodInfo CookieSetExpiresMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetExpires",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetExpires"
})
#endif
foreign import ccall "soup_cookie_set_http_only" soup_cookie_set_http_only ::
Ptr Cookie ->
CInt ->
IO ()
cookieSetHttpOnly ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> Bool
-> m ()
cookieSetHttpOnly :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Bool -> m ()
cookieSetHttpOnly Cookie
cookie Bool
httpOnly = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
let httpOnly' :: CInt
httpOnly' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
httpOnly
Ptr Cookie -> CInt -> IO ()
soup_cookie_set_http_only Ptr Cookie
cookie' CInt
httpOnly'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetHttpOnlyMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.OverloadedMethod CookieSetHttpOnlyMethodInfo Cookie signature where
overloadedMethod = cookieSetHttpOnly
instance O.OverloadedMethodInfo CookieSetHttpOnlyMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetHttpOnly",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetHttpOnly"
})
#endif
foreign import ccall "soup_cookie_set_max_age" soup_cookie_set_max_age ::
Ptr Cookie ->
Int32 ->
IO ()
cookieSetMaxAge ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> Int32
-> m ()
cookieSetMaxAge :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Int32 -> m ()
cookieSetMaxAge Cookie
cookie Int32
maxAge = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
Ptr Cookie -> Int32 -> IO ()
soup_cookie_set_max_age Ptr Cookie
cookie' Int32
maxAge
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetMaxAgeMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m) => O.OverloadedMethod CookieSetMaxAgeMethodInfo Cookie signature where
overloadedMethod = cookieSetMaxAge
instance O.OverloadedMethodInfo CookieSetMaxAgeMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetMaxAge",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetMaxAge"
})
#endif
foreign import ccall "soup_cookie_set_name" soup_cookie_set_name ::
Ptr Cookie ->
CString ->
IO ()
cookieSetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> T.Text
-> m ()
cookieSetName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Text -> m ()
cookieSetName Cookie
cookie Text
name = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Cookie -> CString -> IO ()
soup_cookie_set_name Ptr Cookie
cookie' CString
name'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.OverloadedMethod CookieSetNameMethodInfo Cookie signature where
overloadedMethod = cookieSetName
instance O.OverloadedMethodInfo CookieSetNameMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetName"
})
#endif
foreign import ccall "soup_cookie_set_path" soup_cookie_set_path ::
Ptr Cookie ->
CString ->
IO ()
cookieSetPath ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> T.Text
-> m ()
cookieSetPath :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Text -> m ()
cookieSetPath Cookie
cookie Text
path = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr Cookie -> CString -> IO ()
soup_cookie_set_path Ptr Cookie
cookie' CString
path'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetPathMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.OverloadedMethod CookieSetPathMethodInfo Cookie signature where
overloadedMethod = cookieSetPath
instance O.OverloadedMethodInfo CookieSetPathMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetPath",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetPath"
})
#endif
foreign import ccall "soup_cookie_set_same_site_policy" soup_cookie_set_same_site_policy ::
Ptr Cookie ->
CUInt ->
IO ()
cookieSetSameSitePolicy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> Soup.Enums.SameSitePolicy
-> m ()
cookieSetSameSitePolicy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> SameSitePolicy -> m ()
cookieSetSameSitePolicy Cookie
cookie SameSitePolicy
policy = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
let policy' :: CUInt
policy' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (SameSitePolicy -> Int) -> SameSitePolicy -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SameSitePolicy -> Int
forall a. Enum a => a -> Int
fromEnum) SameSitePolicy
policy
Ptr Cookie -> CUInt -> IO ()
soup_cookie_set_same_site_policy Ptr Cookie
cookie' CUInt
policy'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetSameSitePolicyMethodInfo
instance (signature ~ (Soup.Enums.SameSitePolicy -> m ()), MonadIO m) => O.OverloadedMethod CookieSetSameSitePolicyMethodInfo Cookie signature where
overloadedMethod = cookieSetSameSitePolicy
instance O.OverloadedMethodInfo CookieSetSameSitePolicyMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetSameSitePolicy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetSameSitePolicy"
})
#endif
foreign import ccall "soup_cookie_set_secure" soup_cookie_set_secure ::
Ptr Cookie ->
CInt ->
IO ()
cookieSetSecure ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> Bool
-> m ()
cookieSetSecure :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Bool -> m ()
cookieSetSecure Cookie
cookie Bool
secure = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
let secure' :: CInt
secure' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
secure
Ptr Cookie -> CInt -> IO ()
soup_cookie_set_secure Ptr Cookie
cookie' CInt
secure'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetSecureMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.OverloadedMethod CookieSetSecureMethodInfo Cookie signature where
overloadedMethod = cookieSetSecure
instance O.OverloadedMethodInfo CookieSetSecureMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetSecure",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetSecure"
})
#endif
foreign import ccall "soup_cookie_set_value" soup_cookie_set_value ::
Ptr Cookie ->
CString ->
IO ()
cookieSetValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> T.Text
-> m ()
cookieSetValue :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Cookie -> Text -> m ()
cookieSetValue Cookie
cookie Text
value = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
value' <- Text -> IO CString
textToCString Text
value
Ptr Cookie -> CString -> IO ()
soup_cookie_set_value Ptr Cookie
cookie' CString
value'
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieSetValueMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.OverloadedMethod CookieSetValueMethodInfo Cookie signature where
overloadedMethod = cookieSetValue
instance O.OverloadedMethodInfo CookieSetValueMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieSetValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieSetValue"
})
#endif
foreign import ccall "soup_cookie_to_cookie_header" ::
Ptr Cookie ->
IO CString
cookieToCookieHeader ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m T.Text
Cookie
cookie = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
result <- Ptr Cookie -> IO CString
soup_cookie_to_cookie_header Ptr Cookie
cookie'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieToCookieHeader" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data CookieToCookieHeaderMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod CookieToCookieHeaderMethodInfo Cookie signature where
overloadedMethod = cookieToCookieHeader
instance O.OverloadedMethodInfo CookieToCookieHeaderMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieToCookieHeader",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieToCookieHeader"
})
#endif
foreign import ccall "soup_cookie_to_set_cookie_header" ::
Ptr Cookie ->
IO CString
cookieToSetCookieHeader ::
(B.CallStack.HasCallStack, MonadIO m) =>
Cookie
-> m T.Text
Cookie
cookie = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
CString
result <- Ptr Cookie -> IO CString
soup_cookie_to_set_cookie_header Ptr Cookie
cookie'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieToSetCookieHeader" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data CookieToSetCookieHeaderMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod CookieToSetCookieHeaderMethodInfo Cookie signature where
overloadedMethod = cookieToSetCookieHeader
instance O.OverloadedMethodInfo CookieToSetCookieHeaderMethodInfo Cookie where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.Cookie.cookieToSetCookieHeader",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Structs-Cookie.html#v:cookieToSetCookieHeader"
})
#endif
foreign import ccall "soup_cookie_parse" soup_cookie_parse ::
CString ->
Ptr Soup.URI.URI ->
IO (Ptr Cookie)
cookieParse ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Soup.URI.URI
-> m (Maybe Cookie)
cookieParse :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> URI -> m (Maybe Cookie)
cookieParse Text
header URI
origin = IO (Maybe Cookie) -> m (Maybe Cookie)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cookie) -> m (Maybe Cookie))
-> IO (Maybe Cookie) -> m (Maybe Cookie)
forall a b. (a -> b) -> a -> b
$ do
CString
header' <- Text -> IO CString
textToCString Text
header
Ptr URI
origin' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
origin
Ptr Cookie
result <- CString -> Ptr URI -> IO (Ptr Cookie)
soup_cookie_parse CString
header' Ptr URI
origin'
Maybe Cookie
maybeResult <- Ptr Cookie -> (Ptr Cookie -> IO Cookie) -> IO (Maybe Cookie)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Cookie
result ((Ptr Cookie -> IO Cookie) -> IO (Maybe Cookie))
-> (Ptr Cookie -> IO Cookie) -> IO (Maybe Cookie)
forall a b. (a -> b) -> a -> b
$ \Ptr Cookie
result' -> do
Cookie
result'' <- ((ManagedPtr Cookie -> Cookie) -> Ptr Cookie -> IO Cookie
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Cookie -> Cookie
Cookie) Ptr Cookie
result'
Cookie -> IO Cookie
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Cookie
result''
URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
origin
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
header'
Maybe Cookie -> IO (Maybe Cookie)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Cookie
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveCookieMethod (t :: Symbol) (o :: *) :: * where
ResolveCookieMethod "appliesToUri" o = CookieAppliesToUriMethodInfo
ResolveCookieMethod "copy" o = CookieCopyMethodInfo
ResolveCookieMethod "domainMatches" o = CookieDomainMatchesMethodInfo
ResolveCookieMethod "equal" o = CookieEqualMethodInfo
ResolveCookieMethod "free" o = CookieFreeMethodInfo
ResolveCookieMethod "toCookieHeader" o = CookieToCookieHeaderMethodInfo
ResolveCookieMethod "toSetCookieHeader" o = CookieToSetCookieHeaderMethodInfo
ResolveCookieMethod "getDomain" o = CookieGetDomainMethodInfo
ResolveCookieMethod "getExpires" o = CookieGetExpiresMethodInfo
ResolveCookieMethod "getHttpOnly" o = CookieGetHttpOnlyMethodInfo
ResolveCookieMethod "getName" o = CookieGetNameMethodInfo
ResolveCookieMethod "getPath" o = CookieGetPathMethodInfo
ResolveCookieMethod "getSameSitePolicy" o = CookieGetSameSitePolicyMethodInfo
ResolveCookieMethod "getSecure" o = CookieGetSecureMethodInfo
ResolveCookieMethod "getValue" o = CookieGetValueMethodInfo
ResolveCookieMethod "setDomain" o = CookieSetDomainMethodInfo
ResolveCookieMethod "setExpires" o = CookieSetExpiresMethodInfo
ResolveCookieMethod "setHttpOnly" o = CookieSetHttpOnlyMethodInfo
ResolveCookieMethod "setMaxAge" o = CookieSetMaxAgeMethodInfo
ResolveCookieMethod "setName" o = CookieSetNameMethodInfo
ResolveCookieMethod "setPath" o = CookieSetPathMethodInfo
ResolveCookieMethod "setSameSitePolicy" o = CookieSetSameSitePolicyMethodInfo
ResolveCookieMethod "setSecure" o = CookieSetSecureMethodInfo
ResolveCookieMethod "setValue" o = CookieSetValueMethodInfo
ResolveCookieMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCookieMethod t Cookie, O.OverloadedMethod info Cookie p) => OL.IsLabel t (Cookie -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveCookieMethod t Cookie, O.OverloadedMethod info Cookie p, R.HasField t Cookie p) => R.HasField t Cookie p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveCookieMethod t Cookie, O.OverloadedMethodInfo info Cookie) => OL.IsLabel t (O.MethodProxy info Cookie) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif