SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWHttpRange Class Reference

Helper class that describes a Byte Range for requesting a portion of a document. More...

#include <rw/http/RWHttpRange.h>

Public Types

enum  rangeEnd { head , tail }
 

Public Member Functions

 RWHttpRange ()
 
 RWHttpRange (const RWCString &range)
 
 RWHttpRange (size_t length, rangeEnd end)
 
 RWHttpRange (size_t offset, size_t length=0)
 
RWCString getValue () const
 
void setRange (const RWCString &range)
 
void setRange (size_t length, rangeEnd end)
 
void setRange (size_t offset, size_t length)
 

Detailed Description

RWHttpRange represents an HTTP/1.1 format range for requesting portions of a document.

Member Enumeration Documentation

◆ rangeEnd

Defines from which end of the document to start counting bytes.

Enumerator
head 

The range starts at the beginning of the document and extends toward the end.

tail 

The range starts at the end of the document and extends toward the beginning.

Constructor & Destructor Documentation

◆ RWHttpRange() [1/4]

RWHttpRange::RWHttpRange ( )
inline

Constructs a default RWHttpRange object where the range is the complete document.

◆ RWHttpRange() [2/4]

RWHttpRange::RWHttpRange ( const RWCString & range)
inline

Constructs an RWHttpRange object from an RWCString. The RWCString must be a properly formatted range according to RFC 2616. The RWCString should contain 7-bit US-ASCII data.

◆ RWHttpRange() [3/4]

RWHttpRange::RWHttpRange ( size_t offset,
size_t length = 0 )
inline

Constructs an RWHttpRange object where the range starts at offset and continues for length bytes. A length of 0 means that the range continues to the end of the document.

◆ RWHttpRange() [4/4]

RWHttpRange::RWHttpRange ( size_t length,
rangeEnd end )
inline

Constructs an RWHttpRange object where the range extends length bytes from end.

Member Function Documentation

◆ getValue()

RWCString RWHttpRange::getValue ( ) const
inline

Returns the range as an RWCString. The RWCString should contain 7-bit US-ASCII data.

◆ setRange() [1/3]

void RWHttpRange::setRange ( const RWCString & range)

Sets the range to range. RWCString must be a properly formatted range according to RFC 2616. The RWCString should contain 7-bit US-ASCII data.

◆ setRange() [2/3]

void RWHttpRange::setRange ( size_t length,
rangeEnd end )

Sets the range to start at end and to extend for length bytes.

◆ setRange() [3/3]

void RWHttpRange::setRange ( size_t offset,
size_t length )

Sets the range to start at offset and to continue for length bytes.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.