Monero
Loading...
Searching...
No Matches
GenericPointer< ValueType, Allocator >::PercentDecodeStream Class Reference

A helper stream for decoding a percent-encoded sequence into code unit. More...

Public Types

typedef ValueType::Ch Ch

Public Member Functions

 PercentDecodeStream (const Ch *source, const Ch *end)
 Constructor.
Ch Take ()
size_t Tell () const
bool IsValid () const

Private Attributes

const Chsrc_
 Current read position.
const Chhead_
 Original head of the string.
const Chend_
 Past-the-end position.
bool valid_
 Whether the parsing is valid.

Detailed Description

template<typename ValueType, typename Allocator = CrtAllocator>
class GenericPointer< ValueType, Allocator >::PercentDecodeStream

A helper stream for decoding a percent-encoded sequence into code unit.

This stream decodes XY triplet into code unit (0-255). If it encounters invalid characters, it sets output code unit as 0 and mark invalid, and to be checked by IsValid().

Member Typedef Documentation

◆ Ch

template<typename ValueType, typename Allocator = CrtAllocator>
typedef ValueType::Ch GenericPointer< ValueType, Allocator >::PercentDecodeStream::Ch

Constructor & Destructor Documentation

◆ PercentDecodeStream()

template<typename ValueType, typename Allocator = CrtAllocator>
GenericPointer< ValueType, Allocator >::PercentDecodeStream::PercentDecodeStream ( const Ch * source,
const Ch * end )
inline

Constructor.

Parameters
sourceStart of the stream
endPast-the-end of the stream.

Member Function Documentation

◆ IsValid()

template<typename ValueType, typename Allocator = CrtAllocator>
bool GenericPointer< ValueType, Allocator >::PercentDecodeStream::IsValid ( ) const
inline

◆ Take()

template<typename ValueType, typename Allocator = CrtAllocator>
Ch GenericPointer< ValueType, Allocator >::PercentDecodeStream::Take ( )
inline

◆ Tell()

template<typename ValueType, typename Allocator = CrtAllocator>
size_t GenericPointer< ValueType, Allocator >::PercentDecodeStream::Tell ( ) const
inline

Member Data Documentation

◆ end_

template<typename ValueType, typename Allocator = CrtAllocator>
const Ch* GenericPointer< ValueType, Allocator >::PercentDecodeStream::end_
private

Past-the-end position.

◆ head_

template<typename ValueType, typename Allocator = CrtAllocator>
const Ch* GenericPointer< ValueType, Allocator >::PercentDecodeStream::head_
private

Original head of the string.

◆ src_

template<typename ValueType, typename Allocator = CrtAllocator>
const Ch* GenericPointer< ValueType, Allocator >::PercentDecodeStream::src_
private

Current read position.

◆ valid_

template<typename ValueType, typename Allocator = CrtAllocator>
bool GenericPointer< ValueType, Allocator >::PercentDecodeStream::valid_
private

Whether the parsing is valid.


The documentation for this class was generated from the following file: