gi-soup-2.4.23: Libsoup bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Structs.Range

Description

Represents a byte range as used in the Range header.

If end is non-negative, then start and end represent the bounds of of the range, counting from 0. (Eg, the first 500 bytes would be represented as start = 0 and end = 499.)

If end is -1 and start is non-negative, then this represents a range starting at start and ending with the last byte of the requested resource body. (Eg, all but the first 500 bytes would be start = 500, and end = -1.)

If end is -1 and start is negative, then it represents a "suffix range", referring to the last -start bytes of the resource body. (Eg, the last 500 bytes would be start = -500 and end = -1.)

Since: 2.26

Synopsis

Exported types

newtype Range Source #

Memory-managed wrapper type.

Constructors

Range (ManagedPtr Range) 

Instances

Instances details
Eq Range Source # 
Instance details

Defined in GI.Soup.Structs.Range

Methods

(==) :: Range -> Range -> Bool

(/=) :: Range -> Range -> Bool

BoxedPtr Range Source # 
Instance details

Defined in GI.Soup.Structs.Range

Methods

boxedPtrCopy :: Range -> IO Range

boxedPtrFree :: Range -> IO ()

CallocPtr Range Source # 
Instance details

Defined in GI.Soup.Structs.Range

Methods

boxedPtrCalloc :: IO (Ptr Range)

ManagedPtrNewtype Range Source # 
Instance details

Defined in GI.Soup.Structs.Range

Methods

toManagedPtr :: Range -> ManagedPtr Range

tag ~ 'AttrSet => Constructible Range tag Source # 
Instance details

Defined in GI.Soup.Structs.Range

Methods

new :: MonadIO m => (ManagedPtr Range -> Range) -> [AttrOp Range tag] -> m Range

newZeroRange :: MonadIO m => m Range Source #

Construct a Range struct initialized to zero.

Methods

Overloaded methods

Properties

end

the end of the range

getRangeEnd :: MonadIO m => Range -> m Int64 Source #

Get the value of the “end” field. When overloading is enabled, this is equivalent to

get range #end

setRangeEnd :: MonadIO m => Range -> Int64 -> m () Source #

Set the value of the “end” field. When overloading is enabled, this is equivalent to

set range [ #end := value ]

start

the start of the range

getRangeStart :: MonadIO m => Range -> m Int64 Source #

Get the value of the “start” field. When overloading is enabled, this is equivalent to

get range #start

setRangeStart :: MonadIO m => Range -> Int64 -> m () Source #

Set the value of the “start” field. When overloading is enabled, this is equivalent to

set range [ #start := value ]